Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ==============================================================================
- # ▼▼▼▼▼▼ TroyZ - Cursor Move Fix ▼▼▼▼▼▼
- # ==============================================================================
- # Script by : Agung Prasetyo(TroyZ)
- # Contact me by : - Email agung.endisnear.xyz@gmail.com
- # - Forum RPGMakerID, username TroyZ
- # - Handphone 085756289121
- # Engine : VX
- # Level : Easy
- # Version : 1.0
- # ------------------------------------------------------------------------------
- # Change Logs :
- # 5 November 2014 : Version 1.0 released
- # ------------------------------------------------------------------------------
- # How this work :
- # All windows that using Window_Selectable as parent class will have cursor move
- # problem where at the first and last index the cursor will stuck, forcing you
- # to press the arrow button again only to move the cursor to first or last index.
- # For example, your menu have 6 index command. When you're at index 0 you can
- # hold down arrow to move into index 6, but when you've reached index 6 and you
- # want to back to index 0 just by holding the down arrow, you can't. This script
- # fix that problem by replacing the trigger button use into the repeat button
- # use.
- # ------------------------------------------------------------------------------
- # How to use :
- # Place it between material and main.
- # ------------------------------------------------------------------------------
- # Compatibility issues :
- # None yet. If you found some, let me know, and bug fixes will come out soon.
- # ------------------------------------------------------------------------------
- # Who to credit :
- # - Allah swt. : For the chance of living that he has given to me.
- # - Nabi Muhammad saw. : As a leader and messenger and prophet of Muslim.
- # I'm proud to be your follower. :)
- # - Agung Prasetyo(TroyZ) : Thats me, of course, the ones that made this script. :P
- # ------------------------------------------------------------------------------
- # License :
- # - Free Game : Just credit those names above.
- # - Commercial Game : Same as free game's license.
- # ------------------------------------------------------------------------------
- $imported = {} if $imported == nil
- $imported["TroyZ_CursorMoveFix"] = true
- # ------------------------------------------------------------------------------
- # There is nothing to config beyond this line
- # ------------------------------------------------------------------------------
- class Window_Selectable < Window_Base
- def update
- super
- if cursor_movable?
- last_index = @index
- if Input.repeat?(Input::DOWN)
- cursor_down(Input.repeat?(Input::DOWN))
- end
- if Input.repeat?(Input::UP)
- cursor_up(Input.repeat?(Input::UP))
- end
- if Input.repeat?(Input::RIGHT)
- cursor_right(Input.repeat?(Input::RIGHT))
- end
- if Input.repeat?(Input::LEFT)
- cursor_left(Input.repeat?(Input::LEFT))
- end
- if Input.repeat?(Input::R)
- cursor_pagedown
- end
- if Input.repeat?(Input::L)
- cursor_pageup
- end
- if @index != last_index
- Sound.play_cursor
- end
- end
- update_cursor
- call_update_help
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement