]
HIRAGANA_TABLE =
[
"이","특","희","철","한",
"경","예","성","강","인",
"신","동","성","민","은",
"혁","동","해","시","원",
"려","욱","기","범","규",
"현","곡","구","へ","장",
"왕","이","조","손","전",
"송","우","묘","량","김",
"정","하","문","렴","봉",
"안","양","진","동","림",
"애","진","백","허","서",
"소","사","범","정","왕",
"대","고","등","니","축",
"로","부","범","구","엽",
"당","우","반","조","증",
"왕","만","소","은","몽",
"제","기","언","담","로",
"녕","요","교","상","호" ,
"륙","려","신","초","류",
"배","려","주","장","초",
"문","로","채","이","온",
"시","방","거","사","만",
"엄","방","등","신","위",
"단","관","총","","",
"","","","","",
"","","","","",
"","","","","",
"","","","","",
]
KATAKANA_TABLE =
[
"赵","钱","孙","李","百",
"周","吴","郑","王","家",
"南","方","爵","龙","天",
"夏","大","家","看","着",
"吧","安","也","想","不",
"出","啥","嘿","懒","么",
"朱","蓝","亲","正","宫",
"利","特" ,"强", "仁" ,"奎",
"贤","晟","敏","艺","声",
"丽","旭" ,"东", "海" ,"恩",
"赫","神","童","始","源",
"基","范","希","澈","韩",
"庚","花","瓣","妖","精",
"请","不","要","取","十",
"三","只","的","名","·",
"因","为","他","们","可",
"能","会","在","游","戏",
"中","出","现", "防" , "止" ,
"撞","车","请","配","合",
"哦","惜","我","手","酸",
"类","再","来","点","咋",
"还","没","满","@","_",
"雷","泪","蕾","涙","儡",
"幽","眸","月","饼","僵",
"莉","萨","柩","紫","楽",
"甲","佑","侠","冕","莱",
"殿","腐","灏","女","狼",
"","","","","",
]
# ----------------------------------
def initialize
super(160, 128, 480, 352)
self.contents = Bitmap.new(width - 32, height - 32)
self.active = false
@index = -1
@mode = 1
refresh
update_cursor_rect
end
# ----------------------------------
def index=(value)
@index = value
update_cursor_rect
end
#--------------------------------------
def character
if @mode == 1
return ENGLISH_TABLE[@index]
elsif @mode == 2
return HIRAGANA_TABLE[@index]
else
return KATAKANA_TABLE[@index]
end
end
# ----------------------------------
def refresh
self.contents.clear
for i in 0..134
x = 4 + i / 5 / 9 * 152 + i % 5 * 28
y = i / 5 % 9 * 32
if @mode == 1
self.contents.font.name = "黑体"
self.contents.font.size = 24
self.contents.draw_text(x, y, 28, 32, ENGLISH_TABLE, 1)
elsif @mode == 2
self.contents.font.name = "黑体"
self.contents.font.size = 22
self.contents.draw_text(x, y, 28, 32, HIRAGANA_TABLE, 1)
else
self.contents.font.name = "黑体"
self.contents.font.size = 22
self.contents.draw_text(x, y, 28, 32, KATAKANA_TABLE, 1)
end
end
end
# ----------------------------------
def update_cursor_rect
if self.active == false
self.cursor_rect.empty
else
x = 4 + @index / 5 / 9 * 152 + @index % 5 * 28
y = @index / 5 % 9 * 32
self.cursor_rect.set(x, y, 28, 32)
end
end
# ----------------------------------
def update
super
if @index >= 0 && @index <= 134
if Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
if @index % 5 == 4
if @index < 94
@index += 41
end
else
@index += 1
end
end
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
if @index % 5 == 0
if @index < 45
self.active = false
@index = -999
return
else
@index -= 41
end
else
@index -= 1
end
end
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
if @index % 45 < 40
@index += 5
end
end
if Input.repeat?(Input::UP)
if Input.trigger?(Input::UP) or @index % 45 >= 5
$game_system.se_play($data_system.cursor_se)
if @index % 45 >= 5
@index -= 5
end
end
end
end
update_cursor_rect
end
end
class Window_NameCommand < Window_Command
# -------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
if i == 1 or i == 2
font = 1
self.contents.font.name = "黑体"
self.contents.font.size = 22
else
font = 0
self.contents.font.name = "黑体"
self.contents.font.size = 24
end
draw_item(i, normal_color, font)
end
end
# -------------------------------
def draw_item(index, color, f)
if f == 0
self.contents.font.color = color
self.contents.font.name = "黑体"
self.contents.font.size = 24
else
self.contents.font.name = "黑体"
self.contents.font.size = 22
end
rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index])
end
end