Â
#============================================================================
# L's Custom Menu - Simple DMS Edit (RMVX ver.) Rev.1
# Added Equip & Skills submenus - 27Feb09 - Brew
# Plug in your scene calls starting on line 582
#============================================================================
Â
module MenuCommand
 #Default menu commands +1
 Item   = 'Item'
 Skill   = 'Skill'
 Equip   = 'Equip'
 Status  = 'Status'
 Save   = 'Save'
 Load   = 'Load'
 End_Game = 'Exit'
 #Optional menu commands
 Order   = 'Order'
 Party   = 'Party'
 Option  = 'Option'
 Quest   = 'Quest'
 System  = 'System'
 Beastiary = 'Beastiary'
 Sound   = 'Sound'
 Check   = 'Check'
 Upgrade  = 'Upgrade'
 Enhance  = 'Enhance'
 Mix    = 'Mix'
end
Â
#------------------------------------------------------------------------------
# Â Game_Map
#------------------------------------------------------------------------------
class Game_Map
#------------------------------------------------------------------------------
# Â Name
#------------------------------------------------------------------------------
 def name
  $map_infos[@map_id]
 end
end
Â
Â
#========================================
# Â Scene_Title
#--------------------------------------------------------------------------------
# Setting functions for the Title
#========================================
class Scene_Title
 $map_infos = load_data("Data/MapInfos.rvdata")
 for key in $map_infos.keys
  $map_infos[key] = $map_infos[key].name
 end
end
Â
Â
class Window_MapName < Window_Base
 def initialize(x, y)
  super(x, y, 160, 96)
  self.contents = Bitmap.new(width - 32, height - 32) Â
  refresh
 end
 def refresh
  self.contents.clear
  self.contents.font.color = system_color
  self.contents.draw_text(4, 0, 120, 32, "Location")
  self.contents.font.color = normal_color
  self.contents.draw_text(4, WLH, 120, 32, $game_map.name.to_s, 2)
 end
end
Â
Â
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# Â This class performs the menu screen processing.
#==============================================================================
Â
class Scene_Menu < Scene_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #   menu_index : command cursor's initial position
 #--------------------------------------------------------------------------
 def initialize(menu_index = 0)
  @menu_index = menu_index
  commands_init
  @changer = 0 #Change Party Order by Yargovish
  @where = 0 #
  @checker = 0  #
 end
 #--------------------------------------------------------------------------
 # * Set Commands
 #--------------------------------------------------------------------------
 def commands_init
  @commands = []
  s1 = MenuCommand::Status
  s2 = MenuCommand::Item
  s3 = MenuCommand::Equip
  s4 = MenuCommand::Skill
  s5 = MenuCommand::Beastiary
  s6 = MenuCommand::System
  @commands.push(s1, s2, s3, s4, s5, s6).flatten!
 Â
  @sys_commands = []
  o1 = MenuCommand::Save
  o2 = MenuCommand::Load
  o3 = MenuCommand::Sound
  o4 = MenuCommand::End_Game
  @sys_commands.push(o1, o2, o3, o4).flatten!
 Â
  @equip_commands = []
  e1 = MenuCommand::Check
  e2 = MenuCommand::Upgrade
  e3 = MenuCommand::Enhance
  @equip_commands.push(e1, e2, e3).flatten!
Â
  @skill_commands = []
  o1 = MenuCommand::Check
  o2 = MenuCommand::Upgrade
  o3 = MenuCommand::Mix
  @skill_commands.push(o1, o2, o3).flatten!
 end
 #--------------------------------------------------------------------------
 # * Start processing
 #--------------------------------------------------------------------------
 def start
  super
  create_menu_background
  create_command_window
  create_system_window
  create_equip_window
  create_skill_window
  @gold_window = Window_Gold.new(0, 264)
  @status_window = Window_MenuStatus.new(160, 0)
  @mapname_window = Window_MapName.new(0, 320)
 end
 #--------------------------------------------------------------------------
 # * Termination Processing
 #--------------------------------------------------------------------------
 def terminate
  super
  dispose_menu_background
  @command_window.dispose
  @sys_command_window.dispose
  @gold_window.dispose
  @status_window.dispose
  @mapname_window.dispose
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
  super
  update_menu_background
  @command_window.update
  @sys_command_window.update
  @equip_command_window.update
  @skill_command_window.update
  @gold_window.update
  @status_window.update
  @mapname_window.update
  if @command_window.active
   update_command_selection
  elsif @sys_command_window.active
   @sys_command_window.z = +500
   update_sys_command_selection
  elsif @status_window.active
   update_actor_selection
  elsif @equip_command_window.active
   @equip_command_window.z = +500
   update_equip_command_selection
  elsif @skill_command_window.active
   @skill_command_window.z = +500
   update_skill_command_selection   Â
  end
 end
 #--------------------------------------------------------------------------
 # * Create Command Window
 #--------------------------------------------------------------------------
 def create_command_window
  @command_window = Window_Command.new(160, @commands)
  @command_window.index = @menu_index
  if $game_party.members.size == 0      # If number of party members is 0
   @command_window.draw_item(1, false)   # Disable item
   @command_window.draw_item(3, false)   # Disable skill
   @command_window.draw_item(2, false)   # Disable equipment
   @command_window.draw_item(0, false)   # Disable status
  end Â
 end
 #--------------------------------------------------------------------------
 # * Create System Window
 #--------------------------------------------------------------------------
 def create_system_window
  @sys_command_window = Window_Command.new(128, @sys_commands)
  @sys_command_window.visible = false
  @sys_command_window.active = false
  @sys_command_window.x = 100
  @sys_command_window.y = 120
  @sys_command_window.z = 0
  check_save_available
  check_load_available
 end
 #-----------------
 def check_save_available
  if $game_system.save_disabled       # If save is forbidden
   @sys_command_window.draw_item(1, false)   # Disable save
  end
 end
 #-----------------
 def check_load_available
  #Check if saved file exists
  @load_enabled = (Dir.glob('Save*.rvdata').size > 0)
  if !@load_enabled
   #Put your @command_window.draw_item(index, false) to disable load
   @sys_command_window.draw_item(2, false)
  end
 end
 #--------------------------------------------------------------------------
 # * Create Equip Window
 #--------------------------------------------------------------------------
 def create_equip_window
  @equip_command_window = Window_Command.new(128, @equip_commands)
  @equip_command_window.visible = false
  @equip_command_window.active = false
  @equip_command_window.x = 100
  @equip_command_window.y = 48
  @equip_command_window.z = 0
 end
 #--------------------------------------------------------------------------
 # * Create Skill Window
 #--------------------------------------------------------------------------
 def create_skill_window
  @skill_command_window = Window_Command.new(128, @skill_commands)
  @skill_command_window.visible = false
  @skill_command_window.active = false
  @skill_command_window.x = 100
  @skill_command_window.y = 72
  @skill_command_window.z = 0
 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)
   # Return if Disabled Command
   if disabled_main_command?
    # Play buzzer SE
    Sound.play_buzzer
    return
   end
   main_command_input
  end
 end
 #--------------------------------------------------------------------------
 # * Update Sys Command Selection
 #--------------------------------------------------------------------------
 def update_sys_command_selection
  if Input.trigger?(Input::B)
   Sound.play_cancel
   @command_window.active = true
   @sys_command_window.active = false
   @sys_command_window.visible = false
   @sys_command_window.index = 0
   @sys_command_window.z = -500
   return
  elsif Input.trigger?(Input::C)
   # Return if Disabled Command
   if disabled_main_command?
    # Play buzzer SE
    Sound.play_buzzer
    return
   end
   sys_command_input
  end
 end
 #--------------------------------------------------------------------------
 # * Update Equip Command Selection
 #--------------------------------------------------------------------------
 def update_equip_command_selection
  if Input.trigger?(Input::B)
   Sound.play_cancel
   @command_window.active = true
   @equip_command_window.active = false
   @equip_command_window.visible = false
   @equip_command_window.index = 0
   @equip_command_window.z = -500
   return
  elsif Input.trigger?(Input::C)
   # Return if Disabled Command
# Â Â Â if disabled_main_command?
    # Play buzzer SE
# Â Â Â Â Sound.play_buzzer
# Â Â Â Â return
# Â Â Â end
   equip_command_input
  end
 end
 #--------------------------------------------------------------------------
 # * Update Skill Command Selection
 #--------------------------------------------------------------------------
 def update_skill_command_selection
  if Input.trigger?(Input::B)
   Sound.play_cancel
   @command_window.active = true
   @skill_command_window.active = false
   @skill_command_window.visible = false
   @skill_command_window.index = 0
   @skill_command_window.z = -500
   return
  elsif Input.trigger?(Input::C)
   # Return if Disabled Command
   if disabled_main_command?
    # Play buzzer SE
    Sound.play_buzzer
    return
   end
   skill_command_input
  end
 end
 #--------------------------------------------------------------------------
 # * Disabled Main Command? Test
 #--------------------------------------------------------------------------
 def disabled_main_command?
  # Gets Current Command
  command = @commands[@command_window.index]
  sys_command = @sys_commands[@sys_command_window.index]
  # Gets Menu Commands
  c = MenuCommand
  # If 0 Party Size
  if $game_party.members.size == 0
   # If Item, Skill, Equip or Status Selected
   if [c::Item, c::Skill, c::Equip, c::Status].include?(command)
    return true
   end
  elsif $game_party.members.size <= 1
   # If the command is changing member order
   if [c::Order].include?(command)
    return true
   end
  end
  # If Save Disabled && Command is Save
  return true if $game_system.save_disabled and sys_command == c::Save
  # If Load Disabled && Command is Load
  return true if !@load_enabled && sys_command == c::Load
  return false
 end
 #--------------------------------------------------------------------------
 # * Update Command Check
 #--------------------------------------------------------------------------
 def main_command_input
  # Loads Current Command
  command = @commands[@command_window.index]
  # Play decision SE
  Sound.play_decision
  # Checks Commands
  case command
  when MenuCommand::Item  #item
   command_item
  when MenuCommand::Skill #skill
   @skill_command_window.active = true
   @skill_command_window.visible = true
   @command_window.active = false  Â
  when MenuCommand::Equip #equip
   @equip_command_window.active = true
   @equip_command_window.visible = true
   @command_window.active = false  Â
  when MenuCommand::Status #status
   start_actor_selection Â
  when MenuCommand::Order #order
   command_order
  when MenuCommand::Beastiary #order
   command_beastiary
  when MenuCommand::System  #call system submenu
   @sys_command_window.active = true
   @sys_command_window.visible = true
   @command_window.active = false  Â
  end
 end
 #--------------------------------------------------------------------------
 # * Update System Command Check
 #--------------------------------------------------------------------------
 def sys_command_input
  # Loads Current Command
  sys_command = @sys_commands[@sys_command_window.index]
  # Play decision SE
  Sound.play_decision
  # Checks Commands
  case sys_command
  when MenuCommand::Option  #option
   command_option
  when MenuCommand::Sound  #sound
   command_sound
  when MenuCommand::Save  #save
   command_save
  when MenuCommand::Load  #load
   command_load
  when MenuCommand::End_Game  #exit
   command_endgame
  end
 end
 #--------------------------------------------------------------------------
 # * Update Equip Command Check
 #--------------------------------------------------------------------------
 def equip_command_input
  # Loads Current Command
  equip_command = @equip_commands[@equip_command_window.index]
  # Play decision SE
  Sound.play_decision
  # Checks Commands
  case equip_command
  when MenuCommand::Check  #option
   start_actor_selection
  when MenuCommand::Upgrade  #sound
   command_upgrade_equip
  when MenuCommand::Enhance  #save
   command_enhance_equip
  end
 end
 #--------------------------------------------------------------------------
 # * Update Skill Command Check
 #--------------------------------------------------------------------------
 def skill_command_input
  # Loads Current Command
  skill_command = @skill_commands[@skill_command_window.index]
  # Play decision SE
  Sound.play_decision
  # Checks Commands
  case skill_command
  when MenuCommand::Check  #option
   start_actor_selection
  when MenuCommand::Upgrade  #sound
   command_upgrade_skills
  when MenuCommand::Mix  #save
   command_mix_skills
  end
 end
 #--------------------------------------------------------------------------
 # * Start Actor Selection
 #--------------------------------------------------------------------------
 def start_actor_selection
  @command_window.active = false
  @equip_command_window.active = false
  @equip_command_window.visible = false   Â
  @skill_command_window.active = false
  @skill_command_window.visible = false   Â
  @status_window.active = true
  if $game_party.last_actor_index < @status_window.item_max
   @status_window.index = $game_party.last_actor_index
  else
   @status_window.index = 0
  end
 end
 #--------------------------------------------------------------------------
 # * End Actor Selection
 #--------------------------------------------------------------------------
 def end_actor_selection
  @command_window.active = true
  @status_window.active = false
  @status_window.index = -1
 end
 #--------------------------------------------------------------------------
 # * Update Actor Selection
 #--------------------------------------------------------------------------
 def update_actor_selection
  # Loads Current Command
  command = @commands[@command_window.index]
  if Input.trigger?(Input::B)
   Sound.play_cancel
   end_actor_selection
  elsif Input.trigger?(Input::C)
   $game_party.last_actor_index = @status_window.index
   Sound.play_decision
   case command
   when MenuCommand::Skill  # skill
    command_skill
   when MenuCommand::Equip  # equipment
    command_equip
   when MenuCommand::Status  # status
    command_status
   end
  end
 end
 #--------------------------------------------------------------------------
 # * Command Item
 #--------------------------------------------------------------------------
 def command_item
  # Switch to item screen
  $scene = Scene_Item.new
 end
 #--------------------------------------------------------------------------
 # * Command Skill
 #--------------------------------------------------------------------------
 def command_skill
  # Switch to skill screen
  $scene = Scene_Skill.new(@status_window.index)
 end
 #--------------------------------------------------------------------------
 # * Command Equip
 #--------------------------------------------------------------------------
 def command_equip
  # Switch to equipment screen
  $scene = Scene_Equip.new(@status_window.index)
 end
 #--------------------------------------------------------------------------
 # * Command Status
 #--------------------------------------------------------------------------
 def command_status
  # Switch to status screen
  $scene = Scene_Status.new(@status_window.index)
 end
 #--------------------------------------------------------------------------
 # * Command Order
 #--------------------------------------------------------------------------
 def command_order
  # If Main Command Active
  if @command_window.active
   # Activate Status Window
   start_actor_selection
   @checker = 0
   return
  end
  #Change Party Order by Yargovish
  if @checker == 0
   @changer = $game_party.members[@status_window.index]
   @where = @status_window.index
   @checker = 1
  else
   $game_party.members[@where] = $game_party.members[@status_window.index]
   $game_party.members[@status_window.index] = @changer
   @checker = 0
   @status_window.refresh
   $game_player.refresh #
  end  Â
 end
 #--------------------------------------------------------------------------
 # * Command Party
 #--------------------------------------------------------------------------
 def command_party
  # Switch to party change screen
  #Put your Party Change Scene here
 end
 #--------------------------------------------------------------------------
 # * Command Option
 #--------------------------------------------------------------------------
 def command_option
  # Switch to option screen
  #Put your Option Scene here
 end
 #--------------------------------------------------------------------------
 # * Command Quest
 #--------------------------------------------------------------------------
 def command_quest
  # Switch to quest screen
  #Put your Quest Scene here
 end
 #--------------------------------------------------------------------------
 # * Command Save
 #--------------------------------------------------------------------------
 def command_save
  # Switch to save screen
  $scene = Scene_File.new(true, false, false)
 end
 #--------------------------------------------------------------------------
 # * Command Load
 #--------------------------------------------------------------------------
 def command_load
  # Switch to load screen
  $scene = Scene_File.new(false, false, false)
 end
 #--------------------------------------------------------------------------
 # * Command End Game
 #--------------------------------------------------------------------------
 def command_endgame
  # Switch to end game screen
  $scene = Scene_End.new
 end
 #--------------------------------------------------------------------------
 # * Command Upgrade Equip
 #--------------------------------------------------------------------------
 def command_upgrade_equip
  # Switch to upgrade screen
  # $scene = Scene_Upgrade_Equip.new
 end
 #--------------------------------------------------------------------------
 # * Command Enhance Equip
 #--------------------------------------------------------------------------
 def command_enhance_equip
  # Switch to enhance screen
 end
 #--------------------------------------------------------------------------
 # * Command Upgrade Skills
 #--------------------------------------------------------------------------
 def command_upgrade_skills
  # Switch to upgrade screen
 end
 #--------------------------------------------------------------------------
 # * Command Mix Skills
 #--------------------------------------------------------------------------
 def command_mix_skills
  # Switch to mix screen
 end
 #--------------------------------------------------------------------------
 # * Command Beastiary
 #--------------------------------------------------------------------------
 def command_beastiary
  # Switch to beastiary screen
 end
 #--------------------------------------------------------------------------
 # * Command Sound
 #--------------------------------------------------------------------------
 def command_sound
  # Switch to sound screen
 end
end
Â
#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
# Â This class performs the save and load screen processing.
#==============================================================================
Â
class Scene_File
 #--------------------------------------------------------------------------
 # * Return to Original Screen
 #--------------------------------------------------------------------------
 def return_scene
  if @from_title
   $scene = Scene_Title.new
  elsif @from_event
   $scene = Scene_Map.new
  else
   $scene = Scene_Menu.new(5)
  end
 end
end
Â
#==============================================================================
# ** Scene_Status
#------------------------------------------------------------------------------
# Â This class performs the status screen processing.
#==============================================================================
Â
class Scene_Status
 #--------------------------------------------------------------------------
 # * Return to Original Screen
 #--------------------------------------------------------------------------
 def return_scene
  $scene = Scene_Menu.new(0)
 end
end
#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
# Â This class performs the item screen processing.
#==============================================================================
Â
class Scene_Item < Scene_Base
 #--------------------------------------------------------------------------
 # * Return to Original Screen
 #--------------------------------------------------------------------------
 def return_scene
  $scene = Scene_Menu.new(1)
 end
end
#==============================================================================
# ** Scene_Skill
#------------------------------------------------------------------------------
# Â This class performs the skill screen processing.
#==============================================================================
Â
class Scene_Skill < Scene_Base
 #--------------------------------------------------------------------------
 # * Return to Original Screen
 #--------------------------------------------------------------------------
 def return_scene
  $scene = Scene_Menu.new(3)
 end
end
Â