更新登录界面
This commit is contained in:
4
main.lua
4
main.lua
@@ -601,8 +601,8 @@ for _,fileName in next,fs.getDirectoryItems('replay') do
|
||||
end
|
||||
table.sort(REPLAY,function(a,b) return a.fileName>b.fileName end)
|
||||
|
||||
WS.switchHost('cafuuchino1.3322.org','10026','/techmino/ws/v1')
|
||||
HTTP.setHost("cafuuchino1.3322.org:10026")
|
||||
WS.switchHost('cafuuchino1.3322.org','10027','/techmino/ws/v1')
|
||||
HTTP.setHost("cafuuchino1.3322.org:10027")
|
||||
HTTP.setThreadCount(1)
|
||||
|
||||
table.insert(_LOADTIMELIST_,("Load Resources: %.3fs"):format(TIME()-_LOADTIME_))
|
||||
|
||||
@@ -587,10 +587,8 @@ do-- Userdata tables
|
||||
USER=setmetatable({-- User infomation
|
||||
__data={
|
||||
uid=false,
|
||||
email=false,
|
||||
password=false,
|
||||
rToken=false,
|
||||
aToken=false,
|
||||
oToken=false,
|
||||
},
|
||||
},{
|
||||
__index=function(self,k)
|
||||
|
||||
@@ -744,12 +744,11 @@ return {
|
||||
music="BGMs",
|
||||
label="label",
|
||||
},
|
||||
login_mail={
|
||||
title="Sign In/Sign Up",
|
||||
email="Email Address",
|
||||
send="Send code",
|
||||
code="Verification Code",
|
||||
verify="Verify",
|
||||
login={
|
||||
title="Sign In",
|
||||
ticket="Auth Ticket",
|
||||
authorize="Open Authorizing Page",
|
||||
submit="Submit",
|
||||
},
|
||||
reset_password={
|
||||
title="Reset Password",
|
||||
|
||||
@@ -736,12 +736,11 @@ return {
|
||||
music="BGMs",
|
||||
label="Etiq.",
|
||||
},
|
||||
login_mail={
|
||||
title="Entrar/Registrarse",
|
||||
email="Correo Elec.",
|
||||
send="Enviar código",
|
||||
code="Código de Verif.",
|
||||
verify="Verificar",
|
||||
login={
|
||||
-- title="Sign In",
|
||||
-- ticket="Auth Ticket",
|
||||
-- authorize="Open Authorizing Page",
|
||||
-- submit="Submit",
|
||||
},
|
||||
reset_password={
|
||||
title="Restablecer Contraseña",
|
||||
|
||||
@@ -699,12 +699,11 @@ return {
|
||||
music="Musique",
|
||||
-- label="label",
|
||||
},
|
||||
login_mail={
|
||||
title="Connexion/Enregistrement",
|
||||
email="E-mail",
|
||||
-- send="Send code",
|
||||
-- code="Verification Code",
|
||||
-- verify="Verify",
|
||||
login={
|
||||
-- title="Sign In",
|
||||
-- ticket="Auth Ticket",
|
||||
-- authorize="Open Authorizing Page",
|
||||
-- submit="Submit",
|
||||
},
|
||||
reset_password={
|
||||
-- title="Reset Password",
|
||||
|
||||
@@ -745,12 +745,11 @@ return {
|
||||
music="Musik",
|
||||
label="label",
|
||||
},
|
||||
login_mail={
|
||||
title="Masuk/Daftar",
|
||||
email="Alamat Email",
|
||||
-- send="Send code",
|
||||
-- code="Verification Code",
|
||||
-- verify="Verify",
|
||||
login={
|
||||
-- title="Sign In",
|
||||
-- ticket="Auth Ticket",
|
||||
-- authorize="Open Authorizing Page",
|
||||
-- submit="Submit",
|
||||
},
|
||||
reset_password={
|
||||
-- title="Reset Password",
|
||||
|
||||
@@ -746,12 +746,11 @@ return {
|
||||
music="曲",
|
||||
label="ラベル",
|
||||
},
|
||||
login_mail={
|
||||
title="サインイン/サインアップ",
|
||||
email="Eメールアドレス",
|
||||
send="認証コード送信",
|
||||
code="認証コード",
|
||||
verify="認証",
|
||||
logi={
|
||||
-- title="Sign In",
|
||||
-- ticket="Auth Ticket",
|
||||
-- authorize="Open Authorizing Page",
|
||||
-- submit="Submit",
|
||||
},
|
||||
reset_password={
|
||||
title="パスワード再設定",
|
||||
|
||||
@@ -734,12 +734,11 @@ return {
|
||||
-- music="BGMs",
|
||||
-- label="label",
|
||||
},
|
||||
login_mail={
|
||||
title="Log in/Registrar",
|
||||
email="Endereço De Email",
|
||||
-- send="Send code",
|
||||
-- code="Verification Code",
|
||||
-- verify="Verify",
|
||||
login={
|
||||
-- title="Sign In",
|
||||
-- ticket="Auth Ticket",
|
||||
-- authorize="Open Authorizing Page",
|
||||
-- submit="Submit",
|
||||
},
|
||||
reset_password={
|
||||
-- title="Reset Password",
|
||||
|
||||
@@ -485,12 +485,11 @@ return {
|
||||
music="~~~",
|
||||
label="...",
|
||||
},
|
||||
login_mail={
|
||||
title="Log in/Sign up",
|
||||
email="@",
|
||||
send="→",
|
||||
code="←",
|
||||
verify="!",
|
||||
login={
|
||||
title="Sign In",
|
||||
-- ticket="Auth Ticket",
|
||||
-- authorize="Open Authorizing Page",
|
||||
-- submit="Submit",
|
||||
},
|
||||
reset_password={
|
||||
title="R ***",
|
||||
|
||||
@@ -744,12 +744,11 @@ return {
|
||||
path="打开存储目录",
|
||||
save="用户档案管理",
|
||||
},
|
||||
login_mail={
|
||||
title="登录/注册",
|
||||
email="邮箱",
|
||||
send="发送验证码",
|
||||
code="验证码",
|
||||
verify="验证邮箱",
|
||||
login={
|
||||
title="登录",
|
||||
ticket="授权令牌",
|
||||
authorize="打开授权页面",
|
||||
submit="提交",
|
||||
},
|
||||
reset_password={
|
||||
title="重置密码",
|
||||
|
||||
@@ -693,12 +693,11 @@ return {
|
||||
path="OpenPath();",
|
||||
save="DataManagement();",
|
||||
},
|
||||
login_mail={
|
||||
title="LogIn_Register.UI",
|
||||
email="Email=",
|
||||
send="Send();",
|
||||
code="V-code=",
|
||||
verify="Verify();",
|
||||
login={
|
||||
title="SignIn.UI",
|
||||
ticket="Ticket=",
|
||||
authorize="Authorize()",
|
||||
submit="Submit()",
|
||||
},
|
||||
reset_password={
|
||||
title="Reset_Password.UI",
|
||||
|
||||
@@ -744,12 +744,11 @@ return {
|
||||
path="打開存儲目錄",
|
||||
save="用戶資料管理",
|
||||
},
|
||||
login_mail={
|
||||
title="登錄/註冊",
|
||||
email="電郵",
|
||||
send="發送驗證碼",
|
||||
code="驗證碼",
|
||||
verify="驗證郵箱",
|
||||
login={
|
||||
title="登錄",
|
||||
-- ticket="Auth Ticket",
|
||||
-- authorize="Open Authorizing Page",
|
||||
-- submit="Submit",
|
||||
},
|
||||
reset_password={
|
||||
title="重設密碼",
|
||||
|
||||
@@ -1,47 +1,41 @@
|
||||
local scene={}
|
||||
|
||||
local function _getCode()
|
||||
local email=scene.widgetList.email:getText()
|
||||
if not STRING.simpEmailCheck(email) then
|
||||
MES.new('error',text.wrongEmail)
|
||||
else
|
||||
USER.email=email
|
||||
NET.getCode(email)
|
||||
end
|
||||
local function _authorize()
|
||||
love.system.openURL("https://dev.studio26f.org/oauth?product=techmino")
|
||||
end
|
||||
local function _codeLogin()
|
||||
local code=scene.widgetList.code:getText():upper()
|
||||
if #code~=8 then
|
||||
local function _submit()
|
||||
local tickets=scene.widgetList.ticket:getText():upper()
|
||||
if #tickets~=128 then
|
||||
MES.new('error',text.wrongCode)
|
||||
else
|
||||
NET.codeLogin(USER.email,code)
|
||||
USER.aToken=tickets:sub(1,64)
|
||||
USER.oToken=tickets:sub(65)
|
||||
end
|
||||
end
|
||||
local function _paste()
|
||||
local t=love.system.getClipboardText()
|
||||
if t then
|
||||
t=STRING.trim(t)
|
||||
if #t==8 and t:match("[0-9]+") then
|
||||
scene.widgetList.code:setText(t)
|
||||
if #t==128 and t:match("[0-9A-Z]+") then
|
||||
scene.widgetList.ticket:setText(t)
|
||||
return
|
||||
end
|
||||
end
|
||||
MES.new('warn',text.wrongCode)
|
||||
MES.new('error',text.wrongCode)
|
||||
end
|
||||
|
||||
function scene.enter()
|
||||
scene.widgetList.email:setText(USER.email or "")
|
||||
scene.widgetList.code:clear()
|
||||
scene.widgetList.ticket:clear()
|
||||
end
|
||||
|
||||
function scene.keyDown(key,rep)
|
||||
if key=='escape' and not rep then
|
||||
SCN.back()
|
||||
elseif key=='return' or key=='kpenter' then
|
||||
if #scene.widgetList.code:getText():upper()==0 then
|
||||
_getCode()
|
||||
if #scene.widgetList.ticket:getText()==0 then
|
||||
_authorize()
|
||||
else
|
||||
_codeLogin()
|
||||
_submit()
|
||||
end
|
||||
elseif key=='v' and love.keyboard.isDown('lctrl','rctrl') then
|
||||
_paste()
|
||||
@@ -52,14 +46,12 @@ end
|
||||
|
||||
scene.widgetList={
|
||||
WIDGET.newText{name='title', x=80, y=50,font=70,align='L'},
|
||||
WIDGET.newButton{name='login_pw', x=1080,y=100,w=260,h=80,color='lY',code=function() SCN.swapTo('login_pw','swipeR') end},
|
||||
|
||||
WIDGET.newInputBox{name='email', x=380, y=200,w=626,h=60,limit=128},
|
||||
WIDGET.newKey{name='send', x=640, y=330,w=300,h=80,font=40,code=_getCode},
|
||||
WIDGET.newInputBox{name='ticket', x=280, y=200,w=730,h=320,font=30,regex="[0-9A-Z]",limit=128},
|
||||
|
||||
WIDGET.newInputBox{name='code', x=380, y=400,w=626,h=60,regex="[0-9a-zA-Z]",limit=8},
|
||||
WIDGET.newKey{name='verify', x=640, y=530,w=300,h=80,font=40,code=_codeLogin},
|
||||
WIDGET.newKey{name='paste', x=850, y=530,w=80,font=40,fText=CHAR.icon.import,code=_paste},
|
||||
WIDGET.newKey{name='authorize', x=430, y=640,w=300,h=80,font=40,code=_authorize},
|
||||
WIDGET.newKey{name='submit', x=755, y=640,w=300,h=80,font=40,code=_submit},
|
||||
WIDGET.newKey{name='paste', x=970, y=640,w=80,font=40,fText=CHAR.icon.import,code=_paste},
|
||||
|
||||
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=pressKey'escape'},
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ scene.widgetList={
|
||||
WIDGET.newButton{name='league',x=640, y=180,w=350,h=120,font=40,color='D',code=goScene'net_league'},
|
||||
WIDGET.newButton{name='ffa', x=640, y=360,w=350,h=120,font=40,color='D',code=function() MES.new('warn',text.notFinished)--[[NET.enterRoom({name='ffa'})]] end},
|
||||
WIDGET.newButton{name='rooms', x=640, y=540,w=350,h=120,font=40,code=goScene'net_rooms'},
|
||||
WIDGET.newButton{name='resetPW',x=680,y=40,w=180,h=60,color='dG',code=goScene'reset_password'},
|
||||
WIDGET.newButton{name='logout',x=880, y=40,w=180, h=60,color='dR',
|
||||
code=function()
|
||||
if tryBack() then
|
||||
|
||||
Reference in New Issue
Block a user