微调网战房间内ui,全员准备后会有可视化标记
This commit is contained in:
@@ -4,6 +4,7 @@ local WS,TIME=WS,TIME
|
|||||||
local NET={
|
local NET={
|
||||||
connected=false,
|
connected=false,
|
||||||
allow_online=false,
|
allow_online=false,
|
||||||
|
allReady=false,
|
||||||
serverGaming=false,
|
serverGaming=false,
|
||||||
roomList={},
|
roomList={},
|
||||||
accessToken=false,
|
accessToken=false,
|
||||||
@@ -401,7 +402,7 @@ function NET.updateWS_play()
|
|||||||
if PLY_NET[i].uid==d.uid then
|
if PLY_NET[i].uid==d.uid then
|
||||||
PLY_NET[i].config=d.config
|
PLY_NET[i].config=d.config
|
||||||
PLY_NET[i].p:setConf(d.config)
|
PLY_NET[i].p:setConf(d.config)
|
||||||
return
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
resetGameData("qn")
|
resetGameData("qn")
|
||||||
@@ -411,17 +412,18 @@ function NET.updateWS_play()
|
|||||||
if p.uid==d.uid then
|
if p.uid==d.uid then
|
||||||
if p.ready~=d.ready then
|
if p.ready~=d.ready then
|
||||||
p.ready=d.ready
|
p.ready=d.ready
|
||||||
|
if not d.ready then NET.allReady=false end
|
||||||
SFX.play("spin_0",.6)
|
SFX.play("spin_0",.6)
|
||||||
if i==1 then
|
if i==1 then
|
||||||
NET.unlock("ready")
|
NET.unlock("ready")
|
||||||
elseif not PLY_NET[1].ready then
|
elseif not PLY_NET[1].ready then
|
||||||
for j=2,#PLY_NET do
|
for j=2,#PLY_NET do
|
||||||
if not PLY_NET[j].ready then
|
if not PLY_NET[j].ready then
|
||||||
break
|
goto BREAK_notAllReady
|
||||||
elseif j==#PLY_NET then
|
end
|
||||||
|
end
|
||||||
SFX.play("blip_2",.5)
|
SFX.play("blip_2",.5)
|
||||||
end
|
::BREAK_notAllReady::
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
break
|
break
|
||||||
@@ -429,10 +431,12 @@ function NET.updateWS_play()
|
|||||||
end
|
end
|
||||||
elseif res.action==7 then--All Ready
|
elseif res.action==7 then--All Ready
|
||||||
SFX.play("reach",.6)
|
SFX.play("reach",.6)
|
||||||
|
NET.allReady=true
|
||||||
elseif res.action==8 then--Set
|
elseif res.action==8 then--Set
|
||||||
NET.rsid=d.rid
|
NET.rsid=d.rid
|
||||||
NET.wsconn_stream()
|
NET.wsconn_stream()
|
||||||
elseif res.action==9 then--Game finished
|
elseif res.action==9 then--Game finished
|
||||||
|
NET.allReady=false
|
||||||
NET.wsclose_stream()
|
NET.wsclose_stream()
|
||||||
if SCN.socketRead then SCN.socketRead("Finish",d)end
|
if SCN.socketRead then SCN.socketRead("Finish",d)end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -239,8 +239,8 @@ function scene.draw()
|
|||||||
|
|
||||||
--Rectangle
|
--Rectangle
|
||||||
gc.setColor(COLOR[p.ready and"G"or"white"])
|
gc.setColor(COLOR[p.ready and"G"or"white"])
|
||||||
gc.setLineWidth(3)
|
gc.setLineWidth(2)
|
||||||
gc.rectangle("line",40,67+50*i,800,42)
|
gc.rectangle("line",40,65+50*i,1000,46)
|
||||||
|
|
||||||
--UID
|
--UID
|
||||||
setFont(40)
|
setFont(40)
|
||||||
@@ -255,6 +255,13 @@ function scene.draw()
|
|||||||
gc.print(p.username,240,60+50*i)
|
gc.print(p.username,240,60+50*i)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--All-ready mark
|
||||||
|
if NET.allReady then
|
||||||
|
gc.setColor(0,1,.2,.8)
|
||||||
|
gc.setLineWidth(10)
|
||||||
|
gc.rectangle("line",610,25,60,60)
|
||||||
|
end
|
||||||
|
|
||||||
--Profile
|
--Profile
|
||||||
drawSelfProfile()
|
drawSelfProfile()
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user