Advertisement
TroyZ

TroyZ - Cursor Move Fix VX

Nov 4th, 2014
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.29 KB | None | 0 0
  1. # ==============================================================================
  2. # ▼▼▼▼▼▼                     TroyZ - Cursor Move Fix                      ▼▼▼▼▼▼
  3. # ==============================================================================
  4. # Script by : Agung Prasetyo(TroyZ)
  5. # Contact me by : - Email agung.endisnear.xyz@gmail.com
  6. #                 - Forum RPGMakerID, username TroyZ
  7. #                 - Handphone 085756289121
  8. # Engine : VX
  9. # Level : Easy
  10. # Version : 1.0
  11. # ------------------------------------------------------------------------------
  12. # Change Logs :
  13. # 5 November 2014 : Version 1.0 released
  14. # ------------------------------------------------------------------------------
  15. # How this work :
  16. # All windows that using Window_Selectable as parent class will have cursor move
  17. # problem where at the first and last index the cursor will stuck, forcing you
  18. # to press the arrow button again only to move the cursor to first or last index.
  19. # For example, your menu have 6 index command. When you're at index 0 you can
  20. # hold down arrow to move into index 6, but when you've reached index 6 and you
  21. # want to back to index 0 just by holding the down arrow, you can't. This script
  22. # fix that problem by replacing the trigger button use into the repeat button
  23. # use.
  24. # ------------------------------------------------------------------------------
  25. # How to use :
  26. # Place it between material and main.
  27. # ------------------------------------------------------------------------------
  28. # Compatibility issues :
  29. # None yet. If you found some, let me know, and bug fixes will come out soon.
  30. # ------------------------------------------------------------------------------
  31. # Who to credit :
  32. # - Allah swt. : For the chance of living that he has given to me.
  33. # - Nabi Muhammad saw. : As a leader and messenger and prophet of Muslim.
  34. #                        I'm proud to be your follower. :)
  35. # - Agung Prasetyo(TroyZ) : Thats me, of course, the ones that made this script. :P
  36. # ------------------------------------------------------------------------------
  37. # License :
  38. # - Free Game : Just credit those names above.
  39. # - Commercial Game : Same as free game's license.
  40. # ------------------------------------------------------------------------------
  41. $imported = {} if $imported == nil
  42. $imported["TroyZ_CursorMoveFix"] = true
  43. # ------------------------------------------------------------------------------
  44. # There is nothing to config beyond this line
  45. # ------------------------------------------------------------------------------
  46. class Window_Selectable < Window_Base  
  47.   def update
  48.     super
  49.     if cursor_movable?
  50.       last_index = @index
  51.       if Input.repeat?(Input::DOWN)
  52.         cursor_down(Input.repeat?(Input::DOWN))
  53.       end
  54.       if Input.repeat?(Input::UP)
  55.         cursor_up(Input.repeat?(Input::UP))
  56.       end
  57.       if Input.repeat?(Input::RIGHT)
  58.         cursor_right(Input.repeat?(Input::RIGHT))
  59.       end
  60.       if Input.repeat?(Input::LEFT)
  61.         cursor_left(Input.repeat?(Input::LEFT))
  62.       end
  63.       if Input.repeat?(Input::R)
  64.         cursor_pagedown
  65.       end
  66.       if Input.repeat?(Input::L)
  67.         cursor_pageup
  68.       end
  69.       if @index != last_index
  70.         Sound.play_cursor
  71.       end
  72.     end
  73.     update_cursor
  74.     call_update_help
  75.   end
  76. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement