修正几处检测当前场景的代码之前更新场景模块忘了改
This commit is contained in:
8
main.lua
8
main.lua
@@ -60,11 +60,11 @@ BGM.setMaxSources(5)
|
||||
VOC.setDiversion(.62)
|
||||
|
||||
WIDGET.setOnChange(function()
|
||||
if SCN.stack[#SCN.stack-1]~='custom_field' then
|
||||
if SCN.stack[#SCN.stack]~='custom_field' then
|
||||
local colorList=THEME.getThemeColor()
|
||||
if not colorList then return end
|
||||
local rnd=math.random
|
||||
for _,W in next,SCN.scenes[SCN.stack[#SCN.stack-1]].widgetList do
|
||||
for _,W in next,SCN.scenes[SCN.stack[#SCN.stack]].widgetList do
|
||||
if W.color then
|
||||
W.color=colorList[rnd(#colorList)]
|
||||
end
|
||||
@@ -218,10 +218,10 @@ do-- Z.setOnFocus
|
||||
TASK.new(task_autoSoundOn)
|
||||
end
|
||||
else
|
||||
if SCN.stack[#SCN.stack-1]=='game' and SETTING.autoPause then
|
||||
if SCN.stack[#SCN.stack]=='game' and SETTING.autoPause then
|
||||
pauseGame()
|
||||
end
|
||||
if SETTING.autoMute and SCN.stack[#SCN.stack-1]~='music' then
|
||||
if SETTING.autoMute and SCN.stack[#SCN.stack]~='music' then
|
||||
TASK.removeTask_code(task_autoSoundOn)
|
||||
TASK.new(task_autoSoundOff)
|
||||
end
|
||||
|
||||
@@ -441,7 +441,7 @@ end
|
||||
local function _playerLeaveRoom(uid)
|
||||
for i=1,#PLAYERS do if PLAYERS[i].uid==uid then table.remove(PLAYERS,i) break end end
|
||||
for i=1,#PLY_ALIVE do if PLY_ALIVE[i].uid==uid then table.remove(PLY_ALIVE,i) break end end
|
||||
if SCN.stack[#SCN.stack-1]=='net_game' then
|
||||
if SCN.stack[#SCN.stack]=='net_game' then
|
||||
if uid==USER.uid then
|
||||
SCN.backTo('net_menu')
|
||||
else
|
||||
@@ -585,7 +585,7 @@ function NET.wsCallBack.global_getOnlineCount(body)
|
||||
NET.onlineCount=tonumber(body.data) or "_"
|
||||
end
|
||||
function NET.wsCallBack.room_chat(body)
|
||||
if SCN.stack[#SCN.stack-1]=='net_game' then
|
||||
if SCN.stack[#SCN.stack]=='net_game' then
|
||||
TASK.unlock('receiveMessage')
|
||||
TASK.lock('receiveMessage',1)
|
||||
NET.textBox:push{
|
||||
|
||||
@@ -2192,7 +2192,7 @@ local function task_autoPause()
|
||||
while true do
|
||||
yield()
|
||||
time=time+1
|
||||
if SCN.stack[#SCN.stack-1]~='game' or PLAYERS[1].frameRun<180 then
|
||||
if SCN.stack[#SCN.stack]~='game' or PLAYERS[1].frameRun<180 then
|
||||
return
|
||||
elseif time==120 then
|
||||
pauseGame()
|
||||
|
||||
Reference in New Issue
Block a user