Skip to content

Commit 52884a8

Browse files
committed
add option to toggle song banners
1 parent 3297f86 commit 52884a8

File tree

14 files changed

+136
-23
lines changed

14 files changed

+136
-23
lines changed

Themes/Rebirth/BGAnimations/ScreenEvaluation decorations/mainDisplay.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,9 @@ t[#t+1] = Def.ActorFrame {
933933
self:diffusealpha(1)
934934
if params.song then
935935
local bnpath = params.song:GetBannerPath()
936-
if not bnpath then
936+
if not showBanners() then
937+
self:visible(false)
938+
elseif not bnpath then
937939
bnpath = THEME:GetPathG("Common", "fallback banner")
938940
self:visible(false)
939941
else

Themes/Rebirth/BGAnimations/ScreenSelectMusic decorations/curSongBox.lua

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ local t = Def.ActorFrame {
1919
ChangedStepsMessageCommand = function(self, params)
2020
self:playcommand("Set", {song = GAMESTATE:GetCurrentSong(), hovered = lastHovered, steps = params.steps})
2121
end,
22+
OptionUpdatedMessageCommand = function(self, params)
23+
if params and params.name == "Show Banners" then
24+
self:playcommand("Set", {song = GAMESTATE:GetCurrentSong(), hovered = lastHovered, steps = GAMESTATE:GetCurrentSteps()})
25+
end
26+
end,
2227
GeneralTabSetMessageCommand = function(self)
2328
focused = true
2429
end,
@@ -229,7 +234,9 @@ t[#t+1] = Def.ActorFrame {
229234
self:diffusealpha(1)
230235
if params.song then
231236
local bnpath = params.song:GetBannerPath()
232-
if not bnpath then
237+
if not showBanners() then
238+
self:visible(false)
239+
elseif not bnpath then
233240
bnpath = THEME:GetPathG("Common", "fallback banner")
234241
self:visible(false)
235242
else
@@ -238,7 +245,9 @@ t[#t+1] = Def.ActorFrame {
238245
self:LoadBackground(bnpath)
239246
else
240247
local bnpath = WHEELDATA:GetFolderBanner(params.hovered)
241-
if not bnpath or bnpath == "" then
248+
if not showBanners() then
249+
self:visible(false)
250+
elseif not bnpath or bnpath == "" then
242251
bnpath = THEME:GetPathG("Common", "fallback banner")
243252
self:visible(false)
244253
else

Themes/Rebirth/BGAnimations/ScreenSelectMusic decorations/wheel.lua

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ local t = Def.ActorFrame {
286286
end
287287
end,
288288
OptionUpdatedMessageCommand = function(self, params)
289-
if params and params.name == "Music Wheel Banners" then
289+
if params and params.name == "Music Wheel Banners" or params.name == "Show Banners" then
290290
self:playcommand("UpdateWheelBanners")
291291
end
292292
end,
@@ -458,7 +458,9 @@ local function songBannerSetter(self, song, isCurrentItem)
458458
if song then
459459
local bnpath = song:GetBannerPath()
460460
-- we load the fallback banner but for aesthetic purpose at the moment, invisible
461-
if not bnpath then
461+
if not showBanners() then
462+
self:visible(false)
463+
elseif not bnpath then
462464
bnpath = THEME:GetPathG("Common", "fallback banner")
463465
self:visible(false)
464466
else
@@ -486,7 +488,9 @@ local function groupBannerSetter(self, group, isCurrentItem)
486488

487489
local bnpath = WHEELDATA:GetFolderBanner(group)
488490
-- we load the fallback banner but for aesthetic purpose at the moment, invisible
489-
if not bnpath or bnpath == "" then
491+
if not showBanners() then
492+
self:visible(false)
493+
elseif not bnpath or bnpath == "" then
490494
bnpath = THEME:GetPathG("Common", "fallback banner")
491495
self:visible(false)
492496
else
@@ -1493,7 +1497,9 @@ t[#t+1] = Def.ActorFrame {
14931497
end,
14941498
SetCommand = function(self)
14951499
local bnpath = WHEELDATA:GetFolderBanner(openedGroup)
1496-
if not bnpath or bnpath == "" then
1500+
if not showBanners() then
1501+
self:visible(false)
1502+
elseif not bnpath or bnpath == "" then
14971503
bnpath = THEME:GetPathG("Common", "fallback banner")
14981504
self:visible(false)
14991505
else
@@ -1504,6 +1510,8 @@ t[#t+1] = Def.ActorFrame {
15041510
OptionUpdatedMessageCommand = function(self, params)
15051511
if params and params.name == "Video Banners" then
15061512
self:SetDecodeMovie(useVideoBanners())
1513+
elseif params and params.name == "Show Banners" then
1514+
self:playcommand("Set")
15071515
end
15081516
end,
15091517
},

Themes/Rebirth/BGAnimations/playerInfoFrame/settings.lua

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,8 @@ local translations = {
373373
VideoBannersExplanation = THEME:GetString("Settings", "VideoBannersExplanation"),
374374
ShowBGs = THEME:GetString("Settings", "ShowBGs"),
375375
ShowBGsExplanation = THEME:GetString("Settings", "ShowBGsExplanation"),
376+
ShowBanners = THEME:GetString("Settings", "ShowBanners"),
377+
ShowBannersExplanation = THEME:GetString("Settings", "ShowBannersExplanation"),
376378
BGBannerColor = THEME:GetString("Settings", "BGBannerColor"),
377379
BGBannerColorExplanation = THEME:GetString("Settings", "BGBannerColorExplanation"),
378380
AllowBGChanges = THEME:GetString("Settings", "AllowBGChanges"),
@@ -3232,6 +3234,7 @@ local function rightFrame()
32323234
wheelPosition = themeoption("global", "WheelPosition"),
32333235
wheelBanners = themeoption("global", "WheelBanners"),
32343236
showBackgrounds = PREFSMAN:GetPreference("ShowBackgrounds"),
3237+
showBanners = themeoption("global", "ShowBanners"),
32353238
useSingleColorBG = themeoption("global", "FallbackToAverageColorBG"),
32363239
showVisualizer = themeoption("global", "ShowVisualizer"),
32373240
tipType = themeoption("global", "TipType"),
@@ -5615,7 +5618,25 @@ local function rightFrame()
56155618
Choices = choiceSkeleton("On", "Off"),
56165619
Directions = preferenceToggleDirections("NoGlow", false, true),
56175620
ChoiceIndexGetter = preferenceToggleIndexGetter("NoGlow", false),
5618-
}
5621+
},
5622+
{
5623+
Name = "Show Backgrounds",
5624+
DisplayName = translations["ShowBGs"],
5625+
Type = "SingleChoice",
5626+
Explanation = translations["ShowBGsExplanation"],
5627+
Choices = choiceSkeleton("Yes", "No"),
5628+
Directions = preferenceToggleDirections("ShowBackgrounds", true, false),
5629+
ChoiceIndexGetter = preferenceToggleIndexGetter("ShowBackgrounds", true),
5630+
},
5631+
{
5632+
Name = "Show Banners",
5633+
DisplayName = translations["ShowBanners"],
5634+
Type = "SingleChoice",
5635+
Explanation = translations["ShowBannersExplanation"],
5636+
Choices = choiceSkeleton("Yes", "No"),
5637+
Directions = optionDataToggleDirectionsFUNC("showBanners", true, false),
5638+
ChoiceIndexGetter = optionDataToggleIndexGetterFUNC("showBanners", true),
5639+
},
56195640
},
56205641
--
56215642
-----
@@ -5648,15 +5669,6 @@ local function rightFrame()
56485669
Directions = optionDataToggleDirectionsFUNC("videoBanners", true, false),
56495670
ChoiceIndexGetter = optionDataToggleIndexGetterFUNC("videoBanners", true),
56505671
},
5651-
{
5652-
Name = "Show Backgrounds",
5653-
DisplayName = translations["ShowBGs"],
5654-
Type = "SingleChoice",
5655-
Explanation = translations["ShowBGsExplanation"],
5656-
Choices = choiceSkeleton("Yes", "No"),
5657-
Directions = preferenceToggleDirections("ShowBackgrounds", true, false),
5658-
ChoiceIndexGetter = preferenceToggleIndexGetter("ShowBackgrounds", true),
5659-
},
56605672
{
56615673
Name = "BG Fallback to Banner Color",
56625674
DisplayName = translations["BGBannerColor"],

Themes/Rebirth/Languages/en.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,8 @@ VideoBanners=Video Banners
911911
VideoBannersExplanation=Toggle allowing video banners to play at all on the wheel and other locations in music select.
912912
ShowBGs=Show Backgrounds
913913
ShowBGsExplanation=Toggle showing backgrounds everywhere.
914+
ShowBanners=Show Banners
915+
ShowBannersExplanation=Toggle showing banners everywhere.
914916
BGBannerColor=BG Fallback to Banner Color
915917
BGBannerColorExplanation=Toggle using the average color of the pack or song banner when the background is not available. Only applies to music select.
916918
AllowBGChanges=Allow Background Changes

Themes/Rebirth/Scripts/01 theme_config.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ local defaultConfig = {
44
ShowVisualizer = true,
55
FallbackToAverageColorBG = true, -- wheel bg only
66
StaticBackgrounds = false,
7+
ShowBanners = true, -- globally disable banners from displaying if false
78
VideoBanners = true,
89
WheelPosition = true, -- true = left, false = right
910
WheelBanners = true, -- true = on, false = off
@@ -22,4 +23,7 @@ function useWheelBanners()
2223
end
2324
function useVideoBanners()
2425
return themeConfig:get_data().global.VideoBanners
26+
end
27+
function showBanners()
28+
return themeConfig:get_data().global.ShowBanners
2529
end

Themes/Rebirth/Scripts/02 ThemePrefs.lua

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,38 @@ function Particles()
873873
return t
874874
end
875875

876+
function ShowBanners()
877+
local t = {
878+
Name = "ShowBanners",
879+
LayoutType = "ShowAllInRow",
880+
SelectType = "SelectOne",
881+
OneChoiceForAllPlayers = true,
882+
ExportOnChange = true,
883+
Choices = {THEME:GetString("OptionNames", "Off"), THEME:GetString("OptionNames", "On")},
884+
LoadSelections = function(self, list, pn)
885+
local pref = themeConfig:get_data().global.ShowBanners
886+
if pref then
887+
list[2] = true
888+
else
889+
list[1] = true
890+
end
891+
end,
892+
SaveSelections = function(self, list, pn)
893+
local value
894+
if list[1] then
895+
value = false
896+
else
897+
value = true
898+
end
899+
themeConfig:get_data().global.ShowBanners = value
900+
themeConfig:set_dirty()
901+
themeConfig:save()
902+
end
903+
}
904+
setmetatable(t, t)
905+
return t
906+
end
907+
876908
function RateSort()
877909
local t = {
878910
Name = "RateSort",

Themes/Til Death/BGAnimations/ScreenEvaluation underlay.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ t[#t + 1] = Def.Sprite {
2626
self:x(SCREEN_CENTER_X):y(38):valign(0)
2727
self:scaletoclipped(capWideScale(get43size(336), 336), capWideScale(get43size(105), 105))
2828
local bnpath = GAMESTATE:GetCurrentSong():GetBannerPath()
29-
if not bnpath then
29+
self:visible(true)
30+
if not BannersEnabled() then
31+
self:visible(false)
32+
elseif not bnpath then
3033
bnpath = THEME:GetPathG("Common", "fallback banner")
3134
end
3235
self:LoadBackground(bnpath)

Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/wifeTwirl.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,13 +820,19 @@ t[#t + 1] = Def.Sprite {
820820
self:finishtweening()
821821
if song then
822822
local bnpath = GAMESTATE:GetCurrentSong():GetBannerPath()
823-
if not bnpath then
823+
self:visible(true)
824+
if not BannersEnabled() then
825+
self:visible(false)
826+
elseif not bnpath then
824827
bnpath = THEME:GetPathG("Common", "fallback banner")
825828
end
826829
self:LoadBackground(bnpath)
827830
else
828831
local bnpath = SONGMAN:GetSongGroupBannerPath(SCREENMAN:GetTopScreen():GetMusicWheel():GetSelectedSection())
829-
if not bnpath or bnpath == "" then
832+
self:visible(true)
833+
if not BannersEnabled() then
834+
self:visible(false)
835+
elseif not bnpath or bnpath == "" then
830836
bnpath = THEME:GetPathG("Common", "fallback banner")
831837
end
832838
self:LoadBackground(bnpath)

Themes/Til Death/Scripts/01 theme_config.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ local defaultConfig = {
1616
CenteredCombo = false,
1717
FadeNoteFieldInSyncMachine = true,
1818
ShowPlayerOptionsHint = true,
19+
ShowBanners = true, -- false to turn off banners everywhere
1920
},
2021
NPSDisplay = {
2122
DynamicWindow = false,
@@ -46,3 +47,6 @@ end
4647
function CenteredComboEnabled()
4748
return themeConfig:get_data().global.CenteredCombo
4849
end
50+
function BannersEnabled()
51+
return themeConfig:get_data().global.ShowBanners
52+
end

Themes/Til Death/Scripts/02 ThemePrefs.lua

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,38 @@ function TipType()
744744
return t
745745
end
746746

747+
function ShowBanners()
748+
local t = {
749+
Name = "ShowBanners",
750+
LayoutType = "ShowAllInRow",
751+
SelectType = "SelectOne",
752+
OneChoiceForAllPlayers = true,
753+
ExportOnChange = true,
754+
Choices = {THEME:GetString("OptionNames", "Off"), THEME:GetString("OptionNames", "On")},
755+
LoadSelections = function(self, list, pn)
756+
local pref = themeConfig:get_data().global.ShowBanners
757+
if pref then
758+
list[2] = true
759+
else
760+
list[1] = true
761+
end
762+
end,
763+
SaveSelections = function(self, list, pn)
764+
local value
765+
if list[1] then
766+
value = false
767+
else
768+
value = true
769+
end
770+
themeConfig:get_data().global.ShowBanners = value
771+
themeConfig:set_dirty()
772+
themeConfig:save()
773+
end
774+
}
775+
setmetatable(t, t)
776+
return t
777+
end
778+
747779
function EvalBGType()
748780
local t = {
749781
Name = "EvalBGType",

Themes/Til Death/metrics.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,9 @@ LineInputOptions="gamecommand;screen,ScreenOptionsInputSub;name,InputOptions"
493493
Fallback="ScreenOptionsServiceChild"
494494
NextScreen="ScreenOptionsService"
495495
PrevScreen="ScreenOptionsService"
496-
LineNames="SongBGEnabled,RateSort,HelpMenu,NPSWindow,MeasureLines,Visualizer,InstantSearch,JudgmentTween,ComboTween,CenteredCombo,IgnoreTabInput,FNFnGSM,ShowPlayerOptionsHint"
496+
LineNames="SongBGEnabled,Banners,RateSort,HelpMenu,NPSWindow,MeasureLines,Visualizer,InstantSearch,JudgmentTween,ComboTween,CenteredCombo,IgnoreTabInput,FNFnGSM,ShowPlayerOptionsHint"
497497
#LineDefaultScore="lua,DefaultScoreType()"
498+
LineBanners="lua,ShowBanners()"
498499
LineTipType="lua,TipType()"
499500
LineFNFnGSM="lua,FadeNoteFieldInSyncMachine()"
500501
LineSongBGEnabled="conf,ShowBackgrounds"

Themes/_fallback/base._ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2471,7 +2471,6 @@ Line11="conf,DelayedTextureDeletion"
24712471
Line12="conf,RefreshRate"
24722472
Line13="conf,Vsync"
24732473
Line14="conf,ShowStats"
2474-
Line15="conf,ShowBanners"
24752474
Line16="conf,AttractSoundFrequency"
24762475
Line17="conf,SoundVolume"
24772476
Line18="conf,EnableAttackSounds"

Themes/_fallback/metrics.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2239,7 +2239,6 @@ Line12="conf,RefreshRate"
22392239
Line13="conf,Vsync"
22402240
LineFNR="conf,FastNoteRendering"
22412241
Line14="conf,ShowStats"
2242-
Line15="conf,ShowBanners"
22432242
Line16="conf,AttractSoundFrequency"
22442243
Line17="conf,SoundVolume"
22452244
Line19="conf,EnableMineHitSound"

0 commit comments

Comments
 (0)