观战结束后保留观战状态,整理代码
This commit is contained in:
@@ -269,9 +269,9 @@ end
|
||||
function NET.changeConfig()
|
||||
WS.send('play','{"action":5,"data":'..JSON.encode({config=dumpBasicConfig()})..'}')
|
||||
end
|
||||
function NET.signal_joinMode(ready)
|
||||
if NET.lock('ready',3)and not NET.roomState.start then
|
||||
WS.send('play','{"action":6,"data":'..JSON.encode{mode=ready}..'}')
|
||||
function NET.signal_setMode(mode)
|
||||
if not NET.roomState.start and NET.lock('ready',3)then
|
||||
WS.send('play','{"action":6,"data":'..JSON.encode{mode=mode}..'}')
|
||||
end
|
||||
end
|
||||
function NET.signal_die()
|
||||
@@ -491,6 +491,7 @@ function NET.updateWS_play()
|
||||
NET.wsconn_stream()
|
||||
elseif res.action==9 then--Game finished
|
||||
NET.roomState.start=false
|
||||
if NET.spectate then NET.signal_setMode(2) end
|
||||
NET.spectate=false
|
||||
if SCN.socketRead then SCN.socketRead('finish',d)end
|
||||
NET.wsclose_stream()
|
||||
|
||||
@@ -18,9 +18,9 @@ local lastBackTime=0
|
||||
local noTouch,noKey=false,false
|
||||
local touchMoveLastFrame=false
|
||||
|
||||
local function _setReady()NET.signal_joinMode(1)end
|
||||
local function _setSpectate()NET.signal_joinMode(2)end
|
||||
local function _setCancel()NET.signal_joinMode(0)end
|
||||
local function _setReady()NET.signal_setMode(1)end
|
||||
local function _setSpectate()NET.signal_setMode(2)end
|
||||
local function _setCancel()NET.signal_setMode(0)end
|
||||
local function _gotoSetting()
|
||||
if not(netPLY.getSelfReady()or NET.getlock('ready'))then
|
||||
SCN.go('setting_game')
|
||||
@@ -131,7 +131,6 @@ function scene.keyDown(key)
|
||||
_switchChat()
|
||||
end
|
||||
elseif not inputBox.hide then
|
||||
print(1)
|
||||
WIDGET.focus(inputBox)
|
||||
inputBox:keypress(key)
|
||||
elseif playing then
|
||||
@@ -148,6 +147,7 @@ function scene.keyDown(key)
|
||||
else
|
||||
_setCancel()
|
||||
end
|
||||
elseif key=="s"then
|
||||
_gotoSetting()
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user