diff --git a/parts/gameFuncs.lua b/parts/gameFuncs.lua index e701217d..8577b838 100644 --- a/parts/gameFuncs.lua +++ b/parts/gameFuncs.lua @@ -161,8 +161,12 @@ do-- function applySettings() if SETTING.bg=='on' then BG.unlock() BG.setDefault(SETTING.defaultBG) + if SETTING.lockBG then + BG.lock() + elseif reason=='lockBG' then -- Don't load theme too soon! + THEME.set(THEME.calculate(),GAME.playing) + end BG.set() - if SETTING.lockBG then BG.lock() end elseif SETTING.bg=='off' then BG.unlock() BG.set('fixColor',SETTING.bgAlpha,SETTING.bgAlpha,SETTING.bgAlpha) diff --git a/parts/scenes/customGame.lua b/parts/scenes/customGame.lua index 356e0cbd..4d6826a7 100644 --- a/parts/scenes/customGame.lua +++ b/parts/scenes/customGame.lua @@ -350,7 +350,7 @@ scene.widgetList={ WIDGET.newSwitch{name='phyHold', x=560, y=1030,lim=200, disp=CUSval('phyHold'),code=CUSrev('phyHold'),hideF=function() return CUSTOMGAME_LOCAL.customenv.holdCount==0 end}, -- BG & BGM - WIDGET.newSelector{name='bg', x=840, y=1100,w=250,color='Y',list=BG.getList(),disp=CUSval('bg'),code=function(i) CUSTOMGAME_LOCAL.customenv.bg=i BG.set(i) end}, + WIDGET.newSelector{name='bg', x=840, y=1100,w=250,color='Y',list=BG.getList(),disp=CUSval('bg'),code=function(i) CUSTOMGAME_LOCAL.customenv.bg=i BG.set(i) end,hideF=SETval('lockBG')}, WIDGET.newSelector{name='bgm', x=1120,y=1100,w=250,color='Y',list=BGM.getList(),disp=CUSval('bgm'),code=function(i) CUSTOMGAME_LOCAL.customenv.bgm=i BGM.play(i) end}, } diff --git a/parts/scenes/setting_video.lua b/parts/scenes/setting_video.lua index 57f96c09..e916a0fc 100644 --- a/parts/scenes/setting_video.lua +++ b/parts/scenes/setting_video.lua @@ -135,7 +135,7 @@ scene.widgetList={ disp=SETval('lockBG'), code=function() SETTING.lockBG=not SETTING.lockBG - applySettings() + applySettings('lockBG') end, hideF=function() return SETTING.bg~='on' end }, @@ -150,7 +150,7 @@ scene.widgetList={ MES.new('warn',text.settingWarn2,6.26) end else - THEME.set(THEME.calculate()) + THEME.set(THEME.calculate(),GAME.playing) WIDGET.setWidgetList(scene.widgetList) end end diff --git a/parts/theme.lua b/parts/theme.lua index 2e0307ec..6cd65ca2 100644 --- a/parts/theme.lua +++ b/parts/theme.lua @@ -58,7 +58,7 @@ function THEME.calculate(Y,M,D) ) end -function THEME.set(theme) +function THEME.set(theme,keepBGM) if type(theme)=='string' and theme:sub(1,6)=='season' then BG.setDefault(SETTING.defaultBG) BGM.setDefault(({season1='null',season2='nil',season3='vaccum',season4='space'})[theme]) @@ -99,7 +99,7 @@ function THEME.set(theme) THEME.cur=theme BG.set() - BGM.play() + if not keepBGM then BGM.play() end return true end