#==============================================================================
# ** Improved Window_NameInput v1.0
# Created by rendy1287 a.k.a Keiyh Aruya
# 20 January 2009
# Featured:
# - New characters
# - Modified three button to delete character, go to next, go to back
# Next feature:
# - Add japanese characters (if your font support it)
#------------------------------------------------------------------------------
# This window is used to select text characters on the name input screen.
#==============================================================================
module Keiyh_Imprvd_SceneName
DEL = 'Del'
BACK = '<--'
NEXT = '-->'
OK = 'OK'
EDIT_WINDOW = 'Window' # this is the windowskin of edit window
INPUT_WINDOW = 'Window' # this is the windowskin of input window
end
class Window_NameInput < Window_Base
#--------------------------------------------------------------------------
# * Text Character Table
#--------------------------------------------------------------------------
ENGLISH = [ 'A','B','C','D','E', 'a','b','c','d','e',
'F','G','H','I','J', 'f','g','h','i','j',
'K','L','M','N','O', 'k','l','m','n','o',
'P','Q','R','S','T', 'p','q','r','s','t',
'U','V','W','X','Y', 'u','v','w','x','y',
'Z',' ',' ',' ',' ', 'z',' ',' ',' ',' ',
' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',
'1','2','3','4','5', ' ',' ',' ',' ',' ',
'6','7','8','9','0', ' ',
Keiyh_Imprvd_SceneName::DEL,Keiyh_Imprvd_SceneName::BACK,
Keiyh_Imprvd_SceneName::NEXT,Keiyh_Imprvd_SceneName::OK]
# sorry if i put these characters randomly, not alphabetically
GREEK = [ '?','?','?','?','?', '?','?','?','?','?',
'?','?','?','?','?', '?','?','?','?','?',
'?','?','?','?','?', '?','?','?','?','?',
'?','?','?','?','?', '?','?','?','?','?',
'?','?','?','?',' ', '?','?','?','?','?',
'?','?','?','?','?', '?','?','?','?','?',
'?','?','?','?','?', '?','?','?','?','?',
'?','?','?','?','?', '?','?','?','?',' ',
'?','?','?','?','?', ' ',
Keiyh_Imprvd_SceneName::DEL,Keiyh_Imprvd_SceneName::BACK,
Keiyh_Imprvd_SceneName::NEXT,Keiyh_Imprvd_SceneName::OK]
CYRILLIC= [ '?','?','?','?','?', '?','?','?','?','?',
'?','?','?','?','?', '?','?','?','?','?',
'?','?','?','?','?', '?','?','?','?','?',
'?','?','?','?','?', '?','?','?',' ',' ',
'?','?','?','?','?', '?','?','?',' ',' ',
' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',
' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',
' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',
' ',' ',' ',' ',' ', ' ',
Keiyh_Imprvd_SceneName::DEL,Keiyh_Imprvd_SceneName::BACK,
Keiyh_Imprvd_SceneName::NEXT,Keiyh_Imprvd_SceneName::OK]
SYMBOL = [ '!','"','#','$','%', '&',"'",'(',')','*',
'+',',','-','.','/', ':',';','<','=','>',
'?','@','[','\\',']', '^','_','`','{','}',
'|','~','¡','¢','£', '¤','¥','¦','§','©',
'ª','«','»','®','°', '±','¹','²','³','?',
'µ','¶','º','½','¼', '?','¾','?','?','?',
'¿','×','÷','?','–', '—','‘','’','‚','“',
' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',
' ',' ',' ',' ',' ', ' ',
Keiyh_Imprvd_SceneName::DEL,Keiyh_Imprvd_SceneName::BACK,
Keiyh_Imprvd_SceneName::NEXT,Keiyh_Imprvd_SceneName::OK]
SYMBOL2 = [ '”','„','†','‡','•', '…','‰','‹','›','?',
'€','?','?','?','™', '?','?','?','?','?',
'?','?','?','?','?', '?','?','?','?','?',
'?','?','?','?','?', '?','?',' ',' ',' ',
' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',
' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',
' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',
' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',
' ',' ',' ',' ',' ', ' ',
Keiyh_Imprvd_SceneName::DEL,Keiyh_Imprvd_SceneName::BACK,
Keiyh_Imprvd_SceneName::NEXT,Keiyh_Imprvd_SceneName::OK]
TABLE = [ENGLISH, GREEK, CYRILLIC, SYMBOL, SYMBOL2]
#--------------------------------------------------------------------------
# * Text Character Acquisition
#--------------------------------------------------------------------------
def character
if @index < 86
return TABLE[@mode][@index]
else
return ""
end
end
#--------------------------------------------------------------------------
# * Determine Cursor Position: Delete
#--------------------------------------------------------------------------
def is_delete
return (@index == 86)
end
#--------------------------------------------------------------------------
# * Determine Cursor Position: Mode Switch (BACK)
#--------------------------------------------------------------------------
def is_mode_back #pagedown
return (@index == 87)
end
#--------------------------------------------------------------------------
# * Determine Cursor Position: Mode Switch (NEXT)
#--------------------------------------------------------------------------
def is_mode_next #pageup
return (@index == 88)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias rendy1287_improved_scenename_update update
def update
rendy1287_improved_scenename_update
if Input.trigger?(Input::C) and is_mode_back
cursor_pageup
end
end
end
#==============================================================================
# ** Scene_Name
#------------------------------------------------------------------------------
# This class performs name input screen processing.
#==============================================================================
class Scene_Name < Scene_Base
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
alias rendy1287_improved_scenename_start start
def start
rendy1287_improved_scenename_start
@edit_window.windowskin = Cache.system(Keiyh_Imprvd_SceneName::EDIT_WINDOW)
@input_window.windowskin = Cache.system(Keiyh_Imprvd_SceneName::INPUT_WINDOW)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias rendy1287_improved_scenename_update update
def update
rendy1287_improved_scenename_update
if Input.trigger?(Input::C)
if @input_window.is_delete
if @edit_window.index > 0
Sound.play_cancel
@edit_window.back
end
end
end
end
end