#==============================================================================
# ** 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 = 0) IS USED FOR
# @command_window.index
@menu_index = menu_index # CHANGES TO BE USED AS @menu_index
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start # REPLACES "main" IN VX
super # NEEDED FOR "start" TO WORK
# PROPERLY
create_menu_background # BLURS/DARKENS THE BACKGROUND
create_command_window # CREATES COMMAND WINDOW
@gold_window = Window_Gold.new(0, 360) # DISPLAYS GOLD WINDOW
@status_window = Window_MenuStatus.new(160, 0) # DISPLAYS STATUS WINDOW FOR
# ACTORS
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate # DISPOSE OF MENU'S WINDOW'S AND BACKGROUND
super # NEEDED FOR "terminate" TO WORK PROPERLY
dispose_menu_background # DISPOSE OF MENU BACKGORUND IMAGE
@command_window.dispose # DISPOSE OF COMMAND(SELECTION) WINDOW/MENU
@gold_window.dispose # DISPOSE OF GOLD WINDOW
@status_window.dispose # DISPOSE OF STATUS(ACTOR STATS) WINDOW/MENU
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update # UPDATES ALL WINDOWS
super # NEEDED FOR "update" TO WORK PROPERLY
update_menu_background # UPDATES THE BACKGROUND IMAGE
@command_window.update # UPDATES THE COMMAND WINDOW(UP/DOWN, C/B)
@gold_window.update # UPDATES GOLD WINDOW(IF A SCRIPT GIVES YOU
# GOLD)
@status_window.update # UPDATES STATUS WINDOW(IF YOU USE SKILL OR
# STATUS)
if @command_window.active # IF THE COMMAND WINDOW IS BEING USED
update_command_selection # UPDATE THE SELECTIONS(UP/DOWN)
elsif @status_window.active # UPDATE THE STATUS WINDOW (ACTOR SELECTION) *
update_actor_selection # UPDATE *
end
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window # CREATES COMMAND WINDOW(SELECTING)
s1 = "Item" # SHOWS ITEM SELECTION
s2 = "Skill" # SHOWS SKILL SELECTION
s3 = "Equip" # SHOWS EQUIP SELECTION
s4 = "Status" # SHOWS STATUS SELECTION
s5 = "Save" # SHOWS SAVE SELECTION
s6 = "End" # SHOWS END SELECTION
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
@command_window.index = @menu_index # DIRECTS @command_window.index TO USE
# @menu_index
check_party_size # CHECKS PARTY SIZE
check_save_disabled # CHECKS IF SAVE IS DISABLED
end
#--------------------------------------------------------------------------
# * Update Command Selection
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B) # WHEN YOU PRESS ESCAPE
Sound.play_cancel # THIS PLAYS CANCEL SE (Returns to map)
$scene = Scene_Map.new # RETURNS TO MAP
elsif Input.trigger?(Input::C) # WHEN YOU PRESS SPACE
verify_party_size # VERIFYS PARTY SIZE
verify_save_disabled # VERIFYS IF SAVE IS DISABLED
Sound.play_decision # THIS PLAYS DECISION AND MOVES TO NEX MENU
case @command_window.index # DIRECTS TO MENU'S INDEX
when 0 # Item # WHEN s1
$scene = Scene_Item.new # GO TO ITEMS
when 1,2,3 # Skill, etc # WHEN s2-s4
start_actor_selection # MOVE TO ACTOR SELECTION
when 4 # Save # WHEN s5 OPEN SAVE MENU
$scene = Scene_File.new(true, false, false) # SET SAVE TO TRUE AND LOAD
# TO FALSE, OPENS SAVE MENU
when 5 # End Game # WHEN s6
$scene = Scene_End.new # OPENS END GAME MENU
end
end
end
#-----------------------------------------------------------------------------
# * CHECKS THE PARTY'S SIZE
#-----------------------------------------------------------------------------
def check_party_size # **
if $game_party.members.size == 0 # WHEN NO PARTY MEMBERS
@command_window.draw_item(0, false) # DISABLES ITEM SELECTION
@command_window.draw_item(1, false) # DISABLES SKILL SELECTION
@command_window.draw_item(2, false) # DISABLES SKILL SELECTION
@command_window.draw_item(3, false) # DISABLES STATUS SELECTION
end
end
#-----------------------------------------------------------------------------
# * CHECKS IF SAVE IS DISABLED
#-----------------------------------------------------------------------------
def check_save_disabled # ***
if $game_system.save_disabled # IF SAVE IS DISABLED
@command_window.draw_item(4, false) # BLOCK SAVING
end
end
#-----------------------------------------------------------------------------
# * VERIFYS THE PARTY'S SIZE
#-----------------------------------------------------------------------------
def verify_party_size
if $game_party.members.size == 0 and @command_window.index < 4 # IF **
Sound.play_buzzer # PLAYS BUZZER SE
return # RETURN ??
end
end
#-----------------------------------------------------------------------------
# * VERIFYS IF SAVE IS DISABLED
#-----------------------------------------------------------------------------
def verify_save_disabled
if $game_system.save_disabled and @command_window.index == 4 # IF ***
Sound.play_buzzer # PLAYS BUZZER SE
return # RETURN ??
end
end
#--------------------------------------------------------------------------
# * Start Actor Selection
#--------------------------------------------------------------------------
def start_actor_selection # SWITCHED COMMAND MENU TO ACTOR MENU
@command_window.active = false # CHANGES COMMAND(SELECTION) MENU TO FALSE
@status_window.active = true # CHANGES STATUS(ACTOR) MENU TO TRUE
if $game_party.last_actor_index < @status_window.item_max # DISPLAYS ACTORS
@status_window.index = $game_party.last_actor_index # MOVES TO LAST ACTOR
else # IF NO PREVIOUS SELECTION
@status_window.index = 0 # MAKE ACTOR SELECTION ACTOR 1
end
end
#--------------------------------------------------------------------------
# * End Actor Selection
#--------------------------------------------------------------------------
def end_actor_selection # SWITCHES ACTOR MENU TO COMMAND MENU
@command_window.active = true # CHANGES COMMAND(SELECTION) MENU TO TRUE
@status_window.active = false # CHANGES STATUS(ACTOR) MENU TO FALSE
@status_window.index = -1 # STOPS STATUS MENU
end
#--------------------------------------------------------------------------
# * Update Actor Selection
#--------------------------------------------------------------------------
def update_actor_selection # ACTOR SELECTION UPDATE
if Input.trigger?(Input::B) # IF ESCAPE IS PRESSED
Sound.play_cancel # PLAY CANCEL SE
end_actor_selection # RETURN TO COMMMAND(SELECTION) WINDOW
elsif Input.trigger?(Input::C) # IF SPACE IS PRESSED
$game_party.last_actor_index = @status_window.index # MOVE TO STATUS WINDOW
Sound.play_decision # PLAY DECISION SE
case @command_window.index
when 1 # skill
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
$scene = Scene_Equip.new(@status_window.index)
when 3 # status
$scene = Scene_Status.new(@status_window.index)
end
end
end
end