No theme and default BG and patch BG bug when hitting F11 (#1070)

* Add setting slot for no theme & default BG

* Whitelist 4 seasons theme + blocking console's theme command if theme disabled

* Small update theme.lua

* Expose the WIDGET.setOnChange() to use in setting_video.lua

* Shorten "Use custom B.G." to "Custom B.G."

* Shorten theme code, and edit the UI

* Add lock BG

* Add VI translation

* Fullscreen patch

* Modify UI

* Small change

* Undo a mistake
This commit is contained in:
C6H12O6 + NaCl + H2O
2023-12-31 20:35:48 +07:00
committed by GitHub
parent 42942d1ac4
commit 19ea76dc4c
8 changed files with 150 additions and 87 deletions

View File

@@ -59,48 +59,48 @@ function THEME.calculate(Y,M,D)
end
function THEME.set(theme)
if theme=='xmas' then
BG.setDefault('snow')
BGM.setDefault('xmas')
MES.new('info',"==Merry Christmas==")
elseif theme=='birth' then
BG.setDefault('firework')
BGM.setDefault('magicblock')
elseif theme=='sprfes' then
BG.setDefault('firework')
BGM.setDefault('spring festival')
MES.new('info',"★☆新年快乐☆★")
elseif theme=='halloween' then
BG.setDefault('glow')
BGM.setDefault('antispace')
MES.new('info',">>Happy halloween<<")
elseif theme=='zday1' then
BG.setDefault('lanterns')
BGM.setDefault('overzero')
elseif theme=='zday2' then
BG.setDefault('lanterns')
BGM.setDefault('jazz nihilism')
elseif theme=='zday3' then
BG.setDefault('lanterns')
BGM.setDefault('empty')
elseif theme=='season1' then
BG.setDefault('space')
BGM.setDefault('null')
elseif theme=='season2' then
BG.setDefault('space')
BGM.setDefault('nil')
elseif theme=='season3' then
BG.setDefault('space')
BGM.setDefault('vacuum')
elseif theme=='season4' then
BG.setDefault('space')
BGM.setDefault('space')
elseif theme=='fool' then
BG.setDefault('blockrain')
BGM.setDefault('how feeling')
else
return
end
local seasonT={'null','nil','vaccum','space'}
-- Note: by default, the background will be 'space' unless user changed
-- Because 4 seasonal themes are basically the normal theme, not special like others
if type(theme)=='string' and string.sub(theme,1,6)=='season' then
local n=tonumber(string.sub(theme,7))
if 0<n and n<5 then
BG. setDefault(SETTING.defaultBG)
BGM.setDefault(seasonT[n])
end
elseif not SETTING.noTheme then
if theme=='xmas' then
BG.setDefault('snow')
BGM.setDefault('xmas')
MES.new('info',"==Merry Christmas==")
elseif theme=='birth' then
BG.setDefault('firework')
BGM.setDefault('magicblock')
elseif theme=='sprfes' then
BG.setDefault('firework')
BGM.setDefault('spring festival')
MES.new('info',"★☆新年快乐☆★")
elseif theme=='halloween' then
BG.setDefault('glow')
BGM.setDefault('antispace')
MES.new('info',">>Happy halloween<<")
elseif theme=='zday1' then
BG.setDefault('lanterns')
BGM.setDefault('overzero')
elseif theme=='zday2' then
BG.setDefault('lanterns')
BGM.setDefault('jazz nihilism')
elseif theme=='zday3' then
BG.setDefault('lanterns')
BGM.setDefault('empty')
elseif theme=='fool' then
BG.setDefault('blockrain')
BGM.setDefault('how feeling')
else
return
end
else THEME.set(THEME.calculate('0',os.date('%m'),'0')) return end
THEME.cur=theme
BG.set()
BGM.play()