# Script Edit by MobiusXVI for Tornado Samurai# Allows for loading from main menu and title screen#==============================================================================# ** Scene_Menu#------------------------------------------------------------------------------# This class performs menu screen processing.#==============================================================================class Scene_Menu #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make command window s1 = $data_system.words.item s2 = "Save" s3 = "Load" s4 = "End Game" @command_window = Window_Command.new(160, [s1, s2, s3, s4]) @command_window.index = @menu_index # If number of party members is 0 if $game_party.actors.size == 0 # Disable items, skills, equipment, and status @command_window.disable_item(0) end # If save is forbidden if $game_system.save_disabled # Disable save @command_window.disable_item(1) end # Make play time window @playtime_window = Window_PlayTime.new @playtime_window.x = 0 @playtime_window.y = 224 # Make steps window @steps_window = Window_Steps.new @steps_window.x = 0 @steps_window.y = 320 # Make gold window @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 416 # Make status window @status_window = Window_MenuStatus.new @status_window.x = 160 @status_window.y = 0 # Execute transition Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of windows @command_window.dispose @playtime_window.dispose @steps_window.dispose @gold_window.dispose @status_window.dispose end #-------------------------------------------------------------------------- # * Frame Update (when command window is active) #-------------------------------------------------------------------------- def update_command # If B button was pressed if Input.trigger?(Input:: # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to map screen $scene = Scene_Map.new return end # If C button was pressed if Input.trigger?(Input::C) # If command other than save or end game, and party members = 0 if $game_party.actors.size == 0 and @command_window.index < 1 # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Branch by command window cursor position case @command_window.index when 0 # item # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to item screen $scene = Scene_Item.new when 1 # save # If saving is forbidden if $game_system.save_disabled # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to save screen $scene = Scene_Save.new when 2 # load game # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to end game screen $scene = Scene_Load.new(false) when 3 # end game # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to end game screen $scene = Scene_End.new end return end endend#==============================================================================# ** Scene_Save#------------------------------------------------------------------------------# This class performs save screen processing.#==============================================================================class Scene_Save < Scene_File #-------------------------------------------------------------------------- # * Decision Processing #-------------------------------------------------------------------------- alias mobius_on_decision on_decision def on_decision(filename) mobius_on_decision(filename) # Switch to menu screen $scene = Scene_Menu.new(1) end #-------------------------------------------------------------------------- # * Cancel Processing #-------------------------------------------------------------------------- alias mobius_on_cancel on_cancel def on_cancel # Switch to menu screen $scene = Scene_Menu.new(1) endend#==============================================================================# ** Scene_Load#------------------------------------------------------------------------------# This class performs load screen processing.#==============================================================================class Scene_Load < Scene_File #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias mobius_initialize initialize def initialize(return_to_title = true) mobius_initialize @return_to_title = return_to_title end #-------------------------------------------------------------------------- # * Cancel Processing #-------------------------------------------------------------------------- def on_cancel # Play cancel SE $game_system.se_play($data_system.cancel_se) if @return_to_title # Switch to title screen $scene = Scene_Title.new else $scene = Scene_Menu.new(2) end endend#==============================================================================# ** Scene_End#------------------------------------------------------------------------------# This class performs game end screen processing.#==============================================================================class Scene_End #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update command window @command_window.update # If B button was pressed if Input.trigger?(Input:: # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to menu screen $scene = Scene_Menu.new(3) return end # If C button was pressed if Input.trigger?(Input::C) # Branch by command window cursor position case @command_window.index when 0 # to title command_to_title when 1 # shutdown command_shutdown when 2 # quit command_cancel end return end end #-------------------------------------------------------------------------- # * Process When Choosing [Cancel] Command #-------------------------------------------------------------------------- def command_cancel # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to menu screen $scene = Scene_Menu.new(3) endend