修复去设置页面后背景变不回来(之前没修好)
This commit is contained in:
@@ -26,12 +26,12 @@ end
|
|||||||
function BG.set(background)
|
function BG.set(background)
|
||||||
if background==BG.cur or not SETTING.bg then return end
|
if background==BG.cur or not SETTING.bg then return end
|
||||||
BG.discard()
|
BG.discard()
|
||||||
|
BG.cur=background
|
||||||
background=BGlist[background]
|
background=BGlist[background]
|
||||||
if not background then
|
if not background then
|
||||||
LOG.print("No BG called"..background,"warn")
|
LOG.print("No BG called"..background,"warn")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
BG.cur=background
|
|
||||||
|
|
||||||
BG.init= background.init or NULL
|
BG.init= background.init or NULL
|
||||||
BG.resize= background.resize or NULL
|
BG.resize= background.resize or NULL
|
||||||
|
|||||||
2
main.lua
2
main.lua
@@ -100,6 +100,8 @@ GAME={
|
|||||||
rec={}, --Recording list, key,time,key,time...
|
rec={}, --Recording list, key,time,key,time...
|
||||||
rank=nil, --Rank reached
|
rank=nil, --Rank reached
|
||||||
|
|
||||||
|
prevBG=nil, --Previous background, for restore BG when quit setting page
|
||||||
|
|
||||||
--Data for royale mode
|
--Data for royale mode
|
||||||
stage=nil, --Game stage
|
stage=nil, --Game stage
|
||||||
mostBadge=nil, --Most badge owner
|
mostBadge=nil, --Most badge owner
|
||||||
|
|||||||
@@ -111,6 +111,10 @@ function sceneInit.pause(org)
|
|||||||
S.trophyColor=COLOR.lCyan
|
S.trophyColor=COLOR.lCyan
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if GAME.bg then
|
||||||
|
BG.set(GAME.BG)
|
||||||
|
GAME.prevBG=nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
function sceneBack.pause()
|
function sceneBack.pause()
|
||||||
love.keyboard.setKeyRepeat(true)
|
love.keyboard.setKeyRepeat(true)
|
||||||
@@ -126,6 +130,8 @@ function keyDown.pause(key)
|
|||||||
elseif key=="escape"then
|
elseif key=="escape"then
|
||||||
resumeGame()
|
resumeGame()
|
||||||
elseif key=="s"then
|
elseif key=="s"then
|
||||||
|
GAME.prevBG=BG.cur
|
||||||
|
print(BG.cur)
|
||||||
SCN.go("setting_sound")
|
SCN.go("setting_sound")
|
||||||
elseif key=="r"then
|
elseif key=="r"then
|
||||||
resetGameData()
|
resetGameData()
|
||||||
|
|||||||
Reference in New Issue
Block a user