拆分全员准备和连接ws准备开局的提示

This commit is contained in:
MrZ626
2021-05-03 13:17:36 +08:00
parent 18b5efcc0e
commit d90f0f3e86
8 changed files with 15 additions and 6 deletions

View File

@@ -101,6 +101,7 @@ return{
joinRoom="has joined the room.", joinRoom="has joined the room.",
leaveRoom="has left the room.", leaveRoom="has left the room.",
ready="READY", ready="READY",
set="SET",
champion="$1 won", champion="$1 won",
chatRemain="Online: ", chatRemain="Online: ",
chatStart="------Beginning of log------", chatStart="------Beginning of log------",

View File

@@ -102,6 +102,7 @@ return{
joinRoom="a rejoint le salon.", joinRoom="a rejoint le salon.",
leaveRoom="a quitté le salon.", leaveRoom="a quitté le salon.",
-- ready="READY", -- ready="READY",
-- set="SET",
champion="$1 a gagné", champion="$1 a gagné",
chatRemain="En ligne : ", chatRemain="En ligne : ",
chatStart="--------Début des logs--------", chatStart="--------Début des logs--------",

View File

@@ -102,6 +102,7 @@ return{
joinRoom="Entrou a sala.", joinRoom="Entrou a sala.",
leaveRoom="Saiu da sala.", leaveRoom="Saiu da sala.",
-- ready="READY", -- ready="READY",
-- set="SET",
-- champion="$1 won", -- champion="$1 won",
chatRemain="Online: ", chatRemain="Online: ",
chatStart="------Começo do log------", chatStart="------Começo do log------",

View File

@@ -102,6 +102,7 @@ return{
joinRoom="entró a la sala.", joinRoom="entró a la sala.",
leaveRoom="salió de la sala.", leaveRoom="salió de la sala.",
-- ready="READY", -- ready="READY",
-- set="SET",
champion="$1 ganó!", champion="$1 ganó!",
chatRemain="Usuarios en línea: ", chatRemain="Usuarios en línea: ",
chatStart="------Comienzo del historial------", chatStart="------Comienzo del historial------",

View File

@@ -46,7 +46,6 @@ return{
createRoomTooFast="手痒要开这么多房间?", createRoomTooFast="手痒要开这么多房间?",
createRoomSuccessed="创好了", createRoomSuccessed="创好了",
started="开了", started="开了",
ready="预备!",
champion="神仙是 $1", champion="神仙是 $1",
stat={ stat={

View File

@@ -100,7 +100,8 @@ return{
started="游戏中", started="游戏中",
joinRoom="进入房间", joinRoom="进入房间",
leaveRoom="离开房间", leaveRoom="离开房间",
ready="准备!", ready="各就各位!",
set="预备!",
champion="$1 获胜", champion="$1 获胜",
chatRemain="人数:", chatRemain="人数:",
chatStart="------消息的开头------", chatStart="------消息的开头------",

View File

@@ -6,6 +6,7 @@ local NET={
allow_online=false, allow_online=false,
allReady=false, allReady=false,
serverGaming=false, serverGaming=false,
connectingStream=false,
roomList={}, roomList={},
accessToken=false, accessToken=false,
rid=false, rid=false,
@@ -441,6 +442,7 @@ function NET.updateWS_play()
NET.allReady=true NET.allReady=true
elseif res.action==8 then--Set elseif res.action==8 then--Set
NET.rsid=d.rid NET.rsid=d.rid
NET.connectingStream=true
NET.wsconn_stream() NET.wsconn_stream()
elseif res.action==9 then--Game finished elseif res.action==9 then--Game finished
NET.allReady=false NET.allReady=false
@@ -474,6 +476,7 @@ function NET.updateWS_stream()
if res.type=='Connect'then if res.type=='Connect'then
NET.unlock('wsc_stream') NET.unlock('wsc_stream')
elseif res.action==0 then--Game start elseif res.action==0 then--Game start
NET.connectingStream=false
SCN.socketRead('Go',d) SCN.socketRead('Go',d)
elseif res.action==1 then--Game finished elseif res.action==1 then--Game finished
--? --?

View File

@@ -268,10 +268,12 @@ function scene.draw()
gc.print(p.username,240,60+50*i) gc.print(p.username,240,60+50*i)
end end
--All-ready mark --Ready & Set mark
if NET.allReady then gc.setColor(.1,1,0,.9)
gc.setColor(.1,1,0,.9) setFont(60)
setFont(60) if NET.connectingStream then
mStr(text.set,640,10)
elseif NET.allReady then
mStr(text.ready,640,10) mStr(text.ready,640,10)
end end