移除部分用不到的文本,注册请求发送后按钮会消失并弹出消息,整理代码
This commit is contained in:
@@ -75,7 +75,7 @@ function text:draw()
|
||||
end
|
||||
function WIDGET.newText(D)--name,x,y[,fText][,color][,font=30][,align='M'][,hideF][,hide]
|
||||
local _={
|
||||
name= D.name or "_",
|
||||
name= D.name or"_",
|
||||
x= D.x,
|
||||
y= D.y,
|
||||
|
||||
@@ -105,8 +105,8 @@ function image:draw()
|
||||
end
|
||||
function WIDGET.newImage(D)--name[,img(name)],x,y[,ang][,k][,hideF][,hide]
|
||||
local _={
|
||||
name= D.name or "_",
|
||||
img= D.img or D.name or "_",
|
||||
name= D.name or"_",
|
||||
img= D.img or D.name or"_",
|
||||
alpha= D.alpha,
|
||||
x= D.x,
|
||||
y= D.y,
|
||||
@@ -213,7 +213,7 @@ end
|
||||
function WIDGET.newButton(D)--name,x,y,w[,h][,fText][,color][,font=30][,sound=true][,align='M'][,edge=0],code[,hideF][,hide]
|
||||
if not D.h then D.h=D.w end
|
||||
local _={
|
||||
name= D.name or "_",
|
||||
name= D.name or"_",
|
||||
|
||||
x= D.x-D.w*.5,
|
||||
y= D.y-D.h*.5,
|
||||
@@ -308,7 +308,7 @@ end
|
||||
function WIDGET.newKey(D)--name,x,y,w[,h][,fText][,color][,font=30][,sound=true][,align='M'][,edge=0],code[,hideF][,hide]
|
||||
if not D.h then D.h=D.w end
|
||||
local _={
|
||||
name= D.name or "_",
|
||||
name= D.name or"_",
|
||||
|
||||
x= D.x-D.w*.5,
|
||||
y= D.y-D.h*.5,
|
||||
@@ -397,7 +397,7 @@ function switch:press()
|
||||
end
|
||||
function WIDGET.newSwitch(D)--name,x,y[,fText][,color][,font=30][,sound=true][,disp],code,hide
|
||||
local _={
|
||||
name= D.name or "_",
|
||||
name= D.name or"_",
|
||||
|
||||
x= D.x,
|
||||
y= D.y,
|
||||
@@ -552,7 +552,7 @@ function slider:arrowKey(isLeft)
|
||||
end
|
||||
function WIDGET.newSlider(D)--name,x,y,w[,fText][,color][,unit][,smooth][,font=30][,change],disp,code,hide
|
||||
local _={
|
||||
name= D.name or "_",
|
||||
name= D.name or"_",
|
||||
|
||||
x= D.x,
|
||||
y= D.y,
|
||||
@@ -718,7 +718,7 @@ function selector:arrowKey(isLeft)
|
||||
end
|
||||
function WIDGET.newSelector(D)--name,x,y,w[,fText][,color][,sound=true],list,disp,code,hide
|
||||
local _={
|
||||
name= D.name or "_",
|
||||
name= D.name or"_",
|
||||
|
||||
x= D.x-D.w*.5,
|
||||
y= D.y-30,
|
||||
@@ -851,7 +851,7 @@ function inputBox:keypress(k)
|
||||
end
|
||||
function WIDGET.newInputBox(D)--name,x,y,w[,h][,font=30][,secret][,regex],hide
|
||||
local _={
|
||||
name= D.name or "_",
|
||||
name= D.name or"_",
|
||||
|
||||
x= D.x,
|
||||
y= D.y,
|
||||
@@ -1000,7 +1000,7 @@ function textBox:getInfo()
|
||||
end
|
||||
function WIDGET.newTextBox(D)--name,x,y,w,h[,font=30][,lineH][,fix],hide
|
||||
local _={
|
||||
name= D.name or "_",
|
||||
name= D.name or"_",
|
||||
|
||||
resCtr={
|
||||
D.x+D.w*.5,D.y+D.h*.5,
|
||||
|
||||
@@ -83,20 +83,17 @@ return{
|
||||
wrongEmail="You entered an incorrect e-mail address.",
|
||||
noPassword="Please enter your password.",
|
||||
diffPassword="Passwords don't match.",
|
||||
registerRequestSent="Registration request sent",
|
||||
registerSuccessed="Registration succeeded!",
|
||||
registerFailed="Registration failed",
|
||||
loginSuccessed="You are now logged in!",
|
||||
loginFailed="Failed to log in.",
|
||||
accessSuccessed="Access Granted.",
|
||||
accessFailed="Access Denied.",
|
||||
|
||||
wsConnecting="Websocket: Connecting",
|
||||
wsFailed="WebSocket: Connection Failed",
|
||||
wsConnecting="Websocket Connecting",
|
||||
wsFailed="WebSocket Connection Failed",
|
||||
wsClose="WebSocket Closed: ",
|
||||
netTimeout="Network connection timeout",
|
||||
|
||||
onlinePlayerCount="Online",
|
||||
|
||||
createRoomSuccessed="Room successfully created!",
|
||||
started="Playing",
|
||||
joinRoom="has joined the room.",
|
||||
@@ -109,9 +106,6 @@ return{
|
||||
chatStart="------Beginning of log------",
|
||||
chatHistory="------New messages below------",
|
||||
|
||||
roomsCreateFailed="Failed to create room.",
|
||||
roomsFetchFailed="Failed to fetch room list.",
|
||||
|
||||
errorMsg="Techmino ran into a problem and needs to restart.\nYou can send the error log to the devs.",
|
||||
|
||||
modInstruction="Choose your modifiers!\nMods allow you to change the game.\nThey may also break it in weird ways.\nBeware, some mods will cause your game to be unranked!",
|
||||
@@ -644,6 +638,7 @@ return{
|
||||
password="Password",
|
||||
password2="Re-enter Password",
|
||||
register="Register",
|
||||
registering="Waiting for response...",
|
||||
},
|
||||
account={
|
||||
title="Account",
|
||||
|
||||
@@ -81,20 +81,17 @@ return{
|
||||
wrongEmail="Correo electrónico incorrecto",
|
||||
noPassword="Por favor ingresa una contraseña",
|
||||
diffPassword="Las contraseñas no coinciden",
|
||||
-- registerRequestSent="Registration request sent",
|
||||
registerSuccessed="¡Registro exitoso!",
|
||||
registerFailed="Registro fallido.",
|
||||
loginSuccessed="¡Ingreso con éxito!",
|
||||
loginFailed="Error al ingresar",
|
||||
accessSuccessed="¡Autorizado exitoso!",
|
||||
accessFailed="Error al autorizar",
|
||||
|
||||
wsConnecting="Websocket: Conectando",
|
||||
wsFailed="WebSocket: conexión fallida",
|
||||
wsConnecting="Websocket Conectando",
|
||||
wsFailed="WebSocket conexión fallida",
|
||||
wsClose="WebSocket cerrado: ",
|
||||
netTimeout="Tiempo de conexión agotado",
|
||||
|
||||
onlinePlayerCount="En línea",
|
||||
|
||||
createRoomSuccessed="¡Sala creada con éxito!",
|
||||
started="En juego",
|
||||
joinRoom="entró a la sala.",
|
||||
@@ -107,9 +104,6 @@ return{
|
||||
chatStart="------Comienzo del historial------",
|
||||
chatHistory="------Nuevos mensajes------",
|
||||
|
||||
roomsCreateFailed="Error al crear sala",
|
||||
roomsFetchFailed="Error al buscar salas",
|
||||
|
||||
errorMsg="Ha ocurrido un error y Techmino necesita reiniciarse.\nSe creó un registro de error, puedes enviarlo al autor.",
|
||||
|
||||
-- modInstruction="",
|
||||
@@ -552,6 +546,7 @@ return{
|
||||
password="Contraseña",
|
||||
password2="Repetir Contr.",
|
||||
register="Registrarse",
|
||||
-- registering="Waiting for response...",
|
||||
},
|
||||
account={
|
||||
title="Cuenta",
|
||||
|
||||
@@ -82,20 +82,17 @@ return{
|
||||
wrongEmail="Mauvaise adresse email",
|
||||
noPassword="Entrez votre mot de passe",
|
||||
diffPassword="Les mots de passe ne se correspondent pas",
|
||||
-- registerRequestSent="Registration request sent",
|
||||
registerSuccessed="Enregistré avec succès !",
|
||||
registerFailed="Erreur d'enregistrement",
|
||||
loginSuccessed="Connecté avec succès !",
|
||||
loginFailed="Erreur de connexion",
|
||||
accessSuccessed="Autorisé avec succès !",
|
||||
accessFailed="Autorisation échouée",
|
||||
|
||||
-- wsConnecting="Websocket: Connecting",
|
||||
wsFailed="WebSocket: connection échouée",
|
||||
-- wsConnecting="Websocket Connecting",
|
||||
wsFailed="WebSocket connection échouée",
|
||||
-- wsClose="WebSocket Closed: ",
|
||||
-- netTimeout="Network connection timeout",
|
||||
|
||||
-- onlinePlayerCount="Online",
|
||||
|
||||
createRoomSuccessed="Salon créé avec succès !",
|
||||
-- started="Playing",
|
||||
joinRoom="a rejoint le salon.",
|
||||
@@ -108,9 +105,6 @@ return{
|
||||
chatStart="--------Début des logs--------",
|
||||
chatHistory="-Nouveaux messages en dessous-",
|
||||
|
||||
roomsCreateFailed="Echec de la création du salon",
|
||||
roomsFetchFailed="Echec de la récupération des salons",
|
||||
|
||||
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.",
|
||||
|
||||
modInstruction="",
|
||||
@@ -552,6 +546,7 @@ return{
|
||||
password="Mot de passe",
|
||||
password2="Confirmer le mot de passe",
|
||||
register="Enregistrement",
|
||||
-- registering="Waiting for response...",
|
||||
},
|
||||
account={
|
||||
title="Compte",
|
||||
|
||||
@@ -82,20 +82,17 @@ return{
|
||||
wrongEmail="Endereço de email errado",
|
||||
noPassword="Insira sua senha ",
|
||||
diffPassword="Senhas não combinam",
|
||||
-- registerRequestSent="Registration request sent",
|
||||
registerSuccessed="Registrado com sucesso!",
|
||||
registerFailed="Falha ao registrar",
|
||||
loginSuccessed="Logado com sucesso!",
|
||||
loginFailed="Falha na autenticação",
|
||||
accessSuccessed="Autorizado com sucesso!",
|
||||
accessFailed="Falha na autorização",
|
||||
|
||||
-- wsConnecting="Websocket: Connecting",
|
||||
wsFailed="WebSocket: falha na conexão",
|
||||
-- wsConnecting="Websocket Connecting",
|
||||
wsFailed="WebSocket falha na conexão",
|
||||
wsClose="WebSocket closed: ",
|
||||
-- netTimeout="Network connection timeout",
|
||||
|
||||
-- onlinePlayerCount="Online",
|
||||
|
||||
-- createRoomSuccessed="Room successfully created!",
|
||||
-- started="Playing",
|
||||
joinRoom="Entrou a sala.",
|
||||
@@ -108,9 +105,6 @@ return{
|
||||
chatStart="------Começo do log------",
|
||||
chatHistory="------Novas mensagens abaixo------",
|
||||
|
||||
-- roomsCreateFailed="Failed to create room",
|
||||
roomsFetchFailed="Falha ao buscar salas",
|
||||
|
||||
errorMsg="Um erro ocorreu e Techmino precisa reiniciar.\nInformação do erro foi criada, e você pode mandar ao autor.",
|
||||
|
||||
modInstruction="Selecione mods (modificadores) para usar!\nMods irão modificar o jogo em formas diferentes\n(e possivelmente quebrar o jogo de formas estranhas).\nAlguns mods irão fazer seu jogo unranked.",
|
||||
@@ -640,6 +634,7 @@ return{
|
||||
password="Senha",
|
||||
password2="Entre Senha Novamente",
|
||||
register="Registrar",
|
||||
-- registering="Waiting for response...",
|
||||
},
|
||||
account={
|
||||
title="Conta",
|
||||
|
||||
@@ -450,6 +450,7 @@ return{
|
||||
password="*",
|
||||
password2="*",
|
||||
register="Sign up",
|
||||
registering="......",
|
||||
},
|
||||
account={
|
||||
title="@_@",
|
||||
|
||||
@@ -114,6 +114,7 @@ return{
|
||||
},
|
||||
register={
|
||||
password2="你懂的",
|
||||
registering="等",
|
||||
},
|
||||
sound={
|
||||
title="音效室",
|
||||
@@ -275,7 +276,7 @@ return{
|
||||
['tsd_e']= {"TSD挑战", "简单", "刷T2"},
|
||||
['tsd_h']= {"TSD挑战", "困难", "刷T2"},
|
||||
['tsd_u']= {"TSD挑战", "极限", "刷T2"},
|
||||
['backfire_n']= {"自攻自受", "普通", "200攻击很少的,冲冲冲"},
|
||||
['backfire_n']= {"自攻自受", "普通", "100攻击很少的,冲冲冲"},
|
||||
['backfire_h']= {"自攻自受", "困难", "你在害怕什么"},
|
||||
['backfire_l']= {"自攻自受", "疯狂", "别怂啊,打攻击呀"},
|
||||
['backfire_u']= {"自攻自受", "极限", "能把自己玩死,不会吧"},
|
||||
|
||||
@@ -83,12 +83,10 @@ return{
|
||||
wrongEmail="邮箱格式错误",
|
||||
noPassword="请填写密码",
|
||||
diffPassword="两次密码不一致",
|
||||
registerRequestSent="注册请求已发送",
|
||||
registerSuccessed="注册成功!",
|
||||
registerFailed="注册失败",
|
||||
loginSuccessed="登录成功",
|
||||
loginFailed="登录失败",
|
||||
accessSuccessed="身份验证成功",
|
||||
accessFailed="身份验证失败",
|
||||
|
||||
wsConnecting="正在连接",
|
||||
wsFailed="连接失败",
|
||||
@@ -96,7 +94,6 @@ return{
|
||||
netTimeout="连接超时",
|
||||
|
||||
onlinePlayerCount="在线人数",
|
||||
|
||||
createRoomSuccessed="创建房间成功!",
|
||||
started="游戏中",
|
||||
joinRoom="进入房间",
|
||||
@@ -109,9 +106,6 @@ return{
|
||||
chatStart="------消息的开头------",
|
||||
chatHistory="------以上是历史消息------",
|
||||
|
||||
roomsCreateFailed="创建房间失败",
|
||||
roomsFetchFailed="拉取房间列表失败",
|
||||
|
||||
errorMsg="Techmino遭受了雷击,需要重新启动.\n我们已收集了一些错误信息,你可以向作者进行反馈.",
|
||||
|
||||
modInstruction="选择你要使用的Mod!\n不同Mod会用不同的方式改变初始游戏规则(可能导致不能正常游玩)\n来开发新玩法或者挑战自我吧!\n提醒:开启一些Mod会让成绩无效,你也可以用键盘开关Mod,按住shift反向",
|
||||
@@ -642,6 +636,7 @@ return{
|
||||
password="密码",
|
||||
password2="确认密码",
|
||||
register="注册",
|
||||
registering="等待服务器响应...",
|
||||
},
|
||||
account={
|
||||
title="账户",
|
||||
|
||||
@@ -78,7 +78,7 @@ local function _parse(res)
|
||||
if mesType[res.type]then
|
||||
return res
|
||||
else
|
||||
MES.new(
|
||||
MES.new('warn',
|
||||
"Error ws-mes type:"..(
|
||||
res.type and(
|
||||
res.reason and
|
||||
@@ -87,8 +87,8 @@ local function _parse(res)
|
||||
res.type
|
||||
)or
|
||||
"[NO Message]"
|
||||
),
|
||||
'warn')
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -208,6 +208,7 @@ function NET.register(username,email,password)
|
||||
password=password,
|
||||
}
|
||||
})
|
||||
MES.new('info',text.registerRequestSent)
|
||||
end
|
||||
end
|
||||
function NET.tryLogin(ifAuto)
|
||||
|
||||
@@ -24,7 +24,10 @@ scene.widgetList={
|
||||
WIDGET.newInputBox{name="email", x=380, y=300,w=626,h=60},
|
||||
WIDGET.newInputBox{name="password", x=380, y=400,w=626,h=60,secret=true,regex="[ -~]"},
|
||||
WIDGET.newInputBox{name="password2",x=380, y=500,w=626,h=60,secret=true,regex="[ -~]"},
|
||||
WIDGET.newKey{name="register", x=1140, y=540,w=170,h=80,font=40,code=register},
|
||||
|
||||
WIDGET.newKey{name="register", x=640, y=640,w=300,h=80,font=40,code=register,hideF=function()return NET.getlock('register')end},
|
||||
WIDGET.newText{name="registering", x=640, y=605,font=50,hideF=function()return not NET.getlock('register')end},
|
||||
|
||||
WIDGET.newButton{name="back", x=1140, y=640,w=170,h=80,fText=TEXTURE.back,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user