想把输入界面的可用字符简化一下,于是成了这个样子。直接删掉了一排,并且修改了字符 但是出现了一些问题> <: 1.选择“确定”后,会将这两个字当作是输入的内容 2.在最下面一排按下方向下键光标会消失,且每按 ...
class Window_NameInput ITEM_MAX = 80 # 项目数 自己根据表里的项目数量修改 # 以下部分请不要修改 OK_INDEX = ITEM_MAX - 1 CHANGE_INDEX = ITEM_MAX - 2 #-------------------------------------------------------------------------- # ● 获取文字 #-------------------------------------------------------------------------- def character @index < CHANGE_INDEX ? table[@page][@index] : "" end #-------------------------------------------------------------------------- # ● 判定光标位置是否在“切换”上(平假/片假) #-------------------------------------------------------------------------- def is_page_change? @index == CHANGE_INDEX end #-------------------------------------------------------------------------- # ● 判定光标位置是否在“确定”上 #-------------------------------------------------------------------------- def is_ok? @index == OK_INDEX end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh contents.clear change_color(normal_color) ITEM_MAX.times {|i| draw_text(item_rect(i), table[@page][i], 1) } end #-------------------------------------------------------------------------- # ● 光标向下移动 # wrap : 允许循环 #-------------------------------------------------------------------------- def cursor_down(wrap) if @index < ITEM_MAX - 10 or wrap @index = (index + 10) % ITEM_MAX end end #-------------------------------------------------------------------------- # ● 光标向上移动 # wrap : 允许循环 #-------------------------------------------------------------------------- def cursor_up(wrap) if @index >= 10 or wrap @index = (index + ITEM_MAX - 10) % ITEM_MAX end end #-------------------------------------------------------------------------- # ● 光标向右移动 # wrap : 允许循环 #-------------------------------------------------------------------------- def cursor_right(wrap) if @index % 10 < ITEM_MAX / 10 @index += 1 elsif wrap @index -= 9 end end #-------------------------------------------------------------------------- # ● 跳转“确定” #-------------------------------------------------------------------------- def process_jump if @index != OK_INDEX @index = OK_INDEX Sound.play_cursor end endend
class Window_NameInput ITEM_MAX = 80 # 项目数 自己根据表里的项目数量修改 # 以下部分请不要修改 OK_INDEX = ITEM_MAX - 1 CHANGE_INDEX = ITEM_MAX - 2 #-------------------------------------------------------------------------- # ● 获取文字 #-------------------------------------------------------------------------- def character @index < CHANGE_INDEX ? table[@page][@index] : "" end #-------------------------------------------------------------------------- # ● 判定光标位置是否在“切换”上(平假/片假) #-------------------------------------------------------------------------- def is_page_change? @index == CHANGE_INDEX end #-------------------------------------------------------------------------- # ● 判定光标位置是否在“确定”上 #-------------------------------------------------------------------------- def is_ok? @index == OK_INDEX end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh contents.clear change_color(normal_color) ITEM_MAX.times {|i| draw_text(item_rect(i), table[@page][i], 1) } end #-------------------------------------------------------------------------- # ● 光标向下移动 # wrap : 允许循环 #-------------------------------------------------------------------------- def cursor_down(wrap) if @index < ITEM_MAX - 10 or wrap @index = (index + 10) % ITEM_MAX end end #-------------------------------------------------------------------------- # ● 光标向上移动 # wrap : 允许循环 #-------------------------------------------------------------------------- def cursor_up(wrap) if @index >= 10 or wrap @index = (index + ITEM_MAX - 10) % ITEM_MAX end end #-------------------------------------------------------------------------- # ● 光标向右移动 # wrap : 允许循环 #-------------------------------------------------------------------------- def cursor_right(wrap) if @index % 10 < ITEM_MAX / 10 @index += 1 elsif wrap @index -= 9 end end #-------------------------------------------------------------------------- # ● 跳转“确定” #-------------------------------------------------------------------------- def process_jump if @index != OK_INDEX @index = OK_INDEX Sound.play_cursor end end end
折叠内容标题(非必须)
折叠内容
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2024-11-16 13:02
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.