###################################################################### ######### ######### ###### New_Name_Edit V1.0 By Adurna ###### ### ### ###### realise: 21.02.1 ###### ######### ######### ######################################################################
class Window_NameInput < Window_Base ADURNA = [ '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', 'è','é','à','ù','ç', '&',' ',' ',' ','OK'] TABLE = [ADURNA]
def initialize(mode = 0) super(0, 148, 540, 248) @mode = mode @index = 0 refresh update_cursor end
def character if @index < 133 return TABLE[@mode][@index] else return "" end end
def is_mode_change return (@index == 133) end
def is_decision return (@index == 134) end
def item_rect(index) rect = Rect.new(0, 0, 0, 0) rect.x = index % 15 * 32 + index % 15 / 5 * 16 rect.y = index / 15 * WLH rect.width = 32 rect.height = WLH return rect end
def refresh self.contents.clear for i in 0..134 rect = item_rect(i) rect.x += 2 rect.width -= 4 self.contents.draw_text(rect, TABLE[@mode][i], 1) end end
def update_cursor self.cursor_rect = item_rect(@index) end
def cursor_down(wrap) if @index <120 @index += 15 elsif wrap @index -= 120 end end
def cursor_up(wrap) if @index >= 15 @index -= 15 elsif wrap @index += 120 end end
def cursor_right(wrap) if @index % 15 < 14 @index += 1 elsif wrap @index -= 14 end end
def cursor_left(wrap) if @index % 15 > 0 @index -= 1 elsif wrap @index += 14 end end
def cursor_to_decision @index = 134 end end
class Window_NameEdit < Window_Base
def initialize(actor, max_char) super(48, 20, 448, 128) @actor = actor @name = actor.name @max_char = max_char name_array = @name.split(//)[0...@max_char] @name = "" for i in 0...name_array.size @name += name_array[i] end @default_name = @name @index = name_array.size self.active = false refresh update_cursor end end |