微调玩家准备相关交互

This commit is contained in:
MrZ626
2021-04-11 20:42:24 +08:00
parent 0bcfd10a9d
commit f2d72d70f1
2 changed files with 16 additions and 9 deletions

View File

@@ -422,21 +422,28 @@ function NET.updateWS_play()
resetGameData("qn") resetGameData("qn")
end end
elseif res.action==6 then--One ready elseif res.action==6 then--One ready
for i=1,#PLY_NET do for i,p in next,PLY_NET do
if PLY_NET[i].uid==d.uid then if p.uid==d.uid then
if PLY_NET[i].ready~=d.ready then if p.ready~=d.ready then
p.ready=d.ready
SFX.play("spin_0",.6)
if i==1 then if i==1 then
WIDGET.active.ready.color=COLOR[d.ready and"lY"or"lG"] NET.unlock("ready")
else
for j=2,#PLY_NET do
if not PLY_NET[j].ready then
break
elseif j==#PLY_NET then
SFX.play("warning",.5)
end
end
end end
PLY_NET[i].ready=d.ready
SFX.play("reach",.6)
end end
break break
end end
end end
NET.unlock("ready")
elseif res.action==7 then--Ready elseif res.action==7 then--Ready
--? SFX.play("reach",.6)
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()

View File

@@ -270,7 +270,7 @@ function scene.draw()
end end
scene.widgetList={ scene.widgetList={
textBox, textBox,
WIDGET.newKey{name="ready",x=900,y=560,w=400,h=100,color="lG",font=40,code=pressKey"space",hide=function() WIDGET.newKey{name="ready",x=900,y=560,w=400,h=100,color="lB",font=40,code=pressKey"space",hide=function()
return return
playing or playing or
not textBox.hide or not textBox.hide or