#==============================================================================
# ■ Scene_Register
#------------------------------------------------------------------------------
# 处理用户注册的类。
#==============================================================================
class Scene_Register
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
@mouse_press_check = false #用户名检测
@mouse_press_register = false # 注册按钮
@mouse_press_login = false # 登录按钮
@checked = false # 复选框
@focus_index = 1 #焦点
@get_focus = false #获得焦点
@textcursor_count = 0 # 用来控制光标闪烁
@textcursor_index = 0 # 用来控制光标位置
@text_index = 0 # 字符计数
end
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
# 生成背景图形
@sprite_back = Sprite.new
@sprite_back.bitmap = RPG::Cache.picture("用户注册.png")
# 生成用户名检测按钮
@sprite_usercheck = Sprite.new
@sprite_usercheck.bitmap = RPG::Cache.picture("user_check1.png")
@sprite_usercheck.x = 450
@sprite_usercheck.y = 160
# 生成同意协议复选框
@sprite_check = Sprite.new
@sprite_check.bitmap = RPG::Cache.picture("check_button1.png")
@sprite_check.x = 120
@sprite_check.y = 365
# 生成注册按钮
@sprite_register = Sprite.new
@sprite_register.bitmap = RPG::Cache.picture("注册1.png")
@sprite_register.x = 236
@sprite_register.y = 415
# 生成登录按钮
@sprite_login = Sprite.new
@sprite_login.bitmap = RPG::Cache.picture("登录1.png")
@sprite_login.x = 336
@sprite_login.y = 415
# 生成文本光标
@sprite_textcursor = Sprite.new
@sprite_textcursor.bitmap = RPG::Cache.picture("文本光标.png")
@sprite_textcursor.x = 236
@sprite_textcursor.y = 118
@sprite_textcursor.opacity = 0
# 生成用户注册窗口
@register_window = Window_Register.new
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
Audio.se_play("Audio/SE/"+"片头曲",100,100)
# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入情报
Mouse.update
# 刷新画面
update
# 如果画面切换的话就中断循环
if $scene != self
break
end
end
# 准备过渡
Graphics.freeze
# 释放窗口
@sprite_back.dispose
@sprite_back.bitmap.dispose
@sprite_usercheck.dispose
@sprite_usercheck.bitmap.dispose
@sprite_check.dispose
@sprite_check.bitmap.dispose
@sprite_register.dispose
@sprite_register.bitmap.dispose
@sprite_login.dispose
@sprite_login.bitmap.dispose
@sprite_textcursor.dispose
@sprite_textcursor.bitmap.dispose
@register_window.dispose
# 停止演奏 SE
Audio.se_stop
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 在获得焦点的情况下监听键盘输入
if @get_focus == true
listen_keyboard_input
# 按TAB键切换光标位置
if Kboard.keyboard($R_Key_TAB)
case @focus_index
when 1
@focus_index = 2
@textcursor_index = $password.length
@text_index = $password.length
when 2
@focus_index = 3
@textcursor_index = $password2.length
@text_index = $password2.length
when 3
@focus_index = 4
@textcursor_index = $qq.length
@text_index = $qq.length
when 4
@focus_index = 5
@textcursor_index = $email.length
@text_index = $email.length
when 5
@focus_index = 1
@textcursor_index = $username.length
@text_index = $username.length
end
end
end
if @get_focus == true # 在获得焦点的情况下刷新文本光标
if @textcursor_count%40 < 20 # 每秒钟刷新一次
@sprite_textcursor.opacity = 0
else
@sprite_textcursor.opacity = 255
end
# 刷新光标位置,因为背景图片的文本框没有对齐,所以设置比较麻烦
@sprite_textcursor.x = 236 + @textcursor_index * 8 # 8为每个字符的间距
case @focus_index
when 1
@sprite_textcursor.y = 118
when 2
@sprite_textcursor.y = 118 + 37
when 3
@sprite_textcursor.y = 118 + 76
when 4
@sprite_textcursor.y = 118 + 114
when 5
@sprite_textcursor.y = 118 + 154
end
@textcursor_count += 1
else
@sprite_textcursor.opacity = 0
end
mouse_x,mouse_y = Mouse.get_mouse_pos
Mouse.click_lock
# 用户名检测
if (mouse_x > @sprite_usercheck.x) and (mouse_y > @sprite_usercheck.y) and
(mouse_x < @sprite_usercheck.x + @sprite_usercheck.bitmap.width) and
(mouse_y < @sprite_usercheck.y + @sprite_usercheck.bitmap.height)
Mouse.click_unlock
@sprite_usercheck.bitmap = RPG::Cache.picture("user_check2.png")
if Mouse.press?(Mouse::LEFT)
@sprite_usercheck.bitmap = RPG::Cache.picture("user_check3.png")
@mouse_press_check = true
return
end
if @mouse_press_check
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
filename = "date.db"
file = File.open(filename, "r")
user_info = Marshal.load(file)
file.close
if $username.length <= 0
p "请输入用户名"
@mouse_press_check = false
return
else
if user_info.include?($username.to_s)
p "该用户名已经被注册"
else
p "该用户名可以使用"
end
end
@mouse_press_check = false
end
else
Mouse.click_lock
@sprite_usercheck.bitmap = RPG::Cache.picture("user_check1.png")
@mouse_press_check = false
end
# 同意协议复选框
if (mouse_x > @sprite_check.x) and (mouse_y > @sprite_check.y) and
(mouse_x < @sprite_check.x + @sprite_check.bitmap.width) and
(mouse_y < @sprite_check.y + @sprite_check.bitmap.height)
Mouse.click_unlock
if Mouse.trigger?(Mouse::LEFT)
@checked = !@checked
end
else
Mouse.click_lock
end
if @checked
@sprite_check.bitmap = RPG::Cache.picture("check_button2.png")
else
@sprite_check.bitmap = RPG::Cache.picture("check_button1.png")
end
# 用户名注册
if (mouse_x > @sprite_register.x) and (mouse_y > @sprite_register.y) and
(mouse_x < @sprite_register.x + @sprite_register.bitmap.width) and
(mouse_y < @sprite_register.y + @sprite_register.bitmap.height)
Mouse.click_unlock
@sprite_register.bitmap = RPG::Cache.picture("注册2.png")
if Mouse.press?(Mouse::LEFT)
@sprite_register.bitmap = RPG::Cache.picture("注册3.png")
@mouse_press_register = true
return
end
if @mouse_press_register
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
filename = "date.db"
file = File.open(filename, "r")
user_info = Marshal.load(file)
file.close
if $username.length <= 0
p "请输入用户名"
@mouse_press_register = false
return
else
if user_info.include?($username.to_s)
p "用户名已存在,注册失败"
@mouse_press_register = false
return
end
end
if $password.length <= 0 #如果密码为空
p "请输入密码"
@mouse_press_register = false
return
end
if $password2.length <= 0 #如果确认密码为空
p "请再次输入密码"
@mouse_press_register = false
return
end
if $password.to_s != $password2.to_s #如果二次输入的密码不同
p "二次输入的密码不一致,请重新输入"
@mouse_press_register = false
return
end
if $qq.length <= 0 #如果确认密码为空
p "请输入qq号码"
@mouse_press_register = false
return
end
if $email.length <= 0 #如果确认密码为空
p "请输入电子邮箱"
@mouse_press_register = false
return
end
if @checked == false
print "请勾选同意用户协议再重新尝试"
@mouse_press_register = false
return
end
unless $email.to_s =~"([\.a-zA-Z0-9_-]){2,10}@([a-zA-Z0-9_-]){2,10}(\.([a-zA-Z0-9]){2,}){1,4}$"
p "请输入正确的邮箱地址"
@mouse_press_register = false
return
end
# 插入数据库
filename = "date.db"
file = File.open(filename, "r")
user_info = Marshal.load(file)
user_info[$username.to_s] = [$password.to_s,$qq.to_s,$email.to_s]
file = File.open(filename, "wb")
Marshal.dump(user_info, file)
file.close
p "您已成功注册,请到系统登录页面登录"
$scene = Scene_Login.new
@mouse_press_register = false
end
else
Mouse.click_lock
@sprite_register.bitmap = RPG::Cache.picture("注册1.png")
@mouse_press_register = false
end
# 用户登录
if (mouse_x > @sprite_login.x) and (mouse_y > @sprite_login.y) and
(mouse_x < @sprite_login.x + @sprite_login.bitmap.width) and
(mouse_y < @sprite_login.y + @sprite_login.bitmap.height)
Mouse.click_unlock
@sprite_login.bitmap = RPG::Cache.picture("登录2.png")
if Mouse.press?(Mouse::LEFT)
@sprite_login.bitmap = RPG::Cache.picture("登录3.png")
@mouse_press_login = true
return
end
if @mouse_press_login
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
@mouse_press_login = false
$scene = Scene_Login.new
end
else
Mouse.click_lock
@sprite_login.bitmap = RPG::Cache.picture("登录1.png")
@mouse_press_login = false
end
# 用户名文本框区域
if (mouse_x > 234 - 5) and (mouse_y > 115 - 10) and
(mouse_x < 400 + 5) and (mouse_y < 139)
Mouse.click_unlock
$mouse_tag = "text"
if Mouse.trigger?(Mouse::LEFT)
@get_focus = true
@focus_index = 1
@textcursor_index = $username.length
@text_index = $username.length
end
return
else
Mouse.click_lock
$mouse_tag = nil
end
# 密码文本框区域
if (mouse_x > 234 - 5) and (mouse_y > 153 - 10) and
(mouse_x < 400 + 5) and (mouse_y < 174)
Mouse.click_unlock
$mouse_tag = "text"
if Mouse.trigger?(Mouse::LEFT)
@get_focus = true
@focus_index = 2
@textcursor_index = $password.length
@text_index = $password.length
end
return
else
Mouse.click_lock
$mouse_tag = nil
end
# 确认密码文本框区域
if (mouse_x > 234 - 5) and (mouse_y > 190 - 10) and
(mouse_x < 400 + 5) and (mouse_y < 216)
Mouse.click_unlock
$mouse_tag = "text"
if Mouse.trigger?(Mouse::LEFT)
@get_focus = true
@focus_index = 3
@textcursor_index = $password2.length
@text_index = $password2.length
end
return
else
Mouse.click_lock
$mouse_tag = nil
end
# QQ文本框区域
if (mouse_x > 234 - 5) and (mouse_y > 232 - 10) and
(mouse_x < 400 + 5) and (mouse_y < 253)
Mouse.click_unlock
$mouse_tag = "text"
if Mouse.trigger?(Mouse::LEFT)
@get_focus = true
@focus_index = 4
@textcursor_index = $qq.length
@text_index = $qq.length
end
return
else
Mouse.click_lock
$mouse_tag = nil
end
# 电子邮箱文本框区域
if (mouse_x > 234 - 5) and (mouse_y > 310 - 10) and
(mouse_x < 452 + 5) and (mouse_y < 330)
Mouse.click_unlock
$mouse_tag = "text"
if Mouse.trigger?(Mouse::LEFT)
@get_focus = true
@focus_index = 5
@textcursor_index = $email.length
@text_index = $email.length
end
return
else
Mouse.click_lock
$mouse_tag = nil
end
end
############################################################################
# 监听键盘输入
def listen_keyboard_input
case @focus_index
when 1
# 字母A
if Kboard.keyboard($R_Key_A)
if $username.length >= 15
return
end
$username[@text_index] = "a"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母B
if Kboard.keyboard($R_Key_B)
if $username.length >= 15
return
end
$username[@text_index] = "b"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母C
if Kboard.keyboard($R_Key_C)
if $username.length >= 15
return
end
$username[@text_index] = "c"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母D
if Kboard.keyboard($R_Key_D)
if $username.length >= 15
return
end
$username[@text_index] = "d"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母E
if Kboard.keyboard($R_Key_E)
if $username.length >= 15
return
end
$username[@text_index] = "e"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母F
if Kboard.keyboard($R_Key_F)
if $username.length >= 15
return
end
$username[@text_index] = "f"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母G
if Kboard.keyboard($R_Key_G)
if $username.length >= 15
return
end
$username[@text_index] = "g"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母H
if Kboard.keyboard($R_Key_H)
if $username.length >= 15
return
end
$username[@text_index] = "h"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母I
if Kboard.keyboard($R_Key_I)
if $username.length >= 15
return
end
$username[@text_index] = "i"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母J
if Kboard.keyboard($R_Key_J)
if $username.length >= 15
return
end
$username[@text_index] = "j"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母K
if Kboard.keyboard($R_Key_K)
if $username.length >= 15
return
end
$username[@text_index] = "k"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母L
if Kboard.keyboard($R_Key_L)
if $username.length >= 15
return
end
$username[@text_index] = "l"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母M
if Kboard.keyboard($R_Key_M)
if $username.length >= 15
return
end
$username[@text_index] = "m"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母N
if Kboard.keyboard($R_Key_N)
if $username.length >= 15
return
end
$username[@text_index] = "n"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母O
if Kboard.keyboard($R_Key_O)
if $username.length >= 15
return
end
$username[@text_index] = "o"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母P
if Kboard.keyboard($R_Key_P)
if $username.length >= 15
return
end
$username[@text_index] = "p"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母Q
if Kboard.keyboard($R_Key_Q)
if $username.length >= 15
return
end
$username[@text_index] = "q"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母R
if Kboard.keyboard($R_Key_R)
if $username.length >= 15
return
end
$username[@text_index] = "r"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母S
if Kboard.keyboard($R_Key_S)
if $username.length >= 15
return
end
$username[@text_index] = "s"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母T
if Kboard.keyboard($R_Key_T)
if $username.length >= 15
return
end
$username[@text_index] = "t"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母U
if Kboard.keyboard($R_Key_U)
if $username.length >= 15
return
end
$username[@text_index] = "u"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母V
if Kboard.keyboard($R_Key_V)
if $username.length >= 15
return
end
$username[@text_index] = "v"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母W
if Kboard.keyboard($R_Key_W)
if $username.length >= 15
return
end
$username[@text_index] = "w"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母X
if Kboard.keyboard($R_Key_X)
if $username.length >= 15
return
end
$username[@text_index] = "x"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母Y
if Kboard.keyboard($R_Key_Y)
if $username.length >= 15
return
end
$username[@text_index] = "y"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母Z
if Kboard.keyboard($R_Key_Z)
if $username.length >= 15
return
end
$username[@text_index] = "z"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字0
if Kboard.keyboard($R_Key_0) or Kboard.keyboard($R_Key_NUMPAD0)
if $username.length >= 15
return
end
$username[@text_index] = "0"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字1
if Kboard.keyboard($R_Key_1) or Kboard.keyboard($R_Key_NUMPAD1)
if $username.length >= 15
return
end
$username[@text_index] = "1"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字2
if Kboard.keyboard($R_Key_2) or Kboard.keyboard($R_Key_NUMPAD2)
if $username.length >= 15
return
end
$username[@text_index] = "2"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字3
if Kboard.keyboard($R_Key_3) or Kboard.keyboard($R_Key_NUMPAD3)
if $username.length >= 15
return
end
$username[@text_index] = "3"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字4
if Kboard.keyboard($R_Key_4) or Kboard.keyboard($R_Key_NUMPAD4)
if $username.length >= 15
return
end
$username[@text_index] = "4"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字5
if Kboard.keyboard($R_Key_5) or Kboard.keyboard($R_Key_NUMPAD5)
if $username.length >= 15
return
end
$username[@text_index] = "5"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字6
if Kboard.keyboard($R_Key_6) or Kboard.keyboard($R_Key_NUMPAD6)
if $username.length >= 15
return
end
$username[@text_index] = "6"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字7
if Kboard.keyboard($R_Key_7) or Kboard.keyboard($R_Key_NUMPAD7)
if $username.length >= 15
return
end
$username[@text_index] = "7"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字8
if Kboard.keyboard($R_Key_8) or Kboard.keyboard($R_Key_NUMPAD8)
if $username.length >= 15
return
end
$username[@text_index] = "8"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字9
if Kboard.keyboard($R_Key_9) or Kboard.keyboard($R_Key_NUMPAD9)
if $username.length >= 15
return
end
$username[@text_index] = "9"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 删除键
if Kboard.keyboard($R_Key_BACK)
if $username.length > 0
$username.pop
@textcursor_index -= 1
@text_index -= 1
@register_window.refresh
end
end
when 2
# 字母A
if Kboard.keyboard($R_Key_A)
if $password.length >= 15
return
end
$password[@text_index] = "a"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母B
if Kboard.keyboard($R_Key_B)
if $password.length >= 15
return
end
$password[@text_index] = "b"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母C
if Kboard.keyboard($R_Key_C)
if $password.length >= 15
return
end
$password[@text_index] = "c"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母D
if Kboard.keyboard($R_Key_D)
if $password.length >= 15
return
end
$password[@text_index] = "d"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母E
if Kboard.keyboard($R_Key_E)
if $password.length >= 15
return
end
$password[@text_index] = "e"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母F
if Kboard.keyboard($R_Key_F)
if $password.length >= 15
return
end
$password[@text_index] = "f"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母G
if Kboard.keyboard($R_Key_G)
if $password.length >= 15
return
end
$password[@text_index] = "g"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母H
if Kboard.keyboard($R_Key_H)
if $password.length >= 15
return
end
$password[@text_index] = "h"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母I
if Kboard.keyboard($R_Key_I)
if $password.length >= 15
return
end
$password[@text_index] = "i"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母J
if Kboard.keyboard($R_Key_J)
if $password.length >= 15
return
end
$password[@text_index] = "j"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母K
if Kboard.keyboard($R_Key_K)
if $password.length >= 15
return
end
$password[@text_index] = "k"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母L
if Kboard.keyboard($R_Key_L)
if $password.length >= 15
return
end
$password[@text_index] = "l"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母M
if Kboard.keyboard($R_Key_M)
if $password.length >= 15
return
end
$password[@text_index] = "m"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母N
if Kboard.keyboard($R_Key_N)
if $password.length >= 15
return
end
$password[@text_index] = "n"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母O
if Kboard.keyboard($R_Key_O)
if $password.length >= 15
return
end
$password[@text_index] = "o"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母P
if Kboard.keyboard($R_Key_P)
if $password.length >= 15
return
end
$password[@text_index] = "p"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母Q
if Kboard.keyboard($R_Key_Q)
if $password.length >= 15
return
end
$password[@text_index] = "q"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母R
if Kboard.keyboard($R_Key_R)
if $password.length >= 15
return
end
$password[@text_index] = "r"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母S
if Kboard.keyboard($R_Key_S)
if $password.length >= 15
return
end
$password[@text_index] = "s"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母T
if Kboard.keyboard($R_Key_T)
if $password.length >= 15
return
end
$password[@text_index] = "t"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母U
if Kboard.keyboard($R_Key_U)
if $password.length >= 15
return
end
$password[@text_index] = "u"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母V
if Kboard.keyboard($R_Key_V)
if $password.length >= 15
return
end
$password[@text_index] = "v"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母W
if Kboard.keyboard($R_Key_W)
if $password.length >= 15
return
end
$password[@text_index] = "w"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母X
if Kboard.keyboard($R_Key_X)
if $password.length >= 15
return
end
$password[@text_index] = "x"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母Y
if Kboard.keyboard($R_Key_Y)
if $password.length >= 15
return
end
$password[@text_index] = "y"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母Z
if Kboard.keyboard($R_Key_Z)
if $password.length >= 15
return
end
$password[@text_index] = "z"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字0
if Kboard.keyboard($R_Key_0) or Kboard.keyboard($R_Key_NUMPAD0)
if $password.length >= 15
return
end
$password[@text_index] = "0"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字1
if Kboard.keyboard($R_Key_1) or Kboard.keyboard($R_Key_NUMPAD1)
if $password.length >= 15
return
end
$password[@text_index] = "1"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字2
if Kboard.keyboard($R_Key_2) or Kboard.keyboard($R_Key_NUMPAD2)
if $password.length >= 15
return
end
$password[@text_index] = "2"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字3
if Kboard.keyboard($R_Key_3) or Kboard.keyboard($R_Key_NUMPAD3)
if $password.length >= 15
return
end
$password[@text_index] = "3"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字4
if Kboard.keyboard($R_Key_4) or Kboard.keyboard($R_Key_NUMPAD4)
if $password.length >= 15
return
end
$password[@text_index] = "4"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字5
if Kboard.keyboard($R_Key_5) or Kboard.keyboard($R_Key_NUMPAD5)
if $password.length >= 15
return
end
$password[@text_index] = "5"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字6
if Kboard.keyboard($R_Key_6) or Kboard.keyboard($R_Key_NUMPAD6)
if $password.length >= 15
return
end
$password[@text_index] = "6"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字7
if Kboard.keyboard($R_Key_7) or Kboard.keyboard($R_Key_NUMPAD7)
if $password.length >= 15
return
end
$password[@text_index] = "7"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字8
if Kboard.keyboard($R_Key_8) or Kboard.keyboard($R_Key_NUMPAD8)
if $password.length >= 15
return
end
$password[@text_index] = "8"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字9
if Kboard.keyboard($R_Key_9) or Kboard.keyboard($R_Key_NUMPAD9)
if $password.length >= 15
return
end
$password[@text_index] = "9"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 删除键
if Kboard.keyboard($R_Key_BACK)
if $password.length > 0
$password.pop
@textcursor_index -= 1
@text_index -= 1
@register_window.refresh
end
end
when 3
# 字母A
if Kboard.keyboard($R_Key_A)
if $password2.length >= 15
return
end
$password2[@text_index] = "a"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母B
if Kboard.keyboard($R_Key_B)
if $password2.length >= 15
return
end
$password2[@text_index] = "b"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母C
if Kboard.keyboard($R_Key_C)
if $password2.length >= 15
return
end
$password2[@text_index] = "c"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母D
if Kboard.keyboard($R_Key_D)
if $password2.length >= 15
return
end
$password2[@text_index] = "d"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母E
if Kboard.keyboard($R_Key_E)
if $password2.length >= 15
return
end
$password2[@text_index] = "e"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母F
if Kboard.keyboard($R_Key_F)
if $password2.length >= 15
return
end
$password2[@text_index] = "f"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母G
if Kboard.keyboard($R_Key_G)
if $password2.length >= 15
return
end
$password2[@text_index] = "g"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母H
if Kboard.keyboard($R_Key_H)
if $password2.length >= 15
return
end
$password2[@text_index] = "h"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母I
if Kboard.keyboard($R_Key_I)
if $password2.length >= 15
return
end
$password2[@text_index] = "i"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母J
if Kboard.keyboard($R_Key_J)
if $password2.length >= 15
return
end
$password2[@text_index] = "j"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母K
if Kboard.keyboard($R_Key_K)
if $password2.length >= 15
return
end
$password2[@text_index] = "k"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母L
if Kboard.keyboard($R_Key_L)
if $password2.length >= 15
return
end
$password2[@text_index] = "l"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母M
if Kboard.keyboard($R_Key_M)
if $password2.length >= 15
return
end
$password2[@text_index] = "m"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母N
if Kboard.keyboard($R_Key_N)
if $password2.length >= 15
return
end
$password2[@text_index] = "n"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母O
if Kboard.keyboard($R_Key_O)
if $password2.length >= 15
return
end
$password2[@text_index] = "o"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母P
if Kboard.keyboard($R_Key_P)
if $password2.length >= 15
return
end
$password2[@text_index] = "p"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母Q
if Kboard.keyboard($R_Key_Q)
if $password2.length >= 15
return
end
$password2[@text_index] = "q"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母R
if Kboard.keyboard($R_Key_R)
if $password2.length >= 15
return
end
$password2[@text_index] = "r"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母S
if Kboard.keyboard($R_Key_S)
if $password2.length >= 15
return
end
$password2[@text_index] = "s"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母T
if Kboard.keyboard($R_Key_T)
if $password2.length >= 15
return
end
$password2[@text_index] = "t"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母U
if Kboard.keyboard($R_Key_U)
if $password2.length >= 15
return
end
$password2[@text_index] = "u"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母V
if Kboard.keyboard($R_Key_V)
if $password2.length >= 15
return
end
$password2[@text_index] = "v"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母W
if Kboard.keyboard($R_Key_W)
if $password2.length >= 15
return
end
$password2[@text_index] = "w"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母X
if Kboard.keyboard($R_Key_X)
if $password2.length >= 15
return
end
$password2[@text_index] = "x"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母Y
if Kboard.keyboard($R_Key_Y)
if $password2.length >= 15
return
end
$password2[@text_index] = "y"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母Z
if Kboard.keyboard($R_Key_Z)
if $password2.length >= 15
return
end
$password2[@text_index] = "z"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字0
if Kboard.keyboard($R_Key_0) or Kboard.keyboard($R_Key_NUMPAD0)
if $password2.length >= 15
return
end
$password2[@text_index] = "0"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字1
if Kboard.keyboard($R_Key_1) or Kboard.keyboard($R_Key_NUMPAD1)
if $password2.length >= 15
return
end
$password2[@text_index] = "1"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字2
if Kboard.keyboard($R_Key_2) or Kboard.keyboard($R_Key_NUMPAD2)
if $password2.length >= 15
return
end
$password2[@text_index] = "2"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字3
if Kboard.keyboard($R_Key_3) or Kboard.keyboard($R_Key_NUMPAD3)
if $password2.length >= 15
return
end
$password2[@text_index] = "3"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字4
if Kboard.keyboard($R_Key_4) or Kboard.keyboard($R_Key_NUMPAD4)
if $password2.length >= 15
return
end
$password2[@text_index] = "4"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字5
if Kboard.keyboard($R_Key_5) or Kboard.keyboard($R_Key_NUMPAD5)
if $password2.length >= 15
return
end
$password2[@text_index] = "5"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字6
if Kboard.keyboard($R_Key_6) or Kboard.keyboard($R_Key_NUMPAD6)
if $password2.length >= 15
return
end
$password2[@text_index] = "6"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字7
if Kboard.keyboard($R_Key_7) or Kboard.keyboard($R_Key_NUMPAD7)
if $password2.length >= 15
return
end
$password2[@text_index] = "7"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字8
if Kboard.keyboard($R_Key_8) or Kboard.keyboard($R_Key_NUMPAD8)
if $password2.length >= 15
return
end
$password2[@text_index] = "8"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字9
if Kboard.keyboard($R_Key_9) or Kboard.keyboard($R_Key_NUMPAD9)
if $password2.length >= 15
return
end
$password2[@text_index] = "9"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 删除键
if Kboard.keyboard($R_Key_BACK)
if $password2.length > 0
$password2.pop
@textcursor_index -= 1
@text_index -= 1
@register_window.refresh
end
end
when 4
# 字母A
if Kboard.keyboard($R_Key_A)
return
end
# 字母B
if Kboard.keyboard($R_Key_B)
return
end
# 字母C
if Kboard.keyboard($R_Key_C)
return
end
# 字母D
if Kboard.keyboard($R_Key_D)
return
end
# 字母E
if Kboard.keyboard($R_Key_E)
return
end
# 字母F
if Kboard.keyboard($R_Key_F)
return
end
# 字母G
if Kboard.keyboard($R_Key_G)
return
end
# 字母H
if Kboard.keyboard($R_Key_H)
return
end
# 字母I
if Kboard.keyboard($R_Key_I)
return
end
# 字母J
if Kboard.keyboard($R_Key_J)
return
end
# 字母K
if Kboard.keyboard($R_Key_K)
return
end
# 字母L
if Kboard.keyboard($R_Key_L)
return
end
# 字母M
if Kboard.keyboard($R_Key_M)
return
end
# 字母N
if Kboard.keyboard($R_Key_N)
return
end
# 字母O
if Kboard.keyboard($R_Key_O)
return
end
# 字母P
if Kboard.keyboard($R_Key_P)
return
end
# 字母Q
if Kboard.keyboard($R_Key_Q)
return
end
# 字母R
if Kboard.keyboard($R_Key_R)
return
end
# 字母S
if Kboard.keyboard($R_Key_S)
return
end
# 字母T
if Kboard.keyboard($R_Key_T)
return
end
# 字母U
if Kboard.keyboard($R_Key_U)
return
end
# 字母V
if Kboard.keyboard($R_Key_V)
return
end
# 字母W
if Kboard.keyboard($R_Key_W)
return
end
# 字母X
if Kboard.keyboard($R_Key_X)
return
end
# 字母Y
if Kboard.keyboard($R_Key_Y)
return
end
# 字母Z
if Kboard.keyboard($R_Key_Z)
return
end
# 数字0
if Kboard.keyboard($R_Key_0) or Kboard.keyboard($R_Key_NUMPAD0)
if $qq.length >= 10
return
end
$qq[@text_index] = "0"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字1
if Kboard.keyboard($R_Key_1) or Kboard.keyboard($R_Key_NUMPAD1)
if $qq.length >= 10
return
end
$qq[@text_index] = "1"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字2
if Kboard.keyboard($R_Key_2) or Kboard.keyboard($R_Key_NUMPAD2)
if $qq.length >= 10
return
end
$qq[@text_index] = "2"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字3
if Kboard.keyboard($R_Key_3) or Kboard.keyboard($R_Key_NUMPAD3)
if $qq.length >= 10
return
end
$qq[@text_index] = "3"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字4
if Kboard.keyboard($R_Key_4) or Kboard.keyboard($R_Key_NUMPAD4)
if $qq.length >= 10
return
end
$qq[@text_index] = "4"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字5
if Kboard.keyboard($R_Key_5) or Kboard.keyboard($R_Key_NUMPAD5)
if $qq.length >= 10
return
end
$qq[@text_index] = "5"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字6
if Kboard.keyboard($R_Key_6) or Kboard.keyboard($R_Key_NUMPAD6)
if $qq.length >= 10
return
end
$qq[@text_index] = "6"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字7
if Kboard.keyboard($R_Key_7) or Kboard.keyboard($R_Key_NUMPAD7)
if $qq.length >= 10
return
end
$qq[@text_index] = "7"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字8
if Kboard.keyboard($R_Key_8) or Kboard.keyboard($R_Key_NUMPAD8)
if $qq.length >= 10
return
end
$qq[@text_index] = "8"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字9
if Kboard.keyboard($R_Key_9) or Kboard.keyboard($R_Key_NUMPAD9)
if $qq.length >= 10
return
end
$qq[@text_index] = "9"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 删除键
if Kboard.keyboard($R_Key_BACK)
if $qq.length > 0
$qq.pop
@textcursor_index -= 1
@text_index -= 1
@register_window.refresh
end
end
when 5
# 字母A
if Kboard.keyboard($R_Key_A)
if $email.length >= 20
return
end
$email[@text_index] = "a"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母B
if Kboard.keyboard($R_Key_B)
if $email.length >= 20
return
end
$email[@text_index] = "b"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母C
if Kboard.keyboard($R_Key_C)
if $email.length >= 20
return
end
$email[@text_index] = "c"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母D
if Kboard.keyboard($R_Key_D)
if $email.length >= 20
return
end
$email[@text_index] = "d"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母E
if Kboard.keyboard($R_Key_E)
if $email.length >= 20
return
end
$email[@text_index] = "e"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母F
if Kboard.keyboard($R_Key_F)
if $email.length >= 20
return
end
$email[@text_index] = "f"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母G
if Kboard.keyboard($R_Key_G)
if $email.length >= 20
return
end
$email[@text_index] = "g"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母H
if Kboard.keyboard($R_Key_H)
if $email.length >= 20
return
end
$email[@text_index] = "h"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母I
if Kboard.keyboard($R_Key_I)
if $email.length >= 20
return
end
$email[@text_index] = "i"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母J
if Kboard.keyboard($R_Key_J)
if $email.length >= 20
return
end
$email[@text_index] = "j"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母K
if Kboard.keyboard($R_Key_K)
if $email.length >= 20
return
end
$email[@text_index] = "k"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母L
if Kboard.keyboard($R_Key_L)
if $email.length >= 20
return
end
$email[@text_index] = "l"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母M
if Kboard.keyboard($R_Key_M)
if $email.length >= 20
return
end
$email[@text_index] = "m"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母N
if Kboard.keyboard($R_Key_N)
if $email.length >= 20
return
end
$email[@text_index] = "n"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母O
if Kboard.keyboard($R_Key_O)
if $email.length >= 20
return
end
$email[@text_index] = "o"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母P
if Kboard.keyboard($R_Key_P)
if $email.length >= 20
return
end
$email[@text_index] = "p"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母Q
if Kboard.keyboard($R_Key_Q)
if $email.length >= 20
return
end
$email[@text_index] = "q"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母R
if Kboard.keyboard($R_Key_R)
if $email.length >= 20
return
end
$email[@text_index] = "r"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母S
if Kboard.keyboard($R_Key_S)
if $email.length >= 20
return
end
$email[@text_index] = "s"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母T
if Kboard.keyboard($R_Key_T)
if $email.length >= 20
return
end
$email[@text_index] = "t"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母U
if Kboard.keyboard($R_Key_U)
if $email.length >= 20
return
end
$email[@text_index] = "u"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母V
if Kboard.keyboard($R_Key_V)
if $email.length >= 20
return
end
$email[@text_index] = "v"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母W
if Kboard.keyboard($R_Key_W)
if $email.length >= 20
return
end
$email[@text_index] = "w"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母X
if Kboard.keyboard($R_Key_X)
if $email.length >= 20
return
end
$email[@text_index] = "x"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母Y
if Kboard.keyboard($R_Key_Y)
if $email.length >= 20
return
end
$email[@text_index] = "y"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 字母Z
if Kboard.keyboard($R_Key_Z)
if $email.length >= 20
return
end
$email[@text_index] = "z"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字0
if Kboard.keyboard($R_Key_0) or Kboard.keyboard($R_Key_NUMPAD0)
if $email.length >= 20
return
end
$email[@text_index] = "0"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字1
if Kboard.keyboard($R_Key_1) or Kboard.keyboard($R_Key_NUMPAD1)
if $email.length >= 20
return
end
$email[@text_index] = "1"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字2和符号@
if Kboard.keyb($R_Key_LSHIFT) == 1
if Kboard.keyboard($R_Key_2) or Kboard.keyboard($R_Key_NUMPAD2)
if $email.length >= 20
return
end
$email[@text_index] = "@"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
else
if Kboard.keyboard($R_Key_2) or Kboard.keyboard($R_Key_NUMPAD2)
if $email.length >= 20
return
end
$email[@text_index] = "2"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
end
# 数字2
if Kboard.keyboard($R_Key_2) or Kboard.keyboard($R_Key_NUMPAD2)
if $email.length >= 20
return
end
$email[@text_index] = "2"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字3
if Kboard.keyboard($R_Key_3) or Kboard.keyboard($R_Key_NUMPAD3)
if $email.length >= 20
return
end
$email[@text_index] = "3"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字4
if Kboard.keyboard($R_Key_4) or Kboard.keyboard($R_Key_NUMPAD4)
if $email.length >= 20
return
end
$email[@text_index] = "4"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字5
if Kboard.keyboard($R_Key_5) or Kboard.keyboard($R_Key_NUMPAD5)
if $email.length >= 20
return
end
$email[@text_index] = "5"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字6
if Kboard.keyboard($R_Key_6) or Kboard.keyboard($R_Key_NUMPAD6)
if $email.length >= 20
return
end
$email[@text_index] = "6"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字7
if Kboard.keyboard($R_Key_7) or Kboard.keyboard($R_Key_NUMPAD7)
if $email.length >= 20
return
end
$email[@text_index] = "7"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字8
if Kboard.keyboard($R_Key_8) or Kboard.keyboard($R_Key_NUMPAD8)
if $email.length >= 20
return
end
$email[@text_index] = "8"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 数字9
if Kboard.keyboard($R_Key_9) or Kboard.keyboard($R_Key_NUMPAD9)
if $email.length >= 20
return
end
$email[@text_index] = "9"
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 符号.
if Kboard.keyboard($R_Key_DOTT)
if $email.length >= 20
return
end
$email[@text_index] = "."
@textcursor_index += 1
@text_index += 1
@register_window.refresh
end
# 删除键
if Kboard.keyboard($R_Key_BACK)
if $email.length > 0
$email.pop
@textcursor_index -= 1
@text_index -= 1
@register_window.refresh
end
end
end
end
end