Disable Menu Options

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 80
Monster Hunter
Disable Menu Options
Version: 1.0
Author: Mitsarugi
Date: 06/30/2011 (Don't Really remember)

Version History


  • <Version 1.0> 06/30/2011 - Original Release

Description


This script allows you to set the selectable options in your menu to be Disabled, handy for anyone not wanting people to enter the option
before it's needed in-game.

I originally made it to show something to Pacman, asking him to make a patch for me (as seen in the demo)
You might also see a little something i started scripting myself as well called the Hunter Rank.

Features

  • Allows you to set the selectable options in your menu to be Disabled

Instructions

Place this script in its own slot above Main and below other custom scripts in the Script Editor (F11).

For instructions on use, see the demo.

Credit


  • Adurna (For the Menu used in the demo)
  • Mitsarugi

Thanks

  • Adurna
  • Mitsarugi

Support


Please post in this topic if you are reporting a bug or have a suggestion. Do so no matter how old the topic is.
If you need the Disable Menu Options for your menu just post your menu's script and i'll take a look.


Known Compatibility Issues

There might be some issues with scripts that create a new menu scene.

Demo

Version: 1.0
http://www.mediafire.com/?n02lqxplxdgw2pw
« Last Edit: January 14, 2012, 11:15:16 PM by Mitsarugi »

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best RPG Maker User (Scripting)2011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best Use of Avatar and Signature Space2010 Favourite Staff Member2010 Most Mature Member
Thanks for sharing!

***
Rep:
Level 80
Monster Hunter
Thanks for sharing!
well i know it's not much and i'm just starting a little bit but hey ^^ people might find it useful :)

**
Rep: +0/-0Level 67
I couldn't get the script to work. So I wrote it myself  ;D

Code: [Select]
$game_system.item_disabled
$game_system.skill_disabled
$game_system.equip_disabled
$game_system.status_disabled
By setting these variables to true or false you can disable and enable the menu options.

Code: [Select]
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#  This class handles system-related data. Also manages vehicles and BGM, etc.
# The instance of this class is referenced by $game_system.
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :timer                    # timer
  attr_accessor :timer_working            # timer working flag
  attr_accessor :item_disabled
  attr_accessor :skill_disabled
  attr_accessor :equip_disabled
  attr_accessor :status_disabled
  attr_accessor :save_disabled            # save forbidden
  attr_accessor :menu_disabled            # menu forbidden
  attr_accessor :encounter_disabled       # encounter forbidden
  attr_accessor :save_count               # save count
  attr_accessor :version_id               # game version ID
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @timer = 0
    @timer_working = false
    @item_disabled = false
    @skill_disabled = false
    @equip_disabled = false
    @status_disabled = false
    @save_disabled = false
    @menu_disabled = false
    @encounter_disabled = false
    @save_count = 0
    @version_id = 0
  end
end

#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs the menu screen processing.
#==============================================================================

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = Vocab::save
    s6 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # If number of party members is 0
      @command_window.draw_item(0, false)     # Disable item
      @command_window.draw_item(1, false)     # Disable skill
      @command_window.draw_item(2, false)     # Disable equipment
      @command_window.draw_item(3, false)     # Disable status
    end
   
    if $game_system.item_disabled
      @command_window.draw_item(0, false)
    end
    if $game_system.skill_disabled
      @command_window.draw_item(1, false)
    end
    if $game_system.equip_disabled
      @command_window.draw_item(2, false)
    end
    if $game_system.status_disabled
      @command_window.draw_item(3, false)
    end
    if $game_system.save_disabled             # If save is forbidden
      @command_window.draw_item(4, false)     # Disable save
    end
  end
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.item_disabled and @command_window.index == 0
        Sound.play_buzzer
        return
      elsif $game_system.skill_disabled and @command_window.index == 1
        Sound.play_buzzer
        return
      elsif $game_system.equip_disabled and @command_window.index == 2
        Sound.play_buzzer
        return
      elsif $game_system.status_disabled and @command_window.index == 3
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # Item
        $scene = Scene_Item.new
      when 1,2,3  # Skill, equipment, status
        start_actor_selection
      when 4      # Save
        $scene = Scene_File.new(true, false, false)
      when 5      # End Game
        $scene = Scene_End.new
      end
    end
  end
end

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Zero to Hero2014 Best IRC Quote2014 Most Missed Member2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Your code is correct, the_Cr0w, but you could've aliased methods instead of rewriting them entirely, to increase compatibility. Here, I'll show you what I mean.
Code: [Select]
class Game_System
  #--------------------------------------------------------------------------
  # Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor  :item_disabled
  attr_accessor  :skill_disabled
  attr_accessor  :equip_disabled
  attr_accessor  :status_disabled
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias disable_menu_options_initialize initialize
  def initialize
    disable_menu_options_initialize
    @item_disabled = false
    @skill_disabled = false
    @equip_disabled = false
    @status_disabled = false
  end
end

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  alias disable_menu_options_crtcommwind create_command_window
  def create_command_window
    disable_menu_options_crtcommwind
    if $game_system.item_disabled
      @command_window.draw_item(0, false)
    end
    if $game_system.skill_disabled
      @command_window.draw_item(1, false)
    end
    if $game_system.equip_disabled
      @command_window.draw_item(2, false)
    end
    if $game_system.status_disabled
      @command_window.draw_item(3, false)
    end
  end
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  alias disable_menu_options_updcommsel update_command_selection
  def update_command_selection
    if Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.item_disabled and @command_window.index == 0
        Sound.play_buzzer
        return
      elsif $game_system.skill_disabled and @command_window.index == 1
        Sound.play_buzzer
        return
      elsif $game_system.equip_disabled and @command_window.index == 2
        Sound.play_buzzer
        return
      elsif $game_system.status_disabled and @command_window.index == 3
        Sound.play_buzzer
        return
      end
    end
    disable_menu_options_updcommsel
  end
end
Should be a lot more compatible than what you posted.
« Last Edit: July 10, 2011, 01:00:30 PM by modern algebra »
it's like a metaphor or something i don't know

**
Rep: +0/-0Level 67
I didn't know that. Thanks for the correction.

***
Rep:
Level 80
Monster Hunter
thanks Pacman and The_Crow and Modern Algebra^^ (should be a lot cleaner then what i did ^^)
« Last Edit: July 14, 2011, 11:46:16 PM by Mitsarugi »

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Zero to Hero2014 Best IRC Quote2014 Most Missed Member2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
I noticed that MA edited my post. I'm sure I did something wrong then. So don't give us all the thanks, I'm sure he did something.
it's like a metaphor or something i don't know

*
Rep: +0/-0Level 68
RMRK Junior
I just have one question:
When you do not need this script anymore how do you finish the call in the map, let's say I've 5 maps where the player doesn't need to know what's on the Menu but save and exit game so how I make the call on the first map to this script? and how do I finish the call of the script after the player walk the maps I want it?(obviously I haven't download the demo since I can't download for now any .exe file) Sorry for the problems hope you can answer me soon.Thanks to Mitsarugi, Modern Algebra, The Crow and Pacman for working on this script. Take care everybody and Have a great day.
« Last Edit: August 05, 2011, 03:06:07 PM by M3lk0r »

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Zero to Hero2014 Best IRC Quote2014 Most Missed Member2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
First, you'd need this script I just invented in your editor.
Code: [Select]
#===============================================================================
# Pacman's Small Menu
# 6/8/2011
#   ------------------------------------------------------------------------   #
# For simple setup, set this to the ID of the switch that toggles the small
# menu. If this switch is on, the small menu will show up instead of the normal
# menu. If it is off, the normal menu will show up.
#===============================================================================

module SMALLMENU
  SWITCH = 1  # Switch ID of the toggle.
end

#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs the map screen processing.
#==============================================================================

class Scene_Map < Scene_Base
  #--------------------------------------------------------------------------
  # alias listing
  #--------------------------------------------------------------------------
  alias smallmn_updmncll update_call_menu
  alias smallmn_updscnchg update_scene_change
  #--------------------------------------------------------------------------
  # * Detemine if Menu if Called due to Cancel Button
  #--------------------------------------------------------------------------
  def update_call_menu
    unless $game_switches[SMALLMENU::SWITCH]     # If the switch is off
      smallmn_updmncll                           # Normal processing
    else                                         # If the switch is on
      if Input.trigger?(Input::B)                # If B button is pressed
        return if $game_map.interpreter.running? # Unless event is happening
        return if $game_system.menu_disabled     # Unless menu is disabled
        $game_temp.menu_beep = true              # Beep!
        $game_temp.next_scene = "smallmenu"      # Scene flag
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Execute Screen Switch
  #--------------------------------------------------------------------------
  def update_scene_change
    return if $game_player.moving?
    case $game_temp.next_scene
    when "smallmenu"
      call_smallmenu
    end
    smallmn_updscnchg
  end
  #--------------------------------------------------------------------------
  # * Switch to Small Menu Screen
  #--------------------------------------------------------------------------
  def call_smallmenu
    if $game_temp.menu_beep
      Sound.play_decision
      $game_temp.menu_beep = nil
    end
    $game_temp.next_scene = nil
    $scene = Scene_SmallMenu.new
  end
end

#==============================================================================
# ** Scene_End
#------------------------------------------------------------------------------
#  This class performs game end screen processing.
#==============================================================================

class Scene_End < Scene_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(from_menu = true, from_smallmenu = false)
    @from_menu = from_menu
    @from_smallmenu = from_smallmenu
  end
  #--------------------------------------------------------------------------
  # * Return to Original Screen
  #--------------------------------------------------------------------------
  def return_scene
    $scene = @from_menu ? Scene_Menu.new(5) : Scene_SmallMenu.new(1)
  end
end

#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
#  This class performs the save and load screen processing.
#==============================================================================

class Scene_File < Scene_Base
  #--------------------------------------------------------------------------
  # alias listing
  #--------------------------------------------------------------------------
  alias smallmenu_initialize initialize
  alias smallmenu_return_scene return_scene
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(saving, from_title, from_event, smallmenu = false)
    smallmenu_initialize(saving, from_title, from_event)
    @smallmenu = smallmenu
  end
  #--------------------------------------------------------------------------
  # * Return to Original Screen
  #--------------------------------------------------------------------------
  def return_scene
    if @smallmenu
      $scene = Scene_SmallMenu.new
    else
      smallmenu_return_scene
    end
  end
end

#==============================================================================
# ** Scene_SmallMenu
#------------------------------------------------------------------------------
#  This class performs the small menu screen processing.
#==============================================================================

class Scene_SmallMenu < Scene_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(smallmenu_index = 0)
    @smallmenu_index = smallmenu_index
  end
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    create_command_window
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @command_window.update
    update_command_selection
  end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::save
    s2 = Vocab::game_end
    commands = [s1, s2]
    @command_window = Window_Command.new(160, commands)
    @command_window.x = Graphics.width / 2 - 80
    @command_window.y = Graphics.height / 2 - 40
    @command_window.index = @smallmenu_index
    if $game_system.save_disabled
      @command_window.draw_item(4, false)
    end
  end
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_system.save_disabled and @command_window.index == 0
        Sound.play_buzzer
        return
      end
      case @command_window.index
      when 0
        $scene = Scene_File.new(true, false, false, true)
      when 1
        $scene = Scene_End.new(false, true)
      end
    end
  end
end

#===============================================================================
#
# END OF SCRIPT
#
#===============================================================================
Then, put the switch on whenever you want the small window to pop up instead of the normal menu. I think that's what you wanted.
Anyway, the script in this topic cannot perform what you're asking. That's not what it was made for.

Enjoy.
it's like a metaphor or something i don't know