Advertisement
TroyZ

TroyZ - Cursor Move Fix

Nov 4th, 2014
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.11 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 : VXAce
  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 process_cursor_move
  48.     return unless cursor_movable?
  49.     last_index = @index
  50.     cursor_down (Input.repeat?(:DOWN))  if Input.repeat?(:DOWN)
  51.     cursor_up   (Input.repeat?(:UP))    if Input.repeat?(:UP)
  52.     cursor_right(Input.repeat?(:RIGHT)) if Input.repeat?(:RIGHT)
  53.     cursor_left (Input.repeat?(:LEFT))  if Input.repeat?(:LEFT)
  54.     cursor_pagedown   if !handle?(:pagedown) && Input.repeat?(:R)
  55.     cursor_pageup     if !handle?(:pageup)   && Input.repeat?(:L)
  56.     Sound.play_cursor if @index != last_index
  57.   end
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement