Advertisement
SSTrihan

HorrorVale name input edit

Feb 8th, 2023
1,137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.36 KB | Source Code | 0 0
  1. class Window_NameInput < Window_Selectable
  2.   #--------------------------------------------------------------------------
  3.   # * Character Tables (Latin)
  4.   #--------------------------------------------------------------------------
  5.   LATIN1 = [ 'A','B','C','D','E',  'a','b','c','d','e',
  6.              'F','G','H','I','J',  'f','g','h','i','j',
  7.              'K','L','M','N','O',  'k','l','m','n','o',
  8.              'P','Q','R','S','T',  'p','q','r','s','t',
  9.              'U','V','W','X','Y',  'u','v','w','x','y',
  10.              'Z',' ',' ',' ',' ',  'z',' ',' ',' ',' ',
  11.              ' ',' ',' ',' ',' ',  ' ',' ',' ',' ','OK']
  12.              
  13.   def initialize(edit_window)
  14.     super(edit_window.x, edit_window.y + edit_window.height + 8,
  15.           edit_window.width, fitting_height(7))
  16.     @edit_window = edit_window
  17.     @page = 0
  18.     @index = 0
  19.     refresh
  20.     update_cursor
  21.     activate
  22.   end
  23.  
  24.   def character
  25.     @index < 68 ? table[@page][@index] : ""
  26.   end
  27.  
  28.   def is_page_change?
  29.     false
  30.   end
  31.  
  32.   def is_ok?
  33.     @index == 69
  34.   end
  35.  
  36.   def cursor_down(wrap)
  37.     if @index < 60 or wrap
  38.       @index = (index + 10) % 70
  39.     end
  40.   end
  41.  
  42.   def cursor_up(wrap)
  43.     if @index >= 10 or wrap
  44.       @index = (index + 60) % 70
  45.     end
  46.   end
  47.  
  48.   def process_jump
  49.     if @index != 69
  50.       @index = 69
  51.       Sound.play_cursor
  52.     end
  53.   end
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement