整理代码
This commit is contained in:
@@ -72,7 +72,7 @@ local nullIndex={
|
|||||||
NETPLY.add{
|
NETPLY.add{
|
||||||
uid=k,
|
uid=k,
|
||||||
group=-1,
|
group=-1,
|
||||||
role='Normal',-- 'Normal'|'Admin'
|
role='Normal',
|
||||||
playMode='Spectator',
|
playMode='Spectator',
|
||||||
readyMode='Standby',
|
readyMode='Standby',
|
||||||
config="",
|
config="",
|
||||||
|
|||||||
@@ -19,13 +19,6 @@ local upstreamProgress
|
|||||||
local noTouch,noKey=false,false
|
local noTouch,noKey=false,false
|
||||||
local touchMoveLastFrame=false
|
local touchMoveLastFrame=false
|
||||||
|
|
||||||
local function _hideReadyUI()
|
|
||||||
return
|
|
||||||
playing or
|
|
||||||
NET.roomState.start or
|
|
||||||
TASK.getLock('ready')
|
|
||||||
end
|
|
||||||
|
|
||||||
local function _setCancel()
|
local function _setCancel()
|
||||||
if NETPLY.map[USER.uid].playMode=='Gamer' then
|
if NETPLY.map[USER.uid].playMode=='Gamer' then
|
||||||
NET.player_setReady(false)
|
NET.player_setReady(false)
|
||||||
@@ -166,7 +159,7 @@ function scene.keyDown(key,isRep)
|
|||||||
PLAYERS[1]:pressKey(k)
|
PLAYERS[1]:pressKey(k)
|
||||||
VK.press(k)
|
VK.press(k)
|
||||||
end
|
end
|
||||||
elseif not _hideReadyUI() then
|
elseif not playing then
|
||||||
if key=='space' then
|
if key=='space' then
|
||||||
if NETPLY.map[USER.uid].playMode=='Spectator' or NETPLY.map[USER.uid].readyMode=='Ready' then
|
if NETPLY.map[USER.uid].playMode=='Spectator' or NETPLY.map[USER.uid].readyMode=='Ready' then
|
||||||
_setCancel()
|
_setCancel()
|
||||||
@@ -307,10 +300,6 @@ function scene.draw()
|
|||||||
if NET.roomState.private then
|
if NET.roomState.private then
|
||||||
gc_draw(IMG.lock,30,668)
|
gc_draw(IMG.lock,30,668)
|
||||||
end
|
end
|
||||||
if NET.roomState.start then
|
|
||||||
gc_setColor(0,1,0)
|
|
||||||
gc_print(text.started,230,655)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Profile
|
-- Profile
|
||||||
drawSelfProfile()
|
drawSelfProfile()
|
||||||
@@ -327,8 +316,8 @@ function scene.draw()
|
|||||||
gc_print("M",430,10)
|
gc_print("M",430,10)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local function _hideF_ready() return _hideReadyUI() or (NETPLY.map[USER.uid].playMode=='Spectator' or NETPLY.map[USER.uid].readyMode=='Ready') end
|
local function _hideF_ready() return playing or (NETPLY.map[USER.uid].playMode=='Spectator' or NETPLY.map[USER.uid].readyMode=='Ready') end
|
||||||
local function _hideF_standby() return _hideReadyUI() or not (NETPLY.map[USER.uid].playMode=='Spectator' or NETPLY.map[USER.uid].readyMode=='Ready') end
|
local function _hideF_standby() return playing or not (NETPLY.map[USER.uid].playMode=='Spectator' or NETPLY.map[USER.uid].readyMode=='Ready') end
|
||||||
scene.widgetList={
|
scene.widgetList={
|
||||||
textBox,
|
textBox,
|
||||||
inputBox,
|
inputBox,
|
||||||
|
|||||||
Reference in New Issue
Block a user