Kakakadafi

GamePad Extender

Aug 4th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 25.57 KB | None | 0 0
  1. #==============================================================================
  2. # Gamepad Extender Game Adapter
  3. # by Jono99
  4. #------------------------------------------------------------------------------
  5. # This allows the game commands to be handled in a way more friendly to controller
  6. # input. Based off Gamepad Extender by Lone Wolf and requires Gamepad Extender
  7. # in order to function.
  8. # Link to download Gamepad Extender: http://forums.rpgmakerweb.com/index.php?/topic/1284-gamepad-extender-v11-2202015/
  9. #------------------------------------------------------------------------------
  10. # Changelog
  11. # 1.0.0: Initial release
  12. # 1.0.1: Fixed bug where the save menu would not accept input from the analogue stick and the dpad's input would be duplicated (only occured when MenuInput was set to 2)
  13. # 1.0.2: Removed checks to see if values in GEGAOptions are acceptable values (they caused a problem where the script would not run in StartForPause was set to false)
  14. #==============================================================================
  15. module GEGAOptions
  16.   # Use the Start button instead of the B button to pause the game
  17.   StartForPause = true
  18.  
  19.   # Determine what input device is used for the menus.
  20.   # 0 for just the dpad
  21.   # 1 for just the left analogue stick
  22.   # 2 for both
  23.   MenuInput = 2
  24.  
  25.   # Determine what input device is used for moving around the map.
  26.   # 0 for just the dpad
  27.   # 1 for just the left analogue stick
  28.   # 2 for both
  29.   MoveInput = 2
  30. end
  31.  
  32. #==============================================================================
  33. # DO NOT EDIT UNLESS YOU KNOW WHAT YOU ARE DOING!
  34. #==============================================================================
  35. if defined?(WolfPad) == nil
  36.   msgbox("WARNING: GamePad Extender is either missing or executes sometime after this. To avoid issues, GE Game Adapter will not execute!")
  37. else
  38.   module WolfPad
  39.     def self.dird4(p_i = 0)
  40.       if press?(:UP, p_i)
  41.        8
  42.       elsif press?(:RIGHT, p_i)
  43.        6
  44.       elsif press?(:LEFT, p_i)
  45.        4
  46.       elsif press?(:DOWN, p_i)
  47.        2
  48.       else
  49.        0
  50.       end
  51.     end
  52.     def self.dird8(p_i = 0)
  53.       if press?(:UP, p_i) and press?(:LEFT, p_i)
  54.        7
  55.       elsif press?(:UP, p_i) and press?(:RIGHT, p_i)
  56.        9
  57.       elsif press?(:DOWN, p_i) and press?(:LEFT, p_i)
  58.        1
  59.       elsif press?(:DOWN, p_i) and press?(:RIGHT, p_i)
  60.        3
  61.      else
  62.        dird4(p_i)
  63.       end
  64.     end
  65.   end
  66.    
  67. class Game_Player < Game_Character
  68.   # Update input for bringing up the quick tool menu
  69.   def update_quick_tool_button
  70.       if Input.trigger?(QUICK_TOOL_SELECT::QUICK_TOOL_SELECT_BUTTON)
  71.          return unless can_use_quick_tool_button?        
  72.          SceneManager.call(Scene_Quick_Skill_Tool)
  73.       end
  74.   end
  75.   # Update input for picking up objects
  76.   def update_pickup_command
  77.       if Input.trigger?(PadConfig.confirm)
  78.          throw_event if can_check_throw_event?
  79.          check_event_pickup([0,1,2]) if can_check_pickup_event?
  80.       end
  81.   end
  82.    
  83.   # Update input for backdash
  84.   def update_backdash_button # And front dash!
  85.     backdash_distance = 2 # Also used as frontdash distance
  86.     if @backdash_cooldown # Also used as frontdash cooldown
  87.       @backdash_cooldown -= 1
  88.       return if @backdash_cooldown > 0
  89.     end
  90.     if Input.trigger?(PadConfig.dash)
  91.       if backstep_accessories_equipped?
  92.         @backdash_cooldown = 27
  93.         # YIN
  94.         pose_suffix = Kadafi::DashBackSuffix
  95.         make_pose(pose_suffix, @backdash_cooldown - 12)
  96.         image_only_on_dash(true)
  97.         Audio.se_play('Audio/ME/dash', 80, 150)
  98.         d = 10 - direction
  99.         a = 0
  100.         if @diagonal_direction != 0
  101.           backdash_distance = (backdash_distance * OrangeMovement::Tile_Sections/Math.sqrt(2)).to_i/OrangeMovement::Tile_Sections
  102.         end
  103.         backdash_distance.times do
  104.           OrangeMovement::Tile_Sections.times do
  105.             if @diagonal_direction != 0
  106.               case @diagonal_direction
  107.                 when 1
  108.                   if (diagonal_passable?(@x+a, @y-a, 6, 8) && diagonal_passable?(@x+(a*2), @y-(a*2), 6, 8))
  109.                     a += (my_step_size * 2)
  110.                   elsif diagonal_passable?(@x+a, @y-a, 6, 8)
  111.                     a += my_step_size
  112.                   end
  113.                 when 3
  114.                   if (diagonal_passable?(@x-a, @y-a, 4, 8) && diagonal_passable?(@x-(a*2), @y-(a*2), 4, 8))
  115.                     a += (my_step_size * 2)
  116.                   elsif diagonal_passable?(@x-a, @y-a, 4, 8)
  117.                     a += my_step_size
  118.                   end
  119.                 when 7
  120.                   if (diagonal_passable?(@x+a, @y+a, 6, 2) && diagonal_passable?(@x+(a*2), @y+(a*2), 6, 2))
  121.                     a += (my_step_size * 2)
  122.                   elsif diagonal_passable?(@x+a, @y+a, 6, 2)
  123.                     a += my_step_size
  124.                   end
  125.                 when 9
  126.                   if (diagonal_passable?(@x-a, @y+a, 4, 2) && diagonal_passable?(@x-(a*2), @y+(a*2), 4, 2))
  127.                     a += (my_step_size * 2)
  128.                   elsif diagonal_passable?(@x-a, @y+a, 4, 2)
  129.                     a += my_step_size
  130.                   end
  131.               end
  132.             else
  133.               case @direction
  134.                 when 2; a += my_step_size if passable?(@x, @y-a, d)
  135.                 when 4; a += my_step_size if passable?(@x+a, @y, d)
  136.                 when 6; a += my_step_size if passable?(@x-a, @y, d)
  137.                 when 8; a += my_step_size if passable?(@x, @y+a, d)
  138.               end
  139.             end  
  140.           end
  141.         end
  142.         if @diagonal_direction != 0
  143.           case @diagonal_direction
  144.             when 1
  145.               @x += a
  146.               @y -= a
  147.             when 3
  148.               @x -= a
  149.               @y -= a
  150.             when 7
  151.               @x += a
  152.               @y += a
  153.             when 9      
  154.               @x -= a
  155.               @y += a
  156.           end
  157.         else
  158.           case @direction
  159.             when 2
  160.               @x += 0
  161.               @y -= a
  162.             when 8
  163.               @x += 0
  164.               @y += a
  165.             when 4
  166.               @x += a
  167.               @y += 0
  168.             when 6
  169.               @x -= a
  170.               @y += 0
  171.           end
  172.         end              
  173.         @jump_peak = 3 + a.abs - @move_speed
  174.   #~       p @jump_peak
  175.         @jump_count = @jump_peak * 3.9
  176.         @stop_count = 0
  177.         straighten
  178.        
  179.       # Front Dash
  180.       elsif forwardstep_accessories_equipped?
  181.         @backdash_cooldown = 27
  182.         # YIN
  183.         pose_suffix = Kadafi::DashForwardSuffix
  184.         make_pose(pose_suffix, @backdash_cooldown - 12)
  185.         image_only_on_dash(true)
  186.         Audio.se_play('Audio/ME/dash', 80, 150)
  187.         d = direction
  188.         a = 0
  189.         if @diagonal_direction != 0
  190.           backdash_distance = (backdash_distance * OrangeMovement::Tile_Sections/Math.sqrt(2)).to_i/OrangeMovement::Tile_Sections
  191.         end
  192.         backdash_distance.times do
  193.           OrangeMovement::Tile_Sections.times do
  194.             if @diagonal_direction != 0
  195.               case @diagonal_direction
  196.                 when 1
  197.                   if (diagonal_passable?(@x-a, @y+a, 6, 8) && diagonal_passable?(@x-(a*2), @y+(a*2), 6, 8))
  198.                     a += (my_step_size * 2)
  199.                   elsif diagonal_passable?(@x-a, @y+a, 6, 8)
  200.                     a += my_step_size
  201.                   end
  202.                 when 3
  203.                   if (diagonal_passable?(@x+a, @y+a, 4, 8) && diagonal_passable?(@x+(a*2), @y+(a*2), 4, 8))
  204.                     a += (my_step_size * 2)
  205.                   elsif diagonal_passable?(@x+a, @y+a, 4, 8)
  206.                     a += my_step_size
  207.                   end
  208.                 when 7
  209.                   if (diagonal_passable?(@x-a, @y-a, 6, 2) && diagonal_passable?(@x-(a*2), @y-(a*2), 6, 2))
  210.                     a += (my_step_size * 2)
  211.                   elsif diagonal_passable?(@x-a, @y-a, 6, 2)
  212.                     a += my_step_size
  213.                   end
  214.                 when 9
  215.                   if (diagonal_passable?(@x+a, @y-a, 4, 2) && diagonal_passable?(@x+(a*2), @y-(a*2), 4, 2))
  216.                     a += (my_step_size * 2)
  217.                   elsif diagonal_passable?(@x+a, @y-a, 4, 2)
  218.                     a += my_step_size
  219.                   end
  220.               end
  221.             else
  222.               case @direction
  223.                 when 2; a += my_step_size if passable?(@x, @y+a, d)
  224.                 when 4; a += my_step_size if passable?(@x-a, @y, d)
  225.                 when 6; a += my_step_size if passable?(@x+a, @y, d)
  226.                 when 8; a += my_step_size if passable?(@x, @y-a, d)
  227.               end
  228.             end  
  229.           end
  230.         end
  231.         if @diagonal_direction != 0
  232.           case @diagonal_direction
  233.             when 1
  234.               @x -= a
  235.               @y += a
  236.             when 3
  237.               @x += a
  238.               @y += a
  239.             when 7
  240.               @x -= a
  241.               @y -= a
  242.             when 9      
  243.               @x += a
  244.               @y -= a
  245.           end
  246.         else
  247.           case @direction
  248.             when 2
  249.               @x += 0
  250.               @y += a
  251.             when 8
  252.               @x += 0
  253.               @y -= a
  254.             when 4
  255.               @x -= a
  256.               @y += 0
  257.             when 6
  258.               @x += a
  259.               @y += 0
  260.           end
  261.         end              
  262.         @jump_peak = 3 + a.abs - @move_speed
  263.         @jump_count = @jump_peak * 3.9
  264.         @stop_count = 0
  265.         straighten
  266.       end
  267.     end  
  268.   end
  269.   #--------------------------------------------------------------------------
  270.   # * Processing When Not Moving
  271.   #     last_moving : Was it moving previously?
  272.   #--------------------------------------------------------------------------
  273.   def update_nonmoving(last_moving)
  274.     return if $game_map.interpreter.running?
  275.     if last_moving
  276.       $game_party.on_player_walk
  277.       return if check_touch_event
  278.     end
  279.     if movable? && Input.trigger?(PadConfig.confirm)
  280.       return if get_on_off_vehicle
  281.       return if check_action_event
  282.     end
  283.     update_encounter if last_moving
  284.   end
  285.    
  286.   # YIN XAS and other stuff that requires input
  287.   alias input_dash? dash?
  288.   def dash?
  289.     if rush_accessories_equipped? && Input.press?(PadConfig.dash)
  290.       return true if @rush_delay > Kadafi::RushDelay
  291.       return false if @rush_delay == 0
  292.     end
  293.     return input_dash?
  294.   end
  295.      
  296. #~   def update_charge_button
  297. #~     return unless can_charge_command?
  298. #~     if Input.press?(PadConfig.attack) and ENABLE_ACTION_1_BUTTON
  299. #~         update_charge_effect(0)
  300. #~         reset_charge_temp if Input.press?(PadConfig.attack2) and ENABLE_ACTION_2_BUTTON
  301. #~     elsif Input.press?(PadConfig.attack2)
  302. #~         update_charge_effect(1)
  303. #~         reset_charge_temp if Input.press?(PadConfig.attack)
  304. #~     else
  305. #~         if self.battler.x_charge_action[2] >= self.battler.x_charge_action[1]
  306. #~           self.shoot(self.battler.x_charge_action[0])
  307. #~         end
  308. #~       reset_charge_temp
  309. #~     end
  310. #~   end
  311.  
  312.   def update_change_leader_button
  313.     if Input.trigger?(PadConfig.page_down)
  314.         return unless can_use_change_leader_command?
  315.         change_leader    
  316.     end
  317.   end
  318.  
  319.   def update_action_1_button
  320.     if Input.trigger?(PadConfig.attack)
  321.         type = 0
  322.         return unless can_use_weapon_command?
  323.         return if execute_combo?(type)
  324.         check_equipped_action(type)
  325.         action_id = self.battler.x_action1_id
  326.         return if action_id == 0
  327.         return if state_seal_command?(type)
  328.         self.shoot(action_id)
  329.     end  
  330.   end
  331.  
  332. #~   def update_action_2_button
  333. #~     if Input.trigger?(PadConfig.attack2)
  334. #~         if self.battler.equips[1].is_a?(RPG::Weapon)
  335. #~           type = 1
  336. #~           return unless can_use_weapon_command?
  337. #~           return if execute_combo?(type)
  338. #~           check_equipped_action(type)
  339. #~           action_id = self.battler.x_action2_id
  340. #~           return if action_id == 0
  341. #~           return if state_seal_command?(type)            
  342. #~           self.shoot(action_id)
  343. #~           return
  344. #~         end  
  345. #~     end        
  346. #~     update_shield_button
  347. #~   end
  348.  
  349. #~   def update_shield_button
  350. #~     if Input.press?(PadConfig.attack2)
  351. #~       if can_use_shield_command?
  352. #~         unless self.battler.shield  
  353. #~           shield = self.battler.equips[1]
  354. #~           if shield.note =~ /<Action>/
  355. #~             if shield.note =~ /<Pose = (\w+)>/
  356. #~               make_pose($1.to_s, 2)
  357. #~             end
  358. #~           else  
  359. #~             self.battler.shield = false
  360. #~             return
  361. #~           end
  362. #~         end
  363. #~         self.x_pose_duration = 2
  364. #~         self.battler.shield = true
  365. #~         update_shield_diretion_button
  366. #~       else
  367. #~         self.battler.shield = false
  368. #~       end
  369. #~     else  
  370. #~       self.battler.shield = false
  371. #~     end      
  372. #~   end
  373.  
  374.   def update_skill_button
  375.     if Input.press?(PadConfig.skill)
  376.       type = 2
  377.       return unless can_use_skill_command?
  378.       return if execute_combo?(type)
  379.       check_equipped_action(type)
  380.       action_id = self.battler.skill_id
  381.       return if action_id == 0
  382.       return if state_seal_command?(type)        
  383.       self.shoot(action_id)
  384.     end  
  385.   end
  386.  
  387. #~   def update_item_button
  388. #~     if (Input.press?(PadConfig.skill) && Input.trigger?(PadConfig.attack2))
  389. #~       type = 3        
  390. #~       return unless can_use_item_command?
  391. #~       return if execute_combo?(type)
  392. #~       check_equipped_action(type)
  393. #~       action_id = self.battler.x_item_id
  394. #~       return if action_id == 0
  395. #~       return if state_seal_command?(type)        
  396. #~       self.shoot(action_id)
  397. #~     end  
  398. #~   end
  399.  
  400.   def can_dash?
  401.     return false if @backdash_cooldown
  402.     return false unless XAS_BUTTON::ENABLE_DASH_BUTTON
  403.     return false if self.battler.shield
  404.     return true if Input.press?(PadConfig.dash)
  405.     @dash_active = false
  406.     return false
  407.   end
  408. end
  409.      
  410. class Window_Selectable
  411.   #--------------------------------------------------------------------------
  412.   # * Cursor Movement Processing
  413.   #--------------------------------------------------------------------------
  414.   def process_cursor_move
  415.     return unless cursor_movable?
  416.     last_index = @index
  417.     if WolfPad.plugged_in?
  418.       gega_process_cursor_move_input(:UP, :DOWN, :LEFT, :RIGHT) if GEGAOptions::MenuInput == 0 || GEGAOptions::MenuInput == 2
  419.       gega_process_cursor_move_input(:L_UP, :L_DOWN, :L_LEFT, :L_RIGHT) if GEGAOptions::MenuInput > 0
  420.     else
  421.       gega_process_cursor_move_input(:UP, :DOWN, :LEFT, :RIGHT)
  422.     end
  423.     cursor_pagedown   if !handle?(:pagedown) && Input.trigger?(PadConfig.page_down)
  424.     cursor_pageup     if !handle?(:pageup)   && Input.trigger?(PadConfig.page_up)
  425.     Sound.play_cursor if @index != last_index
  426.   end
  427.   def gega_process_cursor_move_input(up, down, left, right)
  428.     cursor_down (Input.trigger?(down)) if Input.repeat?(down)
  429.     cursor_up   (Input.trigger?(up))    if Input.repeat?(up)
  430.     cursor_right(Input.trigger?(right)) if Input.repeat?(right)
  431.     cursor_left (Input.trigger?(left))  if Input.repeat?(left)
  432.   end
  433.   #--------------------------------------------------------------------------
  434.   # * Handling Processing for OK and Cancel Etc.
  435.   #--------------------------------------------------------------------------
  436.   def process_handling
  437.     return unless open? && active
  438.     return process_ok       if ok_enabled?        && Input.trigger?(PadConfig.confirm)
  439.     return process_cancel   if cancel_enabled?    && Input.trigger?(PadConfig.cancel)
  440.     return process_pagedown if handle?(:pagedown) && Input.trigger?(PadConfig.page_down)
  441.     return process_pageup   if handle?(:pageup)   && Input.trigger?(PadConfig.page_up)
  442.   end
  443. end
  444.  
  445. class Window_ShopNumber
  446.     #--------------------------------------------------------------------------
  447.     # * Update Quantity
  448.     #--------------------------------------------------------------------------
  449.     def update_number
  450.       if WolfPad.plugged_in?
  451.         gega_update_number_input(:RIGHT, :LEFT, :UP, :DOWN) if GEGAOptions::MenuInput == 0 || GEGAOptions::MenuInput == 2
  452.         gega_update_number_input(:L_RIGHT, :L_LEFT, :L_UP, :L_DOWN) if GEGAOptions::MenuInput > 0
  453.       else
  454.         gega_update_number_input(:RIGHT, :LEFT, :UP, :DOWN)
  455.       end
  456.     end
  457.   end
  458.   def gega_update_number_input(right, left, up, down)
  459.     change_number(1)   if Input.repeat?(right)
  460.     change_number(-1)  if Input.repeat?(left)
  461.     change_number(10)  if Input.repeat?(up)
  462.     change_number(-10) if Input.repeat?(down)
  463.   end
  464.   class Window_NameInput
  465.     #--------------------------------------------------------------------------
  466.     # * Handling Processing for OK and Cancel Etc.
  467.     #--------------------------------------------------------------------------
  468.     def process_handling
  469.       return unless open? && active
  470.       process_jump if Input.trigger?(:_shift) && WolfPad.plugged_in? == false
  471.       process_back if Input.repeat?(PadConfig.cancel)
  472.       process_ok   if Input.trigger?(PadConfig.confirm)
  473.     end
  474.   end
  475.   class Window_NumberInput
  476.     #--------------------------------------------------------------------------
  477.     # * Cursor Movement Processing
  478.     #--------------------------------------------------------------------------
  479.     def process_cursor_move
  480.       return unless active
  481.       last_index = @index
  482.       if WolfPad.plugged_in?
  483.         gega_process_cursor_move_input(:LEFT, :RIGHT) if GEGAOptions::MenuInput == 0 || GEGAOptions::MenuInput == 2
  484.         gega_process_cursor_move_input(:L_LEFT, :L_RIGHT) if GEGAOptions::MenuInput > 0
  485.       else
  486.         gega_process_cursor_move_input(:LEFT, :RIGHT)
  487.       end
  488.       Sound.play_cursor if @index != last_index
  489.     end
  490.     def gega_process_cursor_move_input(left, right)
  491.       cursor_right(Input.trigger?(right)) if Input.repeat?(right)
  492.       cursor_left (Input.trigger?(left))  if Input.repeat?(left)
  493.     end
  494.     #--------------------------------------------------------------------------
  495.     # * Change Processing for Digits
  496.     #--------------------------------------------------------------------------
  497.     def process_digit_change
  498.       return unless active
  499.       if WolfPad.plugged_in?
  500.         gega_process_digit_change_input(:UP, :DOWN) if GEGAOptions::MenuInput == 0 || GEGAOptions::MenuInput == 2
  501.         gega_process_digit_change_input(:L_UP, :L_DOWN) if GEGAOptions::MenuInput > 0
  502.       else
  503.         gega_process_digit_change_input(:UP, :DOWN)
  504.       end
  505.     end
  506.     def gega_process_digit_change_input(up, down)
  507.       if Input.repeat?(up) || Input.repeat?(down)
  508.         Sound.play_cursor
  509.         place = 10 ** (@digits_max - 1 - @index)
  510.         n = @number / place % 10
  511.         @number -= n * place
  512.         n = (n + 1) % 10 if Input.repeat?(up)
  513.         n = (n + 9) % 10 if Input.repeat?(down)
  514.         @number += n * place
  515.         refresh
  516.       end
  517.     end
  518.     #--------------------------------------------------------------------------
  519.     # * Handling Processing for OK and Cancel
  520.     #--------------------------------------------------------------------------
  521.     def process_handling
  522.       return unless active
  523.       return process_ok     if Input.trigger?(PadConfig.confirm)
  524.       return process_cancel if Input.trigger?(PadConfig.cancel)
  525.     end
  526.   end
  527.   class Window_Message
  528.     #--------------------------------------------------------------------------
  529.     # * Update Fast Forward Flag
  530.     #--------------------------------------------------------------------------
  531.     def update_show_fast
  532.       @show_fast = true if Input.trigger?(PadConfig.confirm)
  533.     end
  534.     #--------------------------------------------------------------------------
  535.     # * Input Pause Processing
  536.     #--------------------------------------------------------------------------
  537.     def input_pause
  538.       self.pause = true
  539.       wait(10)
  540.       Fiber.yield until Input.trigger?(PadConfig.cancel) || Input.trigger?(PadConfig.confirm)
  541.       Input.update
  542.       self.pause = false
  543.     end
  544.   end
  545.   class Window_ScrollText
  546.     #--------------------------------------------------------------------------
  547.     # * Determine if Fast Forward
  548.     #--------------------------------------------------------------------------
  549.     def show_fast?
  550.       !$game_message.scroll_no_fast && (Input.press?(PadConfig.dash) || Input.press?(PadConfig.confirm))
  551.     end
  552.   end
  553.   class Scene_Map
  554.     #--------------------------------------------------------------------------
  555.     # * Determine if Menu is Called due to Cancel Button
  556.     #--------------------------------------------------------------------------
  557.     def update_call_menu
  558.       if $game_system.menu_disabled || $game_map.interpreter.running?
  559.         @menu_calling = false
  560.       else
  561.         @menu_calling ||= Input.trigger?(PadConfig.cancel)
  562.         call_menu if @menu_calling && !$game_player.moving?
  563.       end
  564.     end
  565.   end
  566.   class Scene_File
  567.     #--------------------------------------------------------------------------
  568.     # * Update Save File Selection
  569.     #--------------------------------------------------------------------------
  570.     def update_savefile_selection
  571.       return on_savefile_ok     if Input.trigger?(PadConfig.confirm)
  572.       return on_savefile_cancel if Input.trigger?(PadConfig.cancel)
  573.       update_cursor
  574.     end
  575.     #--------------------------------------------------------------------------
  576.     # * Update Cursor
  577.     #--------------------------------------------------------------------------
  578.     def update_cursor
  579.       last_index = @index
  580.       if WolfPad.plugged_in?
  581.         gega_update_cursor_input(:UP, :DOWN) if GEGAOptions::MenuInput == 0 || GEGAOptions::MenuInput == 2
  582.         gega_update_cursor_input(:L_UP, :L_DOWN) if GEGAOptions::MenuInput > 0
  583.       else
  584.         gega_update_cursor_input(:UP, :DOWN)
  585.       end
  586.       cursor_pagedown   if Input.trigger?(PadConfig.page_down)
  587.       cursor_pageup     if Input.trigger?(PadConfig.page_up)
  588.       if @index != last_index
  589.         Sound.play_cursor
  590.         @savefile_windows[last_index].selected = false
  591.         @savefile_windows[@index].selected = true
  592.       end
  593.     end
  594.   end
  595.   def gega_update_cursor_input(up, down)
  596.     cursor_down (Input.trigger?(down))  if Input.repeat?(down)
  597.     cursor_up   (Input.trigger?(up))    if Input.repeat?(up)
  598.   end
  599.  
  600.   class Scene_Gameover
  601.     #--------------------------------------------------------------------------
  602.     # * Frame Update
  603.     #--------------------------------------------------------------------------
  604.     def update
  605.       super
  606.       goto_title if Input.trigger?(PadConfig.confirm)
  607.     end
  608.   end
  609.  
  610.   class Scene_Target_Select
  611.     def update_targe_select
  612.       if Input.trigger?(PadConfig.cancel)
  613.          cancel_select
  614.       elsif Input.trigger?(Input::DOWN) or Input.trigger?(Input::RIGHT)  
  615.          @target_index += 1
  616.          select_target(0)
  617.          Sound.play_cursor
  618.       elsif Input.trigger?(Input::UP) or Input.trigger?(Input::LEFT)
  619.          @target_index -= 1
  620.          select_target(1)
  621.          Sound.play_cursor
  622.       elsif Input.trigger?(PadConfig.confirm)
  623.          Sound.play_ok
  624.          SceneManager.call(Scene_Map)
  625.       end
  626.     end
  627.   end
  628. end
  629.  
  630. #~ class Scene_Quick_Skill_Tool
  631. #~   def update_skill_selection
  632. #~       if Input.trigger?(PadConfig.cancel)
  633. #~          Sound.play_cancel
  634. #~          SceneManager.call(Scene_Map)
  635. #~       elsif Input.trigger?(PadConfig.page_down) or Input.trigger?(PadConfig.page_up)
  636. #~          Sound.play_cursor
  637. #~          SceneManager.call(Scene_Quick_Item_Tool)
  638. #~       elsif Input.trigger?(PadConfig.confirm)
  639. #~          @skill = @skill_window.skill
  640. #~          return if @skill == nil
  641. #~          @actor.skill_id = @skill.id
  642. #~          Sound.play_equip    
  643. #~       end
  644. #~   end
  645. #~ end
  646.  
  647. #~ class Scene_Quick_Item_Tool < Scene_Base
  648. #~   def update_item_selection
  649. #~       if Input.trigger?(PadConfig.cancel)
  650. #~          Sound.play_cancel
  651. #~          SceneManager.call(Scene_Map)
  652. #~          return
  653. #~       elsif Input.trigger?(PadConfig.page_down) or Input.trigger?(PadConfig.page_up)
  654. #~          Sound.play_cursor
  655. #~          SceneManager.call(Scene_Quick_Skill_Tool)
  656. #~          return
  657. #~       elsif Input.trigger?(PadConfig.attack2)  
  658. #~             @item = @item_window.item
  659. #~             return if @item == nil
  660. #~             if @item.is_a?(RPG::Weapon)
  661. #~                if @actor.dual_wield?
  662. #~                   @actor.change_equip(1, @item)
  663. #~                else
  664. #~                   @actor.change_equip(0, @item)
  665. #~                end
  666. #~              elsif @item.is_a?(RPG::Armor)
  667. #~                    @actor.change_equip(1, @item)
  668. #~              elsif @item.is_a?(RPG::Item)  
  669. #~                    @actor.item_id = @item.id
  670. #~              end
  671. #~              Sound.play_equip
  672. #~             return
  673. #~       elsif Input.trigger?(PadConfig.confirm)
  674. #~          @item = @item_window.item
  675. #~          return if @item == nil
  676. #~          case @item
  677. #~               when RPG::Item
  678. #~                 @actor.item_id = @item.id
  679. #~               when RPG::Weapon
  680. #~                 @actor.change_equip(0, @item)                
  681. #~               when RPG::Armor
  682. #~                 @actor.change_equip(1, @item)
  683. #~           end        
  684. #~          Sound.play_equip
  685. #~          @item_window.refresh
  686. #~          return
  687. #~       end
  688. #~   end
  689. #~ end
  690.  
  691. class M_logo
  692.   def update_skip_logo
  693.       return if !SKIP_BUTTON
  694.       return if @logo_data[1] > @logos.size
  695.       if Input.press?(PadConfig.confirm) or Input.press?(PadConfig.cancel)
  696.       @logo_data[0] = @logo_data[2] + 10 ; @logo_data[1] = @logos.size + 1
  697.       end
  698.   end
  699. end
Add Comment
Please, Sign In to add comment