优化GAME.prevBG的使用,同时应用于联网游戏场景,修复从设置返回后背景变化问题

This commit is contained in:
MrZ626
2021-06-08 12:55:14 +08:00
parent 4ae14b6c73
commit 6519e8445e
2 changed files with 7 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ local function _setReady()NET.signal_setMode(1)end
local function _setSpectate()NET.signal_setMode(2)end
local function _gotoSetting()
if not(netPLY.getSelfReady()or NET.getlock('ready'))then
GAME.prevBG=BG.cur
SCN.go('setting_game')
end
end
@@ -63,6 +64,10 @@ function scene.sceneInit(org)
newMessageTimer=0
if org=='setting_game'then NET.changeConfig()end
if GAME.prevBG then
BG.set(GAME.prevBG)
GAME.prevBG=false
end
if NET.specSRID then
NET.wsconn_stream(NET.specSRID)
NET.specSRID=false

View File

@@ -113,8 +113,9 @@ function scene.sceneInit(org)
else
rank,trophy=nil
end
if org~="game"and GAME.prevBG then
if GAME.prevBG then
BG.set(GAME.prevBG)
GAME.prevBG=false
end
end
function scene.sceneBack()