New account registration is temporarily disabled.

[RMVX ACE] ADDING NUMBERS TO THIS NAME INPUT SCRIPT

Posts

Pages: 1
Hello people and creatures alike!
I'm using a really neat script by Jetpackgone called Minimalist name input.
This is an amazing script but sadly it's missing numbers which I desperately need for my project's name input screen. I'd like
to have numbers added to this script, this can be done by another page
or just making the height greater in general to fit the additional characters.

The Script
Marrend
Guardian of the Description Thread
21806
Try putting...

class Window_NameInput < Window_Selectable
  #--------------------------------------------------------------------------
  # * Character Tables (Latin)
  #--------------------------------------------------------------------------
  LATIN3 = [ 'A','B','C','D','E',
             'F','G','H','I','J',
             'K','L','M','N','O',
             'P','Q','R','S','T',
             'U','V','W','X','Y',
             'Z','', '', '', '' ,
             '0','1','2','3','4',
             '5','6','7','8','9',
             '', '', '', '', 'OK']
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(edit_window)
    super(edit_window.x, edit_window.y+edit_window.height,
          edit_window.width, fitting_height(9))
    @edit_window = edit_window
    @page = 0
    @index = 0
    refresh
    update_cursor
    activate
  end
  #--------------------------------------------------------------------------
  # * Get Text Table
  #--------------------------------------------------------------------------
  def table
    return LATIN3
  end
  #--------------------------------------------------------------------------
  # * Get Text Character
  #--------------------------------------------------------------------------
  def character
    @index < table.size-2 ? table[@index] : ""
  end
  #--------------------------------------------------------------------------
  # * Determine Cursor Location: Confirmation
  #--------------------------------------------------------------------------
  def is_ok?
    @index == table.size - 1
  end
  #--------------------------------------------------------------------------
  # * Move Cursor Down
  #     wrap : Wraparound allowed
  #--------------------------------------------------------------------------
  def cursor_down(wrap)
    if @index < table.size-5 or wrap
      @index = (index + 5) % table.size
    end
  end
  #--------------------------------------------------------------------------
  # * Move Cursor Up
  #     wrap : Wraparound allowed
  #--------------------------------------------------------------------------
  def cursor_up(wrap)
    if @index >= 5 or wrap
      @index = (index + table.size-5) % table.size
    end
  end
    #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    change_color(normal_color)
    table.size.times {|i| draw_text(item_rect(i), table[i], 1) }
  end
end

...this into a separate code-section. The original method's table method was probably set up as a multidimensional array because that's how it functions in the default Window_NameInput functions. However, with only one "page" to process, and a bit of tweaking, we can use the "size" property to help manage various properties of the window.
author=Marrend
Try putting...

class Window_NameInput < Window_Selectable
  #--------------------------------------------------------------------------
  # * Character Tables (Latin)
  #--------------------------------------------------------------------------
  LATIN3 = [ 'A','B','C','D','E',
             'F','G','H','I','J',
             'K','L','M','N','O',
             'P','Q','R','S','T',
             'U','V','W','X','Y',
             'Z','', '', '', '' ,
             '0','1','2','3','4',
             '5','6','7','8','9',
             '', '', '', '', 'OK']
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(edit_window)
    super(edit_window.x, edit_window.y+edit_window.height,
          edit_window.width, fitting_height(9))
    @edit_window = edit_window
    @page = 0
    @index = 0
    refresh
    update_cursor
    activate
  end
  #--------------------------------------------------------------------------
  # * Get Text Table
  #--------------------------------------------------------------------------
  def table
    return LATIN3
  end
  #--------------------------------------------------------------------------
  # * Get Text Character
  #--------------------------------------------------------------------------
  def character
    @index < table.size-2 ? table[@index] : ""
  end
  #--------------------------------------------------------------------------
  # * Determine Cursor Location: Confirmation
  #--------------------------------------------------------------------------
  def is_ok?
    @index == table.size - 1
  end
  #--------------------------------------------------------------------------
  # * Move Cursor Down
  #     wrap : Wraparound allowed
  #--------------------------------------------------------------------------
  def cursor_down(wrap)
    if @index < table.size-5 or wrap
      @index = (index + 5) % table.size
    end
  end
  #--------------------------------------------------------------------------
  # * Move Cursor Up
  #     wrap : Wraparound allowed
  #--------------------------------------------------------------------------
  def cursor_up(wrap)
    if @index >= 5 or wrap
      @index = (index + table.size-5) % table.size
    end
  end
    #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    change_color(normal_color)
    table.size.times {|i| draw_text(item_rect(i), table[i], 1) }
  end
end


...this into a separate code-section. The original method's table method was probably set up as a multidimensional array because that's how it functions in the default Window_NameInput functions. However, with only one "page" to process, and a bit of tweaking, we can use the "size" property to help manage various properties of the window.
Thanks for saving the day again Marrend, this is exactly what I was aiming for!
Pages: 1