diff --git a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua index a27dda8ed9..d3afe670f1 100644 --- a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua +++ b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua @@ -176,7 +176,7 @@ for pn in ivalues(PlayerNumber) do Tip=LoadActor( THEME:GetPathG( 'SongMeterDisplay', 'tip ' .. PlayerNumberToString(pn) ) ) .. { InitCommand=cmd(visible,false); }; }; }; - if GetUserPrefB("UserPrefTimingDisplay") == true then + if ThemePrefs.Get("TimingDisplay") == true then songMeterDisplay[#songMeterDisplay+1] = CreateSegments(pn); end t[#t+1] = songMeterDisplay diff --git a/Themes/default/BGAnimations/ScreenGameplay failed/default.lua b/Themes/default/BGAnimations/ScreenGameplay failed/default.lua index ab6f9a6dcf..4b99a97346 100644 --- a/Themes/default/BGAnimations/ScreenGameplay failed/default.lua +++ b/Themes/default/BGAnimations/ScreenGameplay failed/default.lua @@ -1,4 +1,4 @@ -local longFail = GetUserPrefB("UserPrefLongFail"); +local longFail = ThemePrefs.Get("LongFail"); local t = Def.ActorFrame{}; diff --git a/Themes/default/BGAnimations/ScreenTitleMenu underlay.lua b/Themes/default/BGAnimations/ScreenTitleMenu underlay.lua index 3d22dba012..c85a1039e5 100644 --- a/Themes/default/BGAnimations/ScreenTitleMenu underlay.lua +++ b/Themes/default/BGAnimations/ScreenTitleMenu underlay.lua @@ -1,5 +1,10 @@ InitUserPrefs(); -local t = Def.ActorFrame {}; + +local t = Def.ActorFrame { + BeginCommand=function(self) + ThemePrefs.Save() + end; +}; t[#t+1] = StandardDecorationFromFileOptional("Logo","Logo"); t[#t+1] = StandardDecorationFromFileOptional("VersionInfo","VersionInfo"); diff --git a/Themes/default/BGAnimations/ScreenWithMenuElements background/_particleLoader.lua b/Themes/default/BGAnimations/ScreenWithMenuElements background/_particleLoader.lua index 65bfea4cad..e44c6cca0b 100644 --- a/Themes/default/BGAnimations/ScreenWithMenuElements background/_particleLoader.lua +++ b/Themes/default/BGAnimations/ScreenWithMenuElements background/_particleLoader.lua @@ -1,3 +1,7 @@ +local hideFancyElements = (ThemePrefs.Get("FancyUIBG") == false) +local t = Def.ActorFrame{}; +if hideFancyElements then return t; end + local Params = { NumParticles = 30, VelocityXMin = 100, @@ -15,10 +19,6 @@ local Params = { File = "_particle normal", }; -local hideFancyElements = (GetUserPrefB("UserPrefFancyUIBG") == false) -local t = Def.ActorFrame{}; -if hideFancyElements then return t; end - local tParticleInfo = {} for i=1,Params.NumParticles do diff --git a/Themes/default/Graphics/Combo 100milestone/default.lua b/Themes/default/Graphics/Combo 100milestone/default.lua index 0d7279c583..2e72062aca 100644 --- a/Themes/default/Graphics/Combo 100milestone/default.lua +++ b/Themes/default/Graphics/Combo 100milestone/default.lua @@ -1,4 +1,4 @@ -local ShowFlashyCombo = GetUserPrefB("UserPrefFlashyCombo") +local ShowFlashyCombo = ThemePrefs.Get("FlashyCombo") return Def.ActorFrame { LoadActor("explosion") .. { InitCommand=cmd(diffusealpha,0;blend,'BlendMode_Add';hide_if,not ShowFlashyCombo); diff --git a/Themes/default/Graphics/Player combo/default.lua b/Themes/default/Graphics/Player combo/default.lua index 185d4ba80b..e05d5fe697 100644 --- a/Themes/default/Graphics/Player combo/default.lua +++ b/Themes/default/Graphics/Player combo/default.lua @@ -12,7 +12,7 @@ local NumberMaxZoomAt = THEME:GetMetric("Combo", "NumberMaxZoomAt"); local LabelMinZoom = THEME:GetMetric("Combo", "LabelMinZoom"); local LabelMaxZoom = THEME:GetMetric("Combo", "LabelMaxZoom"); -local ShowFlashyCombo = GetUserPrefB("UserPrefFlashyCombo") +local ShowFlashyCombo = ThemePrefs.Get("FlashyCombo") local t = Def.ActorFrame { InitCommand=cmd(vertalign,bottom); diff --git a/Themes/default/Scripts/03 ThemePrefs.lua b/Themes/default/Scripts/03 ThemePrefs.lua index 2a06cd6f45..546473cc8c 100644 --- a/Themes/default/Scripts/03 ThemePrefs.lua +++ b/Themes/default/Scripts/03 ThemePrefs.lua @@ -48,7 +48,7 @@ local Prefs = Choices = { OptionNameString('Off'), OptionNameString('On') }, Values = { false, true } }, - FlashyCombos = + FlashyCombo = { Default = false, Choices = { OptionNameString('Off'), OptionNameString('On') }, @@ -66,9 +66,20 @@ local Prefs = Choices = { OptionNameString('Off'), OptionNameString('On') }, Values = { false, true } }, - --[[ - TimingDisplay, + TimingDisplay = + { + Default = true, + Choices = { OptionNameString('Off'), OptionNameString('On') }, + Values = { false, true } + }, + GameplayFooter = + { + Default = false, + Choices = { OptionNameString('Off'), OptionNameString('On') }, + Values = { false, true } + }, + --[[ ProtimingP1, ProtimingP2, @@ -80,20 +91,9 @@ ThemePrefs.InitAll(Prefs) function InitUserPrefs() local Prefs = { - UserPrefGameplayShowStepsDisplay = true, - UserPrefGameplayShowScore = false, UserPrefScoringMode = 'DDR Extreme', - UserPrefShowLotsaOptions = true, - UserPrefAutoSetStyle = false, - UserPrefLongFail = false, - UserPrefNotePosition = true, - UserPrefComboOnRolls = false, UserPrefProtimingP1 = false, UserPrefProtimingP2 = false, - FlashyCombos = false, - UserPrefComboUnderField = true, - UserPrefFancyUIBG = true, - UserPrefTimingDisplay = true } for k, v in pairs(Prefs) do -- kind of xxx @@ -191,108 +191,6 @@ function OptionRowProTiming() return t end -function UserPrefGameplayShowScore() - local t = { - Name = "UserPrefGameplayShowScore", - LayoutType = "ShowAllInRow", - SelectType = "SelectOne", - OneChoiceForAllPlayers = true, - ExportOnChange = false, - Choices = { - THEME:GetString('OptionNames','Off'), - THEME:GetString('OptionNames','On') - }, - LoadSelections = function(self, list, pn) - if ReadPrefFromFile("UserPrefGameplayShowScore") ~= nil then - if GetUserPrefB("UserPrefGameplayShowScore") then - list[2] = true - else - list[1] = true - end - else - WritePrefToFile("UserPrefGameplayShowScore", false) - list[1] = true - end - end, - SaveSelections = function(self, list, pn) - local val = list[2] and true or false - WritePrefToFile("UserPrefGameplayShowScore", val) - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" }) - THEME:ReloadMetrics() - end - } - setmetatable(t, t) - return t -end - -function UserPrefGameplayShowStepsDisplay() - local t = { - Name = "UserPrefGameplayShowStepsDisplay", - LayoutType = "ShowAllInRow", - SelectType = "SelectOne", - OneChoiceForAllPlayers = true, - ExportOnChange = false, - Choices = { - THEME:GetString('OptionNames','Off'), - THEME:GetString('OptionNames','On') - }, - LoadSelections = function(self, list, pn) - if ReadPrefFromFile("UserPrefGameplayShowStepsDisplay") ~= nil then - if GetUserPrefB("UserPrefGameplayShowStepsDisplay") then - list[2] = true - else - list[1] = true - end - else - WritePrefToFile("UserPrefGameplayShowStepsDisplay", false) - list[1] = true - end - end, - SaveSelections = function(self, list, pn) - local val = list[2] and true or false - WritePrefToFile("UserPrefGameplayShowStepsDisplay", val) - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" }) - THEME:ReloadMetrics() - end - } - setmetatable(t, t) - return t -end - -function UserPrefShowLotsaOptions() - local t = { - Name = "UserPrefShowLotsaOptions", - LayoutType = "ShowAllInRow", - SelectType = "SelectOne", - OneChoiceForAllPlayers = true, - ExportOnChange = false, - Choices = { - THEME:GetString('OptionNames','Many'), - THEME:GetString('OptionNames','Few') - }, - LoadSelections = function(self, list, pn) - if ReadPrefFromFile("UserPrefShowLotsaOptions") ~= nil then - if GetUserPrefB("UserPrefShowLotsaOptions") then - list[1] = true - else - list[2] = true - end - else - WritePrefToFile("UserPrefShowLotsaOptions", false) - list[2] = true - end - end, - SaveSelections = function(self, list, pn) - local val = list[1] and true or false - WritePrefToFile("UserPrefShowLotsaOptions", val) - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" }) - THEME:ReloadMetrics() - end - } - setmetatable(t, t); - return t -end - function GetDefaultOptionLines() local LineSets = { -- none of these include characters yet. "1,8,14,2,3A,3B,4,5,6,R,7,9,10,11,12,13,16,SF,17", -- All @@ -305,294 +203,22 @@ function GetDefaultOptionLines() return false end end - + local function CheckCharacters(mods) if CHARMAN:GetCharacterCount() > 0 then return mods .. ",18" --TODO: Better line name. end return mods end - + modLines = LineSets[2] - + if not IsExtra() then modLines = GetUserPrefB("UserPrefShowLotsaOptions") and LineSets[1] or LineSets[2] end - + return CheckCharacters(modLines) end -function UserPrefAutoSetStyle() - local t = { - Name = "UserPrefAutoSetStyle", - LayoutType = "ShowAllInRow", - SelectType = "SelectOne", - OneChoiceForAllPlayers = true, - ExportOnChange = false, - Choices = { - THEME:GetString('OptionNames','Off'), - THEME:GetString('OptionNames','On') - }, - LoadSelections = function(self, list, pn) - if ReadPrefFromFile("UserPrefAutoSetStyle") ~= nil then - if GetUserPrefB("UserPrefAutoSetStyle") then - list[2] = true - else - list[1] = true - end - else - WritePrefToFile("UserPrefAutoSetStyle", false) - list[1] = true - end - end, - SaveSelections = function(self, list, pn) - local val = list[2] and true or false - WritePrefToFile("UserPrefAutoSetStyle", val) - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ) - THEME:ReloadMetrics() - end - } - setmetatable(t, t) - return t -end - -function UserPrefNotePosition() - local t = { - Name = "UserPrefNotePosition", - LayoutType = "ShowAllInRow", - SelectType = "SelectOne", - OneChoiceForAllPlayers = true, - ExportOnChange = false, - Choices = { - THEME:GetString('OptionNames','Normal'), - THEME:GetString('OptionNames','Lower') - }, - LoadSelections = function(self, list, pn) - if ReadPrefFromFile("UserPrefNotePosition") ~= nil then - if GetUserPrefB("UserPrefNotePosition") then - list[1] = true - else - list[2] = true - end - else - WritePrefToFile("UserPrefNotePosition", false) - list[1] = true - end - end, - SaveSelections = function(self, list, pn) - local val = list[1] and true or false - WritePrefToFile("UserPrefNotePosition", val) - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" }) - THEME:ReloadMetrics() - end - } - setmetatable(t, t) - return t -end - -function UserPrefLongFail() - local t = { - Name = "UserPrefLongFail", - LayoutType = "ShowAllInRow", - SelectType = "SelectOne", - OneChoiceForAllPlayers = true, - ExportOnChange = false, - Choices = { - THEME:GetString('OptionNames','Short'), - THEME:GetString('OptionNames','Long') - }, - LoadSelections = function(self, list, pn) - if ReadPrefFromFile("UserPrefLongFail") ~= nil then - if GetUserPrefB("UserPrefLongFail") then - list[2] = true - else - list[1] = true - end - else - WritePrefToFile("UserPrefLongFail", false) - list[1] = true - end - end, - SaveSelections = function(self, list, pn) - local val = list[2] and true or false - WritePrefToFile("UserPrefLongFail", val) - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ) - THEME:ReloadMetrics() - end - } - setmetatable(t, t) - return t -end - -function UserPrefComboOnRolls() - local t = { - Name = "UserPrefComboOnRolls", - LayoutType = "ShowAllInRow", - SelectType = "SelectOne", - OneChoiceForAllPlayers = true, - ExportOnChange = false, - Choices = { - THEME:GetString('OptionNames','Off'), - THEME:GetString('OptionNames','On') - }, - LoadSelections = function(self, list, pn) - if ReadPrefFromFile("UserPrefComboOnRolls") ~= nil then - if GetUserPrefB("UserPrefComboOnRolls") then - list[2] = true; - else - list[1] = true; - end; - else - WritePrefToFile("UserPrefComboOnRolls",false); - list[1] = true; - end; - end, - SaveSelections = function(self, list, pn) - local val = list[2] and true or false - WritePrefToFile("UserPrefComboOnRolls", val) - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" }) - THEME:ReloadMetrics() - end - } - setmetatable(t, t) - return t -end - -function UserPrefFlashyCombo() - local t = { - Name = "UserPrefFlashyCombo", - LayoutType = "ShowAllInRow", - SelectType = "SelectOne", - OneChoiceForAllPlayers = true, - ExportOnChange = false, - Choices = { - THEME:GetString('OptionNames','Off'), - THEME:GetString('OptionNames','On') - }, - LoadSelections = function(self, list, pn) - if ReadPrefFromFile("UserPrefFlashyCombo") ~= nil then - if GetUserPrefB("UserPrefFlashyCombo") then - list[2] = true - else - list[1] = true - end - else - WritePrefToFile("UserPrefFlashyCombo", false) - list[1] = true - end - end, - SaveSelections = function(self, list, pn) - local val = list[2] and true or false - WritePrefToFile("UserPrefFlashyCombo", val) - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" }) - THEME:ReloadMetrics() - end - } - setmetatable(t, t) - return t -end - -function UserPrefComboUnderField() - local t = { - Name = "UserPrefComboUnderField", - LayoutType = "ShowAllInRow", - SelectType = "SelectOne", - OneChoiceForAllPlayers = true, - ExportOnChange = false, - Choices = { - THEME:GetString('OptionNames','Off'), - THEME:GetString('OptionNames','On') - }, - LoadSelections = function(self, list, pn) - if ReadPrefFromFile("UserPrefComboUnderField") ~= nil then - if GetUserPrefB("UserPrefComboUnderField") then - list[2] = true - else - list[1] = true - end - else - WritePrefToFile("UserPrefComboUnderField", true) - list[2] = true - end - end, - SaveSelections = function(self, list, pn) - local val = list[2] and true or false - WritePrefToFile("UserPrefComboUnderField", val) - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" }) - THEME:ReloadMetrics() - end - } - setmetatable(t, t) - return t; -end - -function UserPrefFancyUIBG() - local t = { - Name = "UserPrefFancyUIBG", - LayoutType = "ShowAllInRow", - SelectType = "SelectOne", - OneChoiceForAllPlayers = true, - ExportOnChange = false, - Choices = { - THEME:GetString('OptionNames','Off'), - THEME:GetString('OptionNames','On') - }, - LoadSelections = function(self, list, pn) - if ReadPrefFromFile("UserPrefFancyUIBG") ~= nil then - if GetUserPrefB("UserPrefFancyUIBG") then - list[2] = true - else - list[1] = true - end - else - WritePrefToFile("UserPrefFancyUIBG", true) - list[2] = true - end - end, - SaveSelections = function(self, list, pn) - local val = list[2] and true or false - WritePrefToFile("UserPrefFancyUIBG", val) - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" }) - THEME:ReloadMetrics() - end - } - setmetatable(t, t) - return t -end - -function UserPrefTimingDisplay() - local t = { - Name = "UserPrefTimingDisplay", - LayoutType = "ShowAllInRow", - SelectType = "SelectOne", - OneChoiceForAllPlayers = true, - ExportOnChange = false, - Choices = { - THEME:GetString('OptionNames','Off'), - THEME:GetString('OptionNames','On') - }, - LoadSelections = function(self, list, pn) - if ReadPrefFromFile("UserPrefTimingDisplay") ~= nil then - if GetUserPrefB("UserPrefTimingDisplay") then - list[2] = true - else - list[1] = true - end - else - WritePrefToFile("UserPrefTimingDisplay", true) - list[2] = true - end - end, - SaveSelections = function(self, list, pn) - local val = list[2] and true or false - WritePrefToFile("UserPrefTimingDisplay", val) - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" }) - THEME:ReloadMetrics() - end - } - setmetatable(t, t) - return t -end - --[[ end option rows ]]