Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ** Scene_Mouse
- #------------------------------------------------------------------------------
- # This class performs mouse configuration processing.
- #==============================================================================
- class Scene_Mouse < Scene_Base
- #--------------------------------------------------------------------------
- # * Start processing
- #--------------------------------------------------------------------------
- def start
- super
- create_menu_background
- create_command_window
- @help_window = Window_Help.new()
- end
- #--------------------------------------------------------------------------
- # * Post-Start Processing
- #--------------------------------------------------------------------------
- def post_start
- super
- open_command_window
- end
- #--------------------------------------------------------------------------
- # * Pre-termination Processing
- #--------------------------------------------------------------------------
- def pre_terminate
- super
- close_command_window
- end
- #--------------------------------------------------------------------------
- # * Termination Processing
- #--------------------------------------------------------------------------
- def terminate
- super
- dispose_command_window()
- @help_window.dispose() unless @help_window.nil?()
- dispose_menu_background()
- end
- #--------------------------------------------------------------------------
- # * Return to Original Screen
- #--------------------------------------------------------------------------
- def return_scene
- $scene = Scene_Menu.new(5)
- end
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update
- super
- update_menu_background
- @command_window.update
- case @command_window.commands[ @command_window.index ]
- when "On" ; @help_window.set_text( "Turn Mouse ON" )
- when "Off" ; @help_window.set_text( "Turn Mouse OFF" )
- when Vocab::cancel ; @help_window.set_text( "Cancel" )
- end
- if Input.trigger?(Input::B)
- Sound.play_cancel
- return_scene
- elsif Input.trigger?(Input::C) && $game_switches[474]
- case @command_window.index
- when 0 # mouse on
- command_mouse_on
- when 1 # cancel
- command_cancel
- end
- elsif Input.trigger?(Input::C) && !$game_switches[474]
- case @command_window.index
- when 0 #mouse off
- command_mouse_off
- when 1 #cancel
- command_cancel
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Update Background for Menu Screen
- #--------------------------------------------------------------------------
- def update_menu_background
- super
- @menuback_sprite.tone.set(0, 0, 0, 128)
- end
- #--------------------------------------------------------------------------
- # * Create Command Window
- #--------------------------------------------------------------------------
- def create_command_window
- if $game_switches[474]
- s1 = "On"
- s2 = Vocab::cancel
- else
- s1 = "Off"
- s2 = Vocab::cancel
- end
- @command_window = Window_Command.new(172, [s1, s2])
- @command_window.x = (544 - @command_window.width) / 2
- @command_window.y = (416 - @command_window.height) / 2
- @command_window.openness = 0
- end
- #--------------------------------------------------------------------------
- # * Dispose of Command Window
- #--------------------------------------------------------------------------
- def dispose_command_window
- @command_window.dispose
- end
- #--------------------------------------------------------------------------
- # * Open Command Window
- #--------------------------------------------------------------------------
- def open_command_window
- @command_window.open
- begin
- @command_window.update
- Graphics.update
- end until @command_window.openness == 255
- end
- #--------------------------------------------------------------------------
- # * Close Command Window
- #--------------------------------------------------------------------------
- def close_command_window
- @command_window.close
- begin
- @command_window.update
- Graphics.update
- end until @command_window.openness == 0
- end
- #--------------------------------------------------------------------------
- # * Process When Choosing [On] Command
- #--------------------------------------------------------------------------
- def command_mouse_on
- Sound.play_decision
- $game_switches[474] = false
- $cursor.opacity = 255
- $cursor.update
- return_scene
- end
- #--------------------------------------------------------------------------
- # * Process When Choosing [Off] Command
- #--------------------------------------------------------------------------
- def command_mouse_off
- Sound.play_decision
- $game_switches[474] = true
- $cursor.opacity = 0
- $cursor.update
- return_scene
- end
- #--------------------------------------------------------------------------
- # * Process When Choosing [Cancel] Command
- #--------------------------------------------------------------------------
- def command_cancel
- Sound.play_decision
- return_scene
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment