#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs the menu screen processing.
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Constant Variables
#--------------------------------------------------------------------------
System_String = 'System'
System_Strings = [
'Save',
'Load',
'Exit Game'
]
#--------------------------------------------------------------------------
# * Alias Methods
#--------------------------------------------------------------------------
alias ikos_systemmenu_scene_menu_terminate terminate
#--------------------------------------------------------------------------
# * Create Command Window !OVERRIDE!
#--------------------------------------------------------------------------
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = System_String
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
@command_system = Window_Command.new(160, System_Strings)
@command_system.x = @command_window.width
@command_system.y = @command_window.y + @command_window.height -
@command_system.height
@command_system.z = 255
@command_system.visible = @command_system.active = false
if $game_system.save_disabled # If save is forbidden
@command_system.draw_item(0, false) # Disable save
end
end
#--------------------------------------------------------------------------
# * Frame Update !OVERRIDE!
#--------------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
@command_system.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
elsif @command_system.active
update_system_selection
end
end
#--------------------------------------------------------------------------
# * Update Command Selection !OVERRIDE!
#--------------------------------------------------------------------------
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
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 # System
@command_window.active = false
@command_system.active = @command_system.visible = true
when 5 # End Game
$scene = Scene_End.new
end
end
end
#--------------------------------------------------------------------------
# * Update System Selection
#--------------------------------------------------------------------------
def update_system_selection
if Input.trigger?(Input::B)
Sound.play_cancel
@command_window.active = true
@command_system.active = @command_system.visible = false
elsif Input.trigger?(Input::C)
if $game_system.save_disabled and @command_system.index == 0
Sound.play_buzzer
return
end
Sound.play_decision
case @command_system.index
when 0 # Save
$scene = Scene_File.new(true, false, false)
when 1 # Load
$scene = Scene_File.new(false, false, false)
when 2 # Exit Game
$scene = nil
end
end
end
#--------------------------------------------------------------------------
# * Termination Processing !ALIAS!
#--------------------------------------------------------------------------
def terminate
ikos_systemmenu_scene_menu_terminate
@command_system.dispose
end
end