From da602eb693e6cda45477b98489bc8ce3f9391508 Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Fri, 4 Nov 2022 16:45:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E8=BE=93=E5=85=A5=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A0=81=E7=9A=84=E5=9C=B0=E6=96=B9=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=B2=98=E8=B4=B4=E6=8C=89=E9=92=AE=20=E6=95=B4=E7=90=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework | 2 +- parts/gameFuncs.lua | 2 +- parts/modes/techmino49_e.lua | 2 +- parts/modes/techmino49_h.lua | 2 +- parts/modes/techmino49_u.lua | 2 +- parts/modes/techmino99_e.lua | 2 +- parts/modes/techmino99_h.lua | 2 +- parts/modes/techmino99_u.lua | 2 +- parts/scenes/app_console.lua | 2 +- parts/scenes/load.lua | 2 +- parts/scenes/login_mail.lua | 17 +++++++++++++++-- parts/scenes/reset_password.lua | 17 ++++++++++++++++- 12 files changed, 41 insertions(+), 13 deletions(-) diff --git a/Zframework b/Zframework index 24864eda..8a56f3f9 160000 --- a/Zframework +++ b/Zframework @@ -1 +1 @@ -Subproject commit 24864eda21356f03acebb8f0da4b74738b54684a +Subproject commit 8a56f3f9b0a2d7f73aff664138d3a987defb6c03 diff --git a/parts/gameFuncs.lua b/parts/gameFuncs.lua index 387f71fc..9578a35f 100644 --- a/parts/gameFuncs.lua +++ b/parts/gameFuncs.lua @@ -51,7 +51,7 @@ do-- function tryDelete() end end do-- function loadFile(name,args), function saveFile(data,name,args) - local t=setmetatable({},{__index=function() return"'$1' loading failed: $2" end}) + local t=setmetatable({},{__index=function() return "'$1' loading failed: $2" end}) function loadFile(name,args) local text=text or t if not args then args='' end diff --git a/parts/modes/techmino49_e.lua b/parts/modes/techmino49_e.lua index c9eafdc7..4910c710 100644 --- a/parts/modes/techmino49_e.lua +++ b/parts/modes/techmino49_e.lua @@ -40,7 +40,7 @@ return { end end end, score=function(P) return {P.modeData.place,P.modeData.ko} end, - scoreDisp=function(D) return"NO."..D[1].." KO:"..D[2] end, + scoreDisp=function(D) return "NO."..D[1].." KO:"..D[2] end, comp=function(a,b) return a[1]b[2] end, getRank=function(P) local R=P.modeData.place diff --git a/parts/modes/techmino49_h.lua b/parts/modes/techmino49_h.lua index 639797f8..736d97e4 100644 --- a/parts/modes/techmino49_h.lua +++ b/parts/modes/techmino49_h.lua @@ -40,7 +40,7 @@ return { end end end, score=function(P) return {P.modeData.place,P.modeData.ko} end, - scoreDisp=function(D) return"NO."..D[1].." KO:"..D[2] end, + scoreDisp=function(D) return "NO."..D[1].." KO:"..D[2] end, comp=function(a,b) return a[1]b[2] end, getRank=function(P) local R=P.modeData.place diff --git a/parts/modes/techmino49_u.lua b/parts/modes/techmino49_u.lua index 6667d753..436e9a4e 100644 --- a/parts/modes/techmino49_u.lua +++ b/parts/modes/techmino49_u.lua @@ -40,7 +40,7 @@ return { end end end, score=function(P) return {P.modeData.place,P.modeData.ko} end, - scoreDisp=function(D) return"NO."..D[1].." KO:"..D[2] end, + scoreDisp=function(D) return "NO."..D[1].." KO:"..D[2] end, comp=function(a,b) return a[1]b[2] end, getRank=function(P) local R=P.modeData.place diff --git a/parts/modes/techmino99_e.lua b/parts/modes/techmino99_e.lua index d3112235..ac439bbe 100644 --- a/parts/modes/techmino99_e.lua +++ b/parts/modes/techmino99_e.lua @@ -40,7 +40,7 @@ return { end end end, score=function(P) return {P.modeData.place,P.modeData.ko} end, - scoreDisp=function(D) return"NO."..D[1].." KO:"..D[2] end, + scoreDisp=function(D) return "NO."..D[1].." KO:"..D[2] end, comp=function(a,b) return a[1]b[2] end, getRank=function(P) local R=P.modeData.place diff --git a/parts/modes/techmino99_h.lua b/parts/modes/techmino99_h.lua index 1c3b7853..3df1a156 100644 --- a/parts/modes/techmino99_h.lua +++ b/parts/modes/techmino99_h.lua @@ -40,7 +40,7 @@ return { end end end, score=function(P) return {P.modeData.place,P.modeData.ko} end, - scoreDisp=function(D) return"NO."..D[1].." KO:"..D[2] end, + scoreDisp=function(D) return "NO."..D[1].." KO:"..D[2] end, comp=function(a,b) return a[1]b[2] end, getRank=function(P) local R=P.modeData.place diff --git a/parts/modes/techmino99_u.lua b/parts/modes/techmino99_u.lua index 7b3934db..4e4e43b6 100644 --- a/parts/modes/techmino99_u.lua +++ b/parts/modes/techmino99_u.lua @@ -40,7 +40,7 @@ return { end end end, score=function(P) return {P.modeData.place,P.modeData.ko} end, - scoreDisp=function(D) return"NO."..D[1].." KO:"..D[2] end, + scoreDisp=function(D) return "NO."..D[1].." KO:"..D[2] end, comp=function(a,b) return a[1]b[2] end, getRank=function(P) local R=P.modeData.place diff --git a/parts/scenes/app_console.lua b/parts/scenes/app_console.lua index c4e1c378..00ec2cf4 100644 --- a/parts/scenes/app_console.lua +++ b/parts/scenes/app_console.lua @@ -1000,7 +1000,7 @@ local fleg={ pw=the_secret, supw=7126, second_box="Coming soon", -}setmetatable(fleg,{__tostring=function() return"The fl\97g." end}) +}setmetatable(fleg,{__tostring=function() return "The fl\97g." end}) function userG.the_box(k) if k~=first_key then log"Usage:"log"*The box is locked*" diff --git a/parts/scenes/load.lua b/parts/scenes/load.lua index 755b5fc2..1a9b40b7 100644 --- a/parts/scenes/load.lua +++ b/parts/scenes/load.lua @@ -107,7 +107,7 @@ local loadingThread=coroutine.wrap(function() LOADED=true saveStats() Z.setPowerInfo(SETTING.powerInfo) - return'finish' + return 'finish' end) function scene.sceneInit() diff --git a/parts/scenes/login_mail.lua b/parts/scenes/login_mail.lua index 5cfce5f4..f09d651e 100644 --- a/parts/scenes/login_mail.lua +++ b/parts/scenes/login_mail.lua @@ -9,7 +9,6 @@ local function _getCode() NET.getCode(email) end end - local function _codeLogin() local code=scene.widgetList.code:getText():upper() if #code~=8 then @@ -18,6 +17,17 @@ local function _codeLogin() NET.codeLogin(USER.email,code) 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) + return + end + end + MES.new('warn',text.wrongCode) +end function scene.sceneInit() scene.widgetList.email:setText(USER.email or "") @@ -33,6 +43,8 @@ function scene.keyDown(key,rep) else _codeLogin() end + elseif key=='v' and love.keyboard.isDown('lctrl','rctrl') then + _paste() else return true end @@ -45,8 +57,9 @@ scene.widgetList={ 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='code', x=380, y=400,w=626 ,h=60,limit=8}, + 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.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=pressKey'escape'}, } diff --git a/parts/scenes/reset_password.lua b/parts/scenes/reset_password.lua index 854e6a3b..7923b56a 100644 --- a/parts/scenes/reset_password.lua +++ b/parts/scenes/reset_password.lua @@ -14,6 +14,17 @@ local function _setPW() NET.setPW(code,password) 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) + return + end + end + MES.new('warn',text.wrongCode) +end function scene.enter() if SCN.args[1] then @@ -29,6 +40,8 @@ function scene.keyDown(key,rep) else _setPW() end + elseif key=='v' and love.keyboard.isDown('lctrl','rctrl') then + _paste() else return true end @@ -37,11 +50,13 @@ end scene.widgetList={ WIDGET.newText{name='title', x=80, y=50,font=70,align='L'}, + WIDGET.newInputBox{name='code', x=380, y=170,w=626,h=60,regex="[0-9a-zA-Z]",limit=8}, WIDGET.newKey{name='send', x=640, y=300,w=300,h=80,font=40,code=function() NET.getCode(USER.email) end}, - WIDGET.newInputBox{name='code', x=380, y=170,w=626,h=60,limit=8}, + WIDGET.newInputBox{name='password', x=380, y=370,w=626,h=60,secret=true,regex="[ -~]",limit=64}, WIDGET.newInputBox{name='password2',x=380, y=470,w=626,h=60,secret=true,regex="[ -~]",limit=64}, WIDGET.newKey{name='setPW', x=640, y=600,w=350,h=80,font=40,code=_setPW}, + WIDGET.newKey{name='paste', x=850, y=300,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'}, }