点击进入房间后一段时间不能进行其他操作

This commit is contained in:
MrZ626
2021-08-03 16:30:27 +08:00
parent 47af067c03
commit 652aced790
2 changed files with 11 additions and 2 deletions

View File

@@ -317,7 +317,7 @@ function NET.createRoom(roomName,description,capacity,roomType,roomData,password
end
end
function NET.enterRoom(room,password)
if NET.lock('enterRoom',2)then
if NET.lock('enterRoom',6)then
SFX.play('reach',.6)
WS.send('play',JSON.encode{
action=2,

View File

@@ -59,6 +59,7 @@ function scene.sceneInit()
end
function scene.keyDown(key)
if NET.getlock('enterRoom')then return end
if WIDGET.sel~=passwordBox then
if key=="r"then
if fetchTimer<=7 then
@@ -100,6 +101,14 @@ function scene.draw()
gc_setColor(1,1,1,.12)
gc_arc('fill','pie',250,630,40,-1.5708,-1.5708-.6283*fetchTimer)
--Joining mark
if NET.getlock('enterRoom')then
gc.setColor(1,1,1)
gc.setLineWidth(15)
local t=TIME()*6.26%6.2832
gc.arc('line','open',640,360,80,t,t+4.26)
end
--Room list
local R=roomList:getSel()
if R then
@@ -139,7 +148,7 @@ scene.widgetList={
WIDGET.newKey{name="refresh", x=250,y=630,w=140,h=120,code=fetchRoom,hideF=function()return fetchTimer>7 end},
WIDGET.newKey{name="new", x=510,y=630,w=260,h=120,code=pressKey"n"},
WIDGET.newKey{name="join", x=780,y=630,w=140,h=120,code=pressKey"return",hideF=function()return roomList:getLen()==0 or NET.getlock('enterRoom')end},
WIDGET.newButton{name="back", x=1140,y=640,w=170,h=80,fText=TEXTURE.back,code=backScene},
WIDGET.newButton{name="back", x=1140,y=640,w=170,h=80,fText=TEXTURE.back,code=pressKey"escape"},
}
return scene