主菜单按钮行为更容易理解,添加连接音效和连接成功音效
This commit is contained in:
BIN
media/SFX/connect.ogg
Normal file
BIN
media/SFX/connect.ogg
Normal file
Binary file not shown.
BIN
media/SFX/connected.ogg
Normal file
BIN
media/SFX/connected.ogg
Normal file
Binary file not shown.
@@ -78,7 +78,6 @@ return{
|
|||||||
getVersionFail="Update detection failed",
|
getVersionFail="Update detection failed",
|
||||||
oldVersion="Version $1 is now available!",
|
oldVersion="Version $1 is now available!",
|
||||||
needUpdate="Newer version required!",
|
needUpdate="Newer version required!",
|
||||||
noInternet="Not connected to the network",
|
|
||||||
notFinished="Coming soon!",
|
notFinished="Coming soon!",
|
||||||
|
|
||||||
jsonError="JSON error",
|
jsonError="JSON error",
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ return{
|
|||||||
getVersionFail="Echec d'obtention de la dernière version",
|
getVersionFail="Echec d'obtention de la dernière version",
|
||||||
oldVersion="La version $1 est disponible !",
|
oldVersion="La version $1 est disponible !",
|
||||||
-- needUpdate="Newer version required!",
|
-- needUpdate="Newer version required!",
|
||||||
-- noInternet="Not connected to the network",
|
|
||||||
-- notFinished="Coming soon!",
|
-- notFinished="Coming soon!",
|
||||||
|
|
||||||
jsonError="Erreur json",
|
jsonError="Erreur json",
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ return{
|
|||||||
getVersionFail="Falha ao detectar uma versão nova",
|
getVersionFail="Falha ao detectar uma versão nova",
|
||||||
oldVersion="Versão $1 esta disponível agora!",
|
oldVersion="Versão $1 esta disponível agora!",
|
||||||
-- needUpdate="Newer version required!",
|
-- needUpdate="Newer version required!",
|
||||||
-- noInternet="Not connected to the network",
|
|
||||||
-- notFinished="Coming soon!",
|
-- notFinished="Coming soon!",
|
||||||
|
|
||||||
jsonError="Json error",
|
jsonError="Json error",
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ return{
|
|||||||
getVersionFail="Error al buscar nuevas versiones.",
|
getVersionFail="Error al buscar nuevas versiones.",
|
||||||
oldVersion="¡Está disponible la nueva versión $1!",
|
oldVersion="¡Está disponible la nueva versión $1!",
|
||||||
needUpdate="¡Nueva versión requerida!",
|
needUpdate="¡Nueva versión requerida!",
|
||||||
-- noInternet="Not connected to the network",
|
|
||||||
notFinished="Próximamente",
|
notFinished="Próximamente",
|
||||||
|
|
||||||
jsonError="Error en Json",
|
jsonError="Error en Json",
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ return{
|
|||||||
getVersionFail="检测新版本失败",
|
getVersionFail="检测新版本失败",
|
||||||
oldVersion="最新版本$1可以下载了!",
|
oldVersion="最新版本$1可以下载了!",
|
||||||
needUpdate="请更新游戏!",
|
needUpdate="请更新游戏!",
|
||||||
noInternet="还未连接到网络",
|
|
||||||
notFinished="暂未完成,敬请期待!",
|
notFinished="暂未完成,敬请期待!",
|
||||||
|
|
||||||
jsonError="json错误",
|
jsonError="json错误",
|
||||||
|
|||||||
@@ -162,6 +162,18 @@ function NET.register(username,email,password)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
function NET.tryLogin(ifAuto)
|
||||||
|
if NET.allow_online then
|
||||||
|
if WS.status('user')=='running'then
|
||||||
|
NET.getAccessToken()
|
||||||
|
elseif not ifAuto then
|
||||||
|
SCN.go('login')
|
||||||
|
end
|
||||||
|
else
|
||||||
|
TEXT.show(text.needUpdate,640,450,60,'flicker')
|
||||||
|
SFX.play('finesseError')
|
||||||
|
end
|
||||||
|
end
|
||||||
function NET.pong(wsName,message)
|
function NET.pong(wsName,message)
|
||||||
WS.send(wsName,type(message)=='string'and message or"",'pong')
|
WS.send(wsName,type(message)=='string'and message or"",'pong')
|
||||||
end
|
end
|
||||||
@@ -296,12 +308,15 @@ function NET.updateWS_app()
|
|||||||
NET.allow_online=true
|
NET.allow_online=true
|
||||||
if USER.authToken then
|
if USER.authToken then
|
||||||
NET.wsconn_user_token(USER.uid,USER.authToken)
|
NET.wsconn_user_token(USER.uid,USER.authToken)
|
||||||
|
else
|
||||||
|
SCN.go('login')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if VERSION.code<res.newestCode then
|
if VERSION.code<res.newestCode then
|
||||||
LOG.print(text.oldVersion:gsub("$1",res.newestName),180,'message')
|
LOG.print(text.oldVersion:gsub("$1",res.newestName),180,'message')
|
||||||
end
|
end
|
||||||
LOG.print(res.notice,300,'message')
|
LOG.print(res.notice,300,'message')
|
||||||
|
NET.tryLogin(true)
|
||||||
elseif res.action==0 then--Get new version info
|
elseif res.action==0 then--Get new version info
|
||||||
--?
|
--?
|
||||||
elseif res.action==1 then--Get notice
|
elseif res.action==1 then--Get notice
|
||||||
@@ -361,6 +376,7 @@ function NET.updateWS_user()
|
|||||||
NET.accessToken=res.accessToken
|
NET.accessToken=res.accessToken
|
||||||
LOG.print(text.accessSuccessed,'message')
|
LOG.print(text.accessSuccessed,'message')
|
||||||
NET.wsconn_play()
|
NET.wsconn_play()
|
||||||
|
SFX.play('connected')
|
||||||
elseif res.action==1 then--Get userInfo
|
elseif res.action==1 then--Get userInfo
|
||||||
USERS.updateUserData(res.data)
|
USERS.updateUserData(res.data)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -64,21 +64,11 @@ function scene.keyDown(key)
|
|||||||
elseif key=="a"then
|
elseif key=="a"then
|
||||||
if testButton(3)then
|
if testButton(3)then
|
||||||
if NET.connected then
|
if NET.connected then
|
||||||
if NET.allow_online then
|
NET.tryLogin(false)
|
||||||
if WS.status('user')=='running'then
|
|
||||||
NET.getAccessToken()
|
|
||||||
else
|
|
||||||
SCN.go('login')
|
|
||||||
end
|
|
||||||
else
|
|
||||||
TEXT.show(text.needUpdate,640,450,60,'flicker')
|
|
||||||
SFX.play('finesseError')
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
TEXT.show(text.noInternet,640,450,60,'flicker')
|
|
||||||
NET.wsconn_app()
|
NET.wsconn_app()
|
||||||
LOG.print(text.wsConnecting,'message')
|
LOG.print(text.wsConnecting,'message')
|
||||||
SFX.play('finesseError')
|
SFX.play('connect')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif key=="z"then
|
elseif key=="z"then
|
||||||
|
|||||||
Reference in New Issue
Block a user