From a7435eb844954cad13f64aebc3d3c4d7ea6e4086 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Fri, 23 Oct 2020 23:57:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=8E=92=E7=89=88=EF=BC=8C=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E9=87=8D=E5=8F=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/widgetList.lua | 30 ++++++++++++----------- parts/scenes.lua | 50 +++++++++++++++++++-------------------- 2 files changed, 41 insertions(+), 39 deletions(-) diff --git a/Zframework/widgetList.lua b/Zframework/widgetList.lua index a138a54f..4dbafeb2 100644 --- a/Zframework/widgetList.lua +++ b/Zframework/widgetList.lua @@ -182,8 +182,8 @@ local Widgets={ newButton({name="back", x=1140, y=640,w=170,h=80, font=40,code=BACK}), }, customGame={ - newText({name="title", x=600,y=5,font=80,align="R"}), - newText({name="subTitle", x=610,y=50,font=35,align="L",color="grey"}), + newText({name="title", x=520,y=5,font=70,align="R"}), + newText({name="subTitle", x=530,y=50,font=35,align="L",color="grey"}), newText({name="defSeq", x=330,y=550,align="L",color="grey",hide=function()return BAG[1]end}), newText({name="noMsn", x=610,y=550,align="L",color="grey",hide=function()return MISSION[1]end}), @@ -212,8 +212,8 @@ local Widgets={ newButton({name="back", x=1140, y=640, w=170,h=80,font=40,code=BACK}), }, custom_advance={ - newText({name="title", x=600,y=5,font=80,align="R"}), - newText({name="subTitle", x=610,y=50,font=35,align="L",color="grey"}), + newText({name="title", x=520,y=5,font=70,align="R"}), + newText({name="subTitle", x=530,y=50,font=35,align="L",color="grey"}), --Visual newSwitch({name="block", x=620, y=430, font=25, disp=CUSval("block"), code=CUSrev("block")}), @@ -249,8 +249,8 @@ local Widgets={ newButton({name="back", x=1140, y=640, w=170,h=80, font=40,code=BACK}), }, custom_field={ - newText({name="title", x=1100,y=5,font=80,align="R"}), - newText({name="subTitle", x=1110,y=50,font=35,align="L",color="grey"}), + newText({name="title", x=1020,y=5,font=70,align="R"}), + newText({name="subTitle", x=1030,y=50,font=35,align="L",color="grey"}), newButton({name="b1", x=500+65*1, y=200, w=58, color="red", code=setPen(1)}),--B1 newButton({name="b2", x=500+65*2, y=200, w=58, color="orange", code=setPen(2)}),--B2 @@ -283,8 +283,8 @@ local Widgets={ newButton({name="back", x=1140, y=640, w=170,h=80, font=40,code=BACK}), }, custom_sequence={ - newText({name="title", x=600,y=5,font=80,align="R"}), - newText({name="subTitle", x=610,y=50,font=35,align="L",color="grey"}), + newText({name="title", x=520,y=5,font=70,align="R"}), + newText({name="subTitle", x=530,y=50,font=35,align="L",color="grey"}), newSelector({name="sequence",x=1080,y=60, w=200, color="yellow",list=CUSlist.sequence,disp=CUSval("sequence"),code=CUSsto("sequence")}), @@ -326,8 +326,8 @@ local Widgets={ newButton({name="back", x=1140, y=640, w=170,h=80, font=40,code=BACK}), }, custom_mission={ - newText({name="title", x=600,y=5,font=80,align="R"}), - newText({name="subTitle", x=610,y=50,font=35,align="L",color="grey"}), + newText({name="title", x=520,y=5,font=70,align="R"}), + newText({name="subTitle", x=530,y=50,font=35,align="L",color="grey"}), newKey({name="_1", x=800, y=540, w=90, font=50,code=pressKey(01)}), newKey({name="_2", x=900, y=540, w=90, font=50,code=pressKey(02)}), @@ -667,14 +667,16 @@ local Widgets={ }, login={ newText({name="title", x=80,y=50,font=70,align="L"}), - newTextBox({name="username",x=400,y=200,w=500,h=60}), - newTextBox({name="email", x=400,y=300,w=626,h=60}), - newTextBox({name="password",x=400,y=400,w=626,h=60,secret=true,regex="[ -~]"}), - newTextBox({name="password2",x=400,y=500,w=626,h=60,secret=true,regex="[ -~]"}), + newTextBox({name="username",x=380,y=160,w=500,h=60,regex="[0-9A-Za-z_-=+'.<>/{}*]"}), + newTextBox({name="email", x=380,y=260,w=626,h=60,regex="[0-9A-Za-z_@]"}), + newTextBox({name="code", x=380,y=360,w=626,h=60,regex="[0-9A-Za-z]"}), + newTextBox({name="password",x=380,y=460,w=626,h=60,secret=true,regex="[ -~]"}), + newTextBox({name="password2",x=380,y=560,w=626,h=60,secret=true,regex="[ -~]"}), newButton({name="back", x=1140, y=640,w=170,h=80,font=40,code=BACK}), }, account={ newText({name="title", x=80,y=50,font=70,align="L"}), + newButton({name="back", x=1140, y=640,w=170,h=80,font=40,code=BACK}), }, minigame={ newButton({name="p15", x=240, y=250,w=350,h=120,font=40,code=goScene("p15")}), diff --git a/parts/scenes.lua b/parts/scenes.lua index 8276baa9..4c7de8b6 100644 --- a/parts/scenes.lua +++ b/parts/scenes.lua @@ -849,7 +849,7 @@ do--customGame --Sequence setFont(30) - gc.printf(customEnv.sequence,330,550,240,"right") + gc.print(customEnv.sequence,330,510) setFont(40) if #BAG>0 then gc.setColor(1,1,int(Timer()*6.26)%2) @@ -2772,30 +2772,30 @@ end do--login function keyDown.login(key) if key=="return"then - LOG.print("敬请期待!") - LOG.print("Coming Soon!") - -- local user= WIDGET.active.username.value - -- local email=WIDGET.active.email.value - -- local pw= WIDGET.active.password.value - -- local pw2= WIDGET.active.password2.value - -- if #user==0 then - -- LOG.print(text.noUsername)return - -- elseif #pw==0 or #pw2==0 then - -- LOG.print(text.noPassword)return - -- elseif pw~=pw2 then - -- LOG.print(text.diffPassword)return - -- end - -- httpRequest( - -- TICK.httpREQ_register, - -- "api/register", - -- "POST", - -- {["Content-Type"]="application/json"}, - -- json.encode({ - -- user=user, - -- email=email, - -- password=pw, - -- }) - -- ) + local username= WIDGET.active.username.value + local email= WIDGET.active.email.value + local code= WIDGET.active.code.value + local password= WIDGET.active.password.value + local password2=WIDGET.active.password2.value + if #username==0 then + LOG.print(text.noUsername)return + elseif #password==0 or #password2==0 then + LOG.print(text.noPassword)return + elseif password~=password2 then + LOG.print(text.diffPassword)return + end + httpRequest( + TICK.httpREQ_register, + "api/account/register", + "POST", + {["Content-Type"]="application/json"}, + json.encode({ + username=username, + email=email, + password=password, + code=code, + }) + ) elseif key=="escape"then SCN.back() else