diff --git a/LANG/lang_en.lua b/LANG/lang_en.lua index 3f026ce4..63c590be 100644 --- a/LANG/lang_en.lua +++ b/LANG/lang_en.lua @@ -50,12 +50,15 @@ return{ ranks={"D","C","B","A","S"}, needRestart="Effective after restart", + exportSuccess="Export successfully", importSuccess="Import successfully", dataCorrupted="Data corrupted", + VKTchW="Touch Weight", VKOrgW="Origin Weight", VKCurW="Cur. Pos. Weight", + noScore="No Scores Yet", highScore="Personal Bests", newRecord="New Record!", @@ -64,14 +67,18 @@ return{ getVersionFail="Unable to detect a new version", versionIsNew="You are now on the latest version.", versionIsOld="Version $1 is available now!", - registerSuccessed="Registration successed!", - registerFailed="Registration failed", + netErrorCode="Network error code", jsonError="Json error", + noUsername="Please enter your username", + wrongCode="Please enter invitation code", wrongEmail="Wrong email address", noPassword="Please enter your password", diffPassword="Passwords don't match", + registerSuccessed="Registration successed!", + registerFailed="Registration failed", + errorMsg="An error has occurred and Techmino needs to restart.\nError info has been created, and you can send it to the author.", acts={ diff --git a/LANG/lang_fr.lua b/LANG/lang_fr.lua index 9889213a..d762d36f 100644 --- a/LANG/lang_fr.lua +++ b/LANG/lang_fr.lua @@ -52,25 +52,35 @@ return{ getRank="Rang: ", needRestart="Fonctionnera dès la prochaine partie", + -- exportSuccess="Export successfully", -- importSuccess="Import successfully", dataCorrupted="Données corrompues", + VKTchW="Poids du toucher", VKOrgW="Pois d'origine", VKCurW="Pois de la pos. du cur.", + noScore="Aucun score", highScore="Records personnels", newRecord="Nouveau record !", + getNoticeFail="Echec de l'obtention de la notice", getVersionFail="Echec d'obtention de la dernière version", versionIsNew="Vous êtes sur la dernière version", versionIsOld="La version $1 est disponible !", - registerSuccessed="Enregistré avec succès !", - registerFailed="Erreur d'enregistrement", + netErrorCode="Code d'erreur réseau", + -- jsonError="Json error", + noUsername="Entrez votre nom d'utilisateur", + -- wrongCode="Please enter invitation code", + -- wrongEmail="Wrong email address", noPassword="Entrez votre mot de passe", diffPassword="Les mots de passe ne se correspondent pas", + registerSuccessed="Enregistré avec succès !", + registerFailed="Erreur d'enregistrement", + errorMsg="Une erreur est survenue et Techmino doit redémarrer.\nDes informations concernant l'erreur ont été créées, et vous pouvez les envoyer au créateur.", acts={ diff --git a/LANG/lang_sp.lua b/LANG/lang_sp.lua index 9acd3f84..f637af1e 100644 --- a/LANG/lang_sp.lua +++ b/LANG/lang_sp.lua @@ -52,25 +52,36 @@ return{ getRank="Rango obtenido:", needRestart="Reinicia Techmino para que los cambios tengan efecto.", + -- exportSuccess="Export successfully", -- importSuccess="Import successfully", dataCorrupted="Los datos están corruptos.", + VKTchW="Sens. al toque", VKOrgW="Sens. al origen", VKCurW="Sens. Cur. Pos.", + noScore="Sin puntajes aún.", highScore="Mejores puntajes", newRecord="¡Nuevo Récord!", + getNoticeFail="Error al buscar novedades.", getVersionFail="Error al buscar nuevas versiones.", versionIsNew="Esta es la versión más reciente disponible.", versionIsOld="¡Está disponible la nueva versión $1!", - registerSuccessed="¡Registro exitoso!", - registerFailed="Registro fallido.", + netErrorCode="Código de error de conexión", + -- jsonError="Json error", + noUsername="Por favor ingresa un nombre de usuario", + + -- wrongCode="Please enter invitation code", + -- wrongEmail="Wrong email address", noPassword="Por favor ingresa una contraseña", diffPassword="Las contraseñas no coinciden", + registerSuccessed="¡Registro exitoso!", + registerFailed="Registro fallido.", + errorMsg="Ha ocurrido un error y Techmino necesita reiniciarse.\nSe creó un registro de error, puedes enviarlo al autor.", acts={ diff --git a/LANG/lang_yygq.lua b/LANG/lang_yygq.lua index c0321a3e..37088c26 100644 --- a/LANG/lang_yygq.lua +++ b/LANG/lang_yygq.lua @@ -25,10 +25,11 @@ return{ finesse_ap="您", finesse_fc="全连", - noUsername="账号填不来?", - wrongEmail="邮箱不会填?", - noPassword="密码填不来?", - diffPassword="账号密码都填不来?", + noUsername="别闹。", + wrongCode="有人邀请你注册了?", + wrongEmail="别乱输。", + noPassword="注册会不会?", + diffPassword="字不认识?", ranks={"菜","可","好","强","您"}, diff --git a/LANG/lang_zh.lua b/LANG/lang_zh.lua index 723e2e3b..79be2be6 100644 --- a/LANG/lang_zh.lua +++ b/LANG/lang_zh.lua @@ -51,27 +51,35 @@ return{ ranks={"D","C","B","A","S"}, needRestart="重新开始以生效", + exportSuccess="导出成功", importSuccess="导入成功", dataCorrupted="数据损坏", + VKTchW="触摸点权重", VKOrgW="原始点权重", VKCurW="当前点权重", + noScore="暂无成绩", highScore="最佳成绩", newRecord="打破纪录", + getNoticeFail="拉取公告失败", getVersionFail="检测新版本失败", versionIsNew="游戏已是最新版本", versionIsOld="最新版本$1可以下载了!", - registerSuccessed="注册成功!", - registerFailed="注册失败", + netErrorCode="网络错误码", jsonError="json错误", + noUsername="请填写用户名", + wrongCode="请填写邀请码", wrongEmail="邮箱格式错误", noPassword="请填写密码", diffPassword="两次密码不一致", + registerSuccessed="注册成功!", + registerFailed="注册失败", + errorMsg="Techmino遭受了雷击,需要重新启动.\n我们已收集了一些错误信息,你可以向作者进行反馈.", acts={ diff --git a/parts/scenes/login.lua b/parts/scenes/login.lua index d3ccd5ea..0e763db5 100644 --- a/parts/scenes/login.lua +++ b/parts/scenes/login.lua @@ -7,24 +7,27 @@ function keyDown.login(key) local password2=WIDGET.active.password2.value if #username==0 then LOG.print(text.noUsername)return - elseif not email:match("^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$")then + elseif not email:match("^[a-zA-Z0-9_]+@[a-zA-Z0-9_-]+%.[a-zA-Z0-9_]+$")then LOG.print(text.wrongEmail)return + elseif #code~=12 then + LOG.print(text.wrongCode)return elseif #password==0 or #password2==0 then LOG.print(text.noPassword)return elseif password~=password2 then LOG.print(text.diffPassword)return end + local data=urlencode.encode({ + username=username, + email=email, + password=password, + code=code, + }) httpRequest( TICK.httpREQ_register, "api/account/register", "POST", - {["Content-Type"]="application/json"}, - json.encode({ - username=username, - email=email, - password=password, - code=code, - }) + {["Content-Type"]="application/x-www-form-urlencoded"}, + data ) elseif key=="escape"then SCN.back() diff --git a/parts/scenes/main.lua b/parts/scenes/main.lua index 257d556f..c6c36b9e 100644 --- a/parts/scenes/main.lua +++ b/parts/scenes/main.lua @@ -35,7 +35,7 @@ end WIDGET.init("main",{ WIDGET.newButton({name="offline", x=150,y=220,w=200,h=140,color="lRed", font=40,code=WIDGET.lnk.goScene("mode")}), - WIDGET.newButton({name="online", x=370,y=220,w=200,h=140,color="lCyan", font=40,code=WIDGET.lnk.goScene(LOGIN and"netgame"or"login"),hide=function()return not LOGIN end}), + WIDGET.newButton({name="online", x=370,y=220,w=200,h=140,color="lCyan", font=40,code=WIDGET.lnk.goScene(LOGIN and"netgame"or"login")}), WIDGET.newButton({name="custom", x=590,y=220,w=200,h=140,color="lBlue", font=45,code=WIDGET.lnk.goScene("customGame"),hide=function()return not RANKS.marathon_normal end}), WIDGET.newButton({name="setting", x=150,y=380,w=200,h=140,color="lOrange",font=40,code=WIDGET.lnk.goScene("setting_game")}), WIDGET.newButton({name="stat", x=370,y=380,w=200,h=140,color="lGreen", font=35,code=WIDGET.lnk.goScene("stat")}),