From 0a99fb84598f49fcdf714664253c97c465d090b5 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Thu, 12 Nov 2020 21:33:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8E=BB=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=90=8E=E8=83=8C=E6=99=AF=E5=8F=98=E4=B8=8D?= =?UTF-8?q?=E5=9B=9E=E6=9D=A5=EF=BC=88=E4=B9=8B=E5=89=8D=E6=B2=A1=E4=BF=AE?= =?UTF-8?q?=E5=A5=BD=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/bg.lua | 2 +- main.lua | 2 ++ parts/scenes/pause.lua | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Zframework/bg.lua b/Zframework/bg.lua index 4daf4e6d..f60a1487 100644 --- a/Zframework/bg.lua +++ b/Zframework/bg.lua @@ -26,12 +26,12 @@ end function BG.set(background) if background==BG.cur or not SETTING.bg then return end BG.discard() + BG.cur=background background=BGlist[background] if not background then LOG.print("No BG called"..background,"warn") return end - BG.cur=background BG.init= background.init or NULL BG.resize= background.resize or NULL diff --git a/main.lua b/main.lua index acefef8a..0f671989 100644 --- a/main.lua +++ b/main.lua @@ -100,6 +100,8 @@ GAME={ rec={}, --Recording list, key,time,key,time... rank=nil, --Rank reached + prevBG=nil, --Previous background, for restore BG when quit setting page + --Data for royale mode stage=nil, --Game stage mostBadge=nil, --Most badge owner diff --git a/parts/scenes/pause.lua b/parts/scenes/pause.lua index cc07d8f6..9d5fb6aa 100644 --- a/parts/scenes/pause.lua +++ b/parts/scenes/pause.lua @@ -111,6 +111,10 @@ function sceneInit.pause(org) S.trophyColor=COLOR.lCyan end end + if GAME.bg then + BG.set(GAME.BG) + GAME.prevBG=nil + end end function sceneBack.pause() love.keyboard.setKeyRepeat(true) @@ -126,6 +130,8 @@ function keyDown.pause(key) elseif key=="escape"then resumeGame() elseif key=="s"then + GAME.prevBG=BG.cur + print(BG.cur) SCN.go("setting_sound") elseif key=="r"then resetGameData()