#============================================================================== # ¦ Scene_Option #------------------------------------------------------------------------------ # Fais par Grégory08. #============================================================================== class Scene_Option #-------------------------------------------------------------------------- # ? option_index : #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # ? Les choix #-------------------------------------------------------------------------- def main s1 = "Sauvegarder" s2 = "Charger" s3 = "Quitter" @command_window = Window_Command.new(160, [s1, s2, s3]) @command_window.x = 640 - @command_window.width @command_window.y = 0 @command_window.z = 110 @command_window.index = @menu_index # ??????? 0 ???? if $game_party.actors.size == 0 # ????????????????????? @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end # ???????? if $game_system.save_disabled # ????????? @command_window.disable_item(4) end @status_window = Window_MenuStatus.new @status_window.x = 0 @status_window.y = 8 @status_window.z = 100 # ????????? Graphics.transition # ?????? loop do # ???????? Graphics.update # ??????? Input.update # ?????? update # ???????????????? if $scene != self break end end # ????????? Graphics.freeze # ???????? @command_window.dispose @status_window.dispose end #-------------------------------------------------------------------------- # ? ?????? #-------------------------------------------------------------------------- def update # ???????? @command_window.update @status_window.update if @command_window.active update_command return end # ???????????????????: update_status ??? if @status_window.active update_status return end end def update_command # B ?????????? if Input.trigger?(Input::B) # ????? SE ??? $game_system.se_play($data_system.cancel_se) # ?????????? $scene = Scene_Menu.new(7) return end # C ?????????? if Input.trigger?(Input::C) # ??????? 0 ?????????????????????? if $game_party.actors.size == 0 and @command_window.index < 4 # ??? SE ??? $game_system.se_play($data_system.buzzer_se) return end # ??????????????????? case @command_window.index when 0 # ???????? if $game_system.save_disabled # ??? SE ??? $game_system.se_play($data_system.buzzer_se) return end # ?? SE ??? $game_system.se_play($data_system.decision_se) # ?????????? $scene = Scene_Save.new when 1 # ?? SE ??? $game_system.se_play($data_system.decision_se) # ?????????? command_continue when 2 # ??? # ?? SE ??? $game_system.se_play($data_system.decision_se) # ???????????? $scene = Scene_End.new end return end end #-------------------------------------------------------------------------- # definition de la méthode "command_continue" : permet de charger une partie #-------------------------------------------------------------------------- def command_continue @continue_enabled = false for i in 0..3 if FileTest.exist?("Sauvegarde#{i+1}.rxdata") @continue_enabled = true end end # ????????????? unless @continue_enabled # ??? SE ??? $game_system.se_play($data_system.buzzer_se) return end # ?? SE ??? $game_system.se_play($data_system.decision_se) # ?????????? $scene = Scene_LoadFromMenu.new end #-------------------------------------------------------------------------- # ? ?????? (???????????????????) #-------------------------------------------------------------------------- def update_status # B ?????????? if Input.trigger?(Input::B) # ????? SE ??? $game_system.se_play($data_system.cancel_se) # ?????????????????? @command_window.active = true @status_window.active = false @status_window.index = -1 return end # C ?????????? if Input.trigger?(Input::C) # ??????????????????? case @command_window.index when 2 # ??? # ???????????? 2 ????? if $game_party.actors[@status_window.index].restriction >= 2 # ??? SE ??? $game_system.se_play($data_system.buzzer_se) end return end end end end