整理代码,修复非游戏状态下设置按钮可见性错误
This commit is contained in:
@@ -20,10 +20,10 @@ scene.widgetList={
|
|||||||
WIDGET.newText{name="version", x=950,y=280,color='Z',align='L',fText=VERSION.string},
|
WIDGET.newText{name="version", x=950,y=280,color='Z',align='L',fText=VERSION.string},
|
||||||
WIDGET.newButton{name="sprint", x=260,y=480,w=260,font=50,code=function()loadGame('sprint_40l',true)end},
|
WIDGET.newButton{name="sprint", x=260,y=480,w=260,font=50,code=function()loadGame('sprint_40l',true)end},
|
||||||
WIDGET.newButton{name="marathon",x=640,y=480,w=260,font=50,code=function()loadGame('marathon_n',true)end},
|
WIDGET.newButton{name="marathon",x=640,y=480,w=260,font=50,code=function()loadGame('marathon_n',true)end},
|
||||||
WIDGET.newButton{name="setting",x=1000,y=400,w=120,fText=TEXTURE.setting,font=50,code=goScene'setting_game'},
|
WIDGET.newButton{name="setting",x=1000,y=400,w=120,fText=TEXTURE.setting,code=goScene'setting_game'},
|
||||||
WIDGET.newButton{name="lang", x=1000,y=560,w=120,fText=TEXTURE.language,font=40,code=goScene'lang'},
|
WIDGET.newButton{name="lang", x=1000,y=560,w=120,fText=TEXTURE.language,code=goScene'lang'},
|
||||||
WIDGET.newButton{name="manual", x=1160,y=400,w=120,fText=TEXTURE.sure,font=80,code=goScene'manual'},
|
WIDGET.newButton{name="manual", x=1160,y=400,w=120,fText=TEXTURE.sure,code=goScene'manual'},
|
||||||
WIDGET.newButton{name="quit", x=1160,y=560,w=120,fText=TEXTURE.quit,font=70,code=function()VOC.play('bye')SCN.swapTo('quit','slowFade')end},
|
WIDGET.newButton{name="quit", x=1160,y=560,w=120,fText=TEXTURE.quit,code=function()VOC.play('bye')SCN.swapTo('quit','slowFade')end},
|
||||||
}
|
}
|
||||||
|
|
||||||
return scene
|
return scene
|
||||||
@@ -49,6 +49,13 @@ local function _switchChat()
|
|||||||
WIDGET.unFocus(true)
|
WIDGET.unFocus(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
local function hideReadyUI()
|
||||||
|
return
|
||||||
|
playing or
|
||||||
|
NET.roomState.start or
|
||||||
|
not netPLY.getSelfReady()or
|
||||||
|
NET.getlock('ready')
|
||||||
|
end
|
||||||
|
|
||||||
local scene={}
|
local scene={}
|
||||||
|
|
||||||
@@ -142,7 +149,7 @@ function scene.keyDown(key,isRep)
|
|||||||
PLAYERS[1]:pressKey(k)
|
PLAYERS[1]:pressKey(k)
|
||||||
VK.press(k)
|
VK.press(k)
|
||||||
end
|
end
|
||||||
else
|
elseif not hideReadyUI()then
|
||||||
if key=="space"then
|
if key=="space"then
|
||||||
if netPLY.getSelfJoinMode()==0 then
|
if netPLY.getSelfJoinMode()==0 then
|
||||||
(kb.isDown("lctrl","rctrl","lalt","ralt")and _setSpectate or _setReady)()
|
(kb.isDown("lctrl","rctrl","lalt","ralt")and _setSpectate or _setReady)()
|
||||||
@@ -321,36 +328,16 @@ function scene.draw()
|
|||||||
gc_print("M",430,10)
|
gc_print("M",430,10)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
scene.widgetList={
|
scene.widgetList={
|
||||||
textBox,
|
textBox,
|
||||||
inputBox,
|
inputBox,
|
||||||
WIDGET.newKey{name="setting",fText=TEXTURE.setting,x=1200,y=160,w=90,h=90,code=_gotoSetting,hideF=function()return playing or netPLY.getSelfReady()or NET.getlock('ready')end},
|
WIDGET.newKey{name="setting",fText=TEXTURE.setting,x=1200,y=160,w=90,h=90, code=_gotoSetting,hideF=hideReadyUI},
|
||||||
WIDGET.newKey{name="ready",x=1060,y=510,w=360,h=90,color='lG',font=35,code=_setReady,
|
WIDGET.newKey{name="ready",x=1060,y=510,w=360,h=90,color='lG',font=35, code=_setReady,hideF=hideReadyUI},
|
||||||
hideF=function()
|
WIDGET.newKey{name="spectate",x=1060,y=610,w=360,h=90,color='lO',font=35, code=_setSpectate,hideF=hideReadyUI},
|
||||||
return
|
WIDGET.newKey{name="cancel",x=1060,y=560,w=360,h=120,color='lH',font=40, code=_setCancel,hideF=hideReadyUI},
|
||||||
playing or
|
WIDGET.newKey{name="hideChat",fText="...",x=380,y=35,w=60,font=35, code=_switchChat},
|
||||||
NET.roomState.start or
|
WIDGET.newKey{name="quit",fText=TEXTURE.quit_small,x=900,y=35,w=60,code=_quit},
|
||||||
netPLY.getSelfReady() or
|
|
||||||
NET.getlock('ready')
|
|
||||||
end},
|
|
||||||
WIDGET.newKey{name="spectate",x=1060,y=610,w=360,h=90,color='lO',font=35,code=_setSpectate,
|
|
||||||
hideF=function()
|
|
||||||
return
|
|
||||||
playing or
|
|
||||||
NET.roomState.start or
|
|
||||||
netPLY.getSelfReady() or
|
|
||||||
NET.getlock('ready')
|
|
||||||
end},
|
|
||||||
WIDGET.newKey{name="cancel",x=1060,y=560,w=360,h=120,color='lH',font=40,code=_setCancel,
|
|
||||||
hideF=function()
|
|
||||||
return
|
|
||||||
playing or
|
|
||||||
NET.roomState.start or
|
|
||||||
not netPLY.getSelfReady() or
|
|
||||||
NET.getlock('ready')
|
|
||||||
end},
|
|
||||||
WIDGET.newKey{name="hideChat",fText="...",x=380,y=35,w=60,font=35,code=_switchChat},
|
|
||||||
WIDGET.newKey{name="quit",fText=TEXTURE.quit_small,x=900,y=35,w=60,font=40,code=_quit},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return scene
|
return scene
|
||||||
Reference in New Issue
Block a user