Fix Disable theme and Lock B.G.'s weird behaviors (#1091)
This commit is contained in:
@@ -161,8 +161,12 @@ do-- function applySettings()
|
|||||||
if SETTING.bg=='on' then
|
if SETTING.bg=='on' then
|
||||||
BG.unlock()
|
BG.unlock()
|
||||||
BG.setDefault(SETTING.defaultBG)
|
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()
|
BG.set()
|
||||||
if SETTING.lockBG then BG.lock() end
|
|
||||||
elseif SETTING.bg=='off' then
|
elseif SETTING.bg=='off' then
|
||||||
BG.unlock()
|
BG.unlock()
|
||||||
BG.set('fixColor',SETTING.bgAlpha,SETTING.bgAlpha,SETTING.bgAlpha)
|
BG.set('fixColor',SETTING.bgAlpha,SETTING.bgAlpha,SETTING.bgAlpha)
|
||||||
|
|||||||
@@ -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},
|
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
|
-- 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},
|
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},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ scene.widgetList={
|
|||||||
disp=SETval('lockBG'),
|
disp=SETval('lockBG'),
|
||||||
code=function()
|
code=function()
|
||||||
SETTING.lockBG=not SETTING.lockBG
|
SETTING.lockBG=not SETTING.lockBG
|
||||||
applySettings()
|
applySettings('lockBG')
|
||||||
end,
|
end,
|
||||||
hideF=function() return SETTING.bg~='on' end
|
hideF=function() return SETTING.bg~='on' end
|
||||||
},
|
},
|
||||||
@@ -150,7 +150,7 @@ scene.widgetList={
|
|||||||
MES.new('warn',text.settingWarn2,6.26)
|
MES.new('warn',text.settingWarn2,6.26)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
THEME.set(THEME.calculate())
|
THEME.set(THEME.calculate(),GAME.playing)
|
||||||
WIDGET.setWidgetList(scene.widgetList)
|
WIDGET.setWidgetList(scene.widgetList)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ function THEME.calculate(Y,M,D)
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
function THEME.set(theme)
|
function THEME.set(theme,keepBGM)
|
||||||
if type(theme)=='string' and theme:sub(1,6)=='season' then
|
if type(theme)=='string' and theme:sub(1,6)=='season' then
|
||||||
BG.setDefault(SETTING.defaultBG)
|
BG.setDefault(SETTING.defaultBG)
|
||||||
BGM.setDefault(({season1='null',season2='nil',season3='vaccum',season4='space'})[theme])
|
BGM.setDefault(({season1='null',season2='nil',season3='vaccum',season4='space'})[theme])
|
||||||
@@ -99,7 +99,7 @@ function THEME.set(theme)
|
|||||||
|
|
||||||
THEME.cur=theme
|
THEME.cur=theme
|
||||||
BG.set()
|
BG.set()
|
||||||
BGM.play()
|
if not keepBGM then BGM.play() end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user