diff --git a/Themes/default/Scripts/00 ThemeInfo.lua b/Themes/default/Scripts/00 ThemeInfo.lua index 47b74875fe..43d87e3284 100644 --- a/Themes/default/Scripts/00 ThemeInfo.lua +++ b/Themes/default/Scripts/00 ThemeInfo.lua @@ -6,4 +6,4 @@ themeInfo = { Date = "20110720", Internal = "rel 00000000-3500", Revision = 3500, -}; \ No newline at end of file +} diff --git a/Themes/default/Scripts/02 Colors.lua b/Themes/default/Scripts/02 Colors.lua index af16034dbd..8fae5d39e7 100644 --- a/Themes/default/Scripts/02 Colors.lua +++ b/Themes/default/Scripts/02 Colors.lua @@ -4,4 +4,4 @@ ModeIconColors = { Extended = color("#00CCFF"), -- cyan Oni = color("#CC00FF"), -- redder purple Endless = color("#444488"), -- steel -} \ No newline at end of file +} diff --git a/Themes/default/Scripts/02 Lyrics.lua b/Themes/default/Scripts/02 Lyrics.lua index 39010b936d..d61a1031ee 100644 --- a/Themes/default/Scripts/02 Lyrics.lua +++ b/Themes/default/Scripts/02 Lyrics.lua @@ -1,46 +1,44 @@ function Actor:LyricCommand(side) - self:settext( Var "LyricText" ); + self:settext(Var "LyricText") - self:stoptweening(); - self:shadowlengthx(0); - self:shadowlengthy(0); - self:strokecolor(Color("Outline")); + self:stoptweening() + self:shadowlengthx(0) + self:shadowlengthy(0) + self:strokecolor(Color("Outline")) + self:zoomx(clamp(SCREEN_WIDTH/(self:GetZoomedWidth()+1), 0, 1)) - local Zoom = SCREEN_WIDTH/(self:GetZoomedWidth()+1); - if( Zoom > 1 ) then Zoom = 1 end - self:zoomx( Zoom ); - - local Color = Var "LyricColor"; + local Color = Var "LyricColor" local Factor = 1 if side == "Back" then Factor = 0.5 elseif side == "Front" then Factor = 0.9 end - self:diffuse( { + self:diffuse({ Color[1] * Factor, Color[2] * Factor, Color[3] * Factor, - Color[4] * Factor } ) + Color[4] * Factor + }) if side == "Front" then - self:cropright(1); + self:cropright(1) else - self:cropleft(0); + self:cropleft(0) end - self:diffusealpha(0); - self:linear(0.2); - self:diffusealpha(0.75); - self:linear( Var "LyricDuration" * 0.75); + self:diffusealpha(0) + self:linear(0.2) + self:diffusealpha(0.75) + self:linear(Var "LyricDuration" * 0.75) if side == "Front" then - self:cropright(0); + self:cropright(0) else - self:cropleft(1); + self:cropleft(1) end - self:sleep( Var "LyricDuration" * 0.25 ); - self:linear(0.2); - self:diffusealpha(0); + self:sleep(Var "LyricDuration" * 0.25) + self:linear(0.2) + self:diffusealpha(0) end -- (c) 2006 Glenn Maynard diff --git a/Themes/default/Scripts/02 TextBanner.lua b/Themes/default/Scripts/02 TextBanner.lua index b70206dea8..7082e08e73 100644 --- a/Themes/default/Scripts/02 TextBanner.lua +++ b/Themes/default/Scripts/02 TextBanner.lua @@ -2,18 +2,39 @@ local mainMaxWidth = 228; -- zoom w/subtitle is 0.75 (multiply by 1.25) local subMaxWidth = 420; -- zoom is 0.6 (multiply zoom,1 value by 1.4) local artistMaxWidth = 300/0.8; -function TextBannerAfterSet(self,param) - local Title=self:GetChild("Title"); - local Subtitle=self:GetChild("Subtitle"); - local Artist=self:GetChild("Artist"); - if Subtitle:GetText() == "" then - (cmd(maxwidth,mainMaxWidth;y,-8;zoom,1;))(Title); - (cmd(visible,false))(Subtitle); - (cmd(zoom,0.66;maxwidth,artistMaxWidth;y,8))(Artist); +--[[ +-- The old (cmd(blah))(Actor) syntax is hard to read. +-- This is longer, but much easier to read. - Colby +--]] +function TextBannerAfterSet(self,param) + local Title = self:GetChild("Title") + local Subtitle = self:GetChild("Subtitle") + local Artist = self:GetChild("Artist") + + if Subtitle:GetText() == "" then + Title:maxwidth(mainMaxWidth) + Title:y(-8) + Title:zoom(1) + + -- hide so that the game skips drawing. + Subtitle:visible(false) + + Artist:zoom(0.66) + Artist:maxwidth(artistMaxWidth) + Artist:y(8) else - -- subtitle below - (cmd(maxwidth,mainMaxWidth*1.25;y,-11;zoom,0.75;))(Title); - (cmd(visible,true;zoom,0.6;y,0;maxwidth,subMaxWidth))(Subtitle); - (cmd(zoom,0.6;maxwidth,artistMaxWidth;y,10))(Artist); + Title:maxwidth(mainMaxWidth*1.25) + Title:y(-11) + Title:zoom(0.75) + + -- subtitle below title + Subtitle:visible(true) + Subtitle:zoom(0.6) + Subtitle:y(0) + Subtitle:maxwidth(subMaxWidth) + + Artist:zoom(0.6) + Artist:maxwidth(artistMaxWidth) + Artist:y(10) end -end \ No newline at end of file +end diff --git a/Themes/default/Scripts/03 ThemePrefs.lua b/Themes/default/Scripts/03 ThemePrefs.lua index 243b7762c4..fd7237b0e1 100644 --- a/Themes/default/Scripts/03 ThemePrefs.lua +++ b/Themes/default/Scripts/03 ThemePrefs.lua @@ -1,7 +1,6 @@ -- sm-ssc Default Theme Preferences Handler -- Example usage of new system (not really implemented yet) - local Prefs = { AutoSetStyle = @@ -10,227 +9,169 @@ local Prefs = Choices = { "ON", "OFF" }, Values = { true, false } }, -}; +} -ThemePrefs.InitAll( Prefs ) +ThemePrefs.InitAll(Prefs) function InitUserPrefs() - if GetUserPref("UserPrefGameplayShowStepsDisplay") == nil then - SetUserPref("UserPrefGameplayShowStepsDisplay", true); - end; - if GetUserPref("UserPrefGameplayShowScore") == nil then - SetUserPref("UserPrefGameplayShowScore", false); - end; - if GetUserPref("UserPrefScoringMode") == nil then - SetUserPref("UserPrefScoringMode", 'DDR Extreme'); - end; - if GetUserPrefB("UserPrefShowLotsaOptions") == nil then - SetUserPref("UserPrefShowLotsaOptions", true); - end; - if GetUserPrefB("UserPrefAutoSetStyle") == nil then - SetUserPref("UserPrefAutoSetStyle", false); - end; - if GetUserPrefB("UserPrefLongFail") == nil then - SetUserPref("UserPrefLongFail", false); - end; - if GetUserPrefB("UserPrefNotePosition") == nil then - SetUserPref("UserPrefNotePosition", true); - end; - if GetUserPrefB("UserPrefComboOnRolls") == nil then - SetUserPref("UserPrefComboOnRolls", false); - end; - if GetUserPrefB("UserPrefProtimingP1") == nil then - SetUserPref("UserPrefProtimingP1", false); - end; - if GetUserPrefB("UserPrefProtimingP2") == nil then - SetUserPref("UserPrefProtimingP2", false); - end; - if GetUserPrefB("FlashyCombos") == nil then - SetUserPref("FlashyCombos", false); - end; - if GetUserPrefB("UserPrefComboUnderField") == nil then - SetUserPref("UserPrefComboUnderField", true); - end; - if GetUserPrefB("UserPrefFancyUIBG") == nil then - SetUserPref("UserPrefFancyUIBG", true); - end; ---[[ if GetUserPref("ProTimingP1") == nil then - SetUserPref("ProTimingP1", false); - end; - if GetUserPref("ProTimingP2") == nil then - SetUserPref("ProTimingP2", false); - end; --]] -end; + local Prefs = { + UserPrefGameplayShowStepsDisplay = true, + 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 + } + for k, v in pairs(Prefs) do + -- kind of xxx + local GetPref = type(v) == "boolean" and GetUserPrefB or GetUserPref + if GetPref(k) == nil then + SetUserPref(k, v) + end + end +end function GetProTiming(pn) - local pname = ToEnumShortString(pn); + local pname = ToEnumShortString(pn) if GetUserPref("ProTiming"..pname) then - return GetUserPrefB("ProTiming"..pname); + return GetUserPrefB("ProTiming"..pname) else - SetUserPref("ProTiming"..pname,false); - return false; - end; -end; + SetUserPref("ProTiming"..pname,false) + return false + end +end --[[ option rows ]] -- screen cover function OptionRowProTiming() local t = { - Name = "ProTiming"; - LayoutType = "ShowAllInRow"; - SelectType = "SelectOne"; - OneChoiceForAllPlayers = false; - ExportOnChange = false; - Choices = { 'Off','On' }; + Name = "ProTiming", + LayoutType = "ShowAllInRow", + SelectType = "SelectOne", + OneChoiceForAllPlayers = false, + ExportOnChange = false, + Choices = { 'Off','On' }, LoadSelections = function(self, list, pn) - local bShow; - if GetUserPrefB("UserPrefProtiming" .. ToEnumShortString(pn) ) then - bShow = GetUserPrefB("UserPrefProtiming" .. ToEnumShortString(pn) ); + if GetUserPrefB("UserPrefProtiming" .. ToEnumShortString(pn)) then + local bShow = GetUserPrefB("UserPrefProtiming" .. ToEnumShortString(pn)) if bShow then - list[2] = true; + list[2] = true else - list[1] = true; + list[1] = true end else - list[1] = true; - end; ---[[ local pname = ToEnumShortString(pn); - - if getenv("ProTiming"..pname) == true then - list[2] = true; - else - list[1] = true; - end; --]] - end; + list[1] = true + end + end, SaveSelections = function(self, list, pn) - local bSave; - if list[2] then - bSave = true; - else - bSave = false; - end; - SetUserPref("UserPrefProtiming" .. ToEnumShortString(pn),bSave); ---[[ local val; - if list[2] then - val = true; - else - val = false; - end; - local pname = ToEnumShortString(pn); - setenv("ProTiming"..pname, val); --]] - end; - }; - setmetatable( t, t ); - return t; -end; + local bSave = list[2] and true or false + SetUserPref("UserPrefProtiming" .. ToEnumShortString(pn), bSave) + end + } + setmetatable(t, t) + return t +end function UserPrefGameplayShowScore() local t = { - Name = "UserPrefGameplayShowScore"; - LayoutType = "ShowAllInRow"; - SelectType = "SelectOne"; - OneChoiceForAllPlayers = true; - ExportOnChange = false; - Choices = { 'Off','On' }; + Name = "UserPrefGameplayShowScore", + LayoutType = "ShowAllInRow", + SelectType = "SelectOne", + OneChoiceForAllPlayers = true, + ExportOnChange = false, + Choices = { 'Off','On' }, LoadSelections = function(self, list, pn) if ReadPrefFromFile("UserPrefGameplayShowScore") ~= nil then if GetUserPrefB("UserPrefGameplayShowScore") then - list[2] = true; + list[2] = true else - list[1] = true; - end; + list[1] = true + end else - WritePrefToFile("UserPrefGameplayShowScore",false); - list[1] = true; - end; - end; + WritePrefToFile("UserPrefGameplayShowScore", false) + list[1] = true + end + end, SaveSelections = function(self, list, pn) - local val; - if list[2] then - val = true; - else - val = false; - end; - WritePrefToFile("UserPrefGameplayShowScore",val); - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); - THEME:ReloadMetrics(); - end; - }; - setmetatable( t, t ); - return t; + 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 = { 'Off','On' }; + Name = "UserPrefGameplayShowStepsDisplay", + LayoutType = "ShowAllInRow", + SelectType = "SelectOne", + OneChoiceForAllPlayers = true, + ExportOnChange = false, + Choices = { 'Off','On' }, LoadSelections = function(self, list, pn) if ReadPrefFromFile("UserPrefGameplayShowStepsDisplay") ~= nil then if GetUserPrefB("UserPrefGameplayShowStepsDisplay") then - list[2] = true; + list[2] = true else - list[1] = true; - end; + list[1] = true + end else - WritePrefToFile("UserPrefGameplayShowStepsDisplay",false); - list[1] = true; - end; - end; + WritePrefToFile("UserPrefGameplayShowStepsDisplay", false) + list[1] = true + end + end, SaveSelections = function(self, list, pn) - local val; - if list[2] then - val = true; - else - val = false; - end; - WritePrefToFile("UserPrefGameplayShowStepsDisplay",val); - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); - THEME:ReloadMetrics(); - end; - }; - setmetatable( t, t ); - return t; + 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 = { 'Many','Few' }; + Name = "UserPrefShowLotsaOptions", + LayoutType = "ShowAllInRow", + SelectType = "SelectOne", + OneChoiceForAllPlayers = true, + ExportOnChange = false, + Choices = { 'Many','Few' }, LoadSelections = function(self, list, pn) if ReadPrefFromFile("UserPrefShowLotsaOptions") ~= nil then if GetUserPrefB("UserPrefShowLotsaOptions") then - list[1] = true; + list[1] = true else - list[2] = true; - end; + list[2] = true + end else - WritePrefToFile("UserPrefShowLotsaOptions",false); - list[2] = true; - end; - end; + WritePrefToFile("UserPrefShowLotsaOptions", false) + list[2] = true + end + end, SaveSelections = function(self, list, pn) - local val; - if list[1] then - val = true; - else - val = false; - end; - WritePrefToFile("UserPrefShowLotsaOptions",val); - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); - THEME:ReloadMetrics(); - end; - }; - setmetatable( t, t ); - return t; + 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() @@ -248,138 +189,122 @@ function GetDefaultOptionLines() local function CheckCharacters(mods) if CHARMAN:GetCharacterCount() > 0 then - return mods .. ",18"; --TODO: Better line name. + return mods .. ",18" --TODO: Better line name. end - return mods; + return mods end - modLines = LineSets[2]; + modLines = LineSets[2] if not IsExtra() then modLines = GetUserPrefB("UserPrefShowLotsaOptions") - and LineSets[1] or LineSets[2]; + and LineSets[1] or LineSets[2] end - return CheckCharacters(modLines); -end; + return CheckCharacters(modLines) +end function UserPrefAutoSetStyle() local t = { - Name = "UserPrefAutoSetStyle"; - LayoutType = "ShowAllInRow"; - SelectType = "SelectOne"; - OneChoiceForAllPlayers = true; - ExportOnChange = false; - Choices = { 'Off','On' }; + Name = "UserPrefAutoSetStyle", + LayoutType = "ShowAllInRow", + SelectType = "SelectOne", + OneChoiceForAllPlayers = true, + ExportOnChange = false, + Choices = { 'Off','On' }, LoadSelections = function(self, list, pn) if ReadPrefFromFile("UserPrefAutoSetStyle") ~= nil then if GetUserPrefB("UserPrefAutoSetStyle") then - list[2] = true; + list[2] = true else - list[1] = true; - end; + list[1] = true + end else - WritePrefToFile("UserPrefAutoSetStyle",false); - list[1] = true; - end; - end; + WritePrefToFile("UserPrefAutoSetStyle", false) + list[1] = true + end + end, SaveSelections = function(self, list, pn) - local val; - if list[2] then - val = true; - else - val = false; - end; - WritePrefToFile("UserPrefAutoSetStyle",val); - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); - THEME:ReloadMetrics(); - end; - }; - setmetatable( t, t ); - return t; + 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 = { 'Normal','Lower' }; + Name = "UserPrefNotePosition", + LayoutType = "ShowAllInRow", + SelectType = "SelectOne", + OneChoiceForAllPlayers = true, + ExportOnChange = false, + Choices = { 'Normal','Lower' }, LoadSelections = function(self, list, pn) if ReadPrefFromFile("UserPrefNotePosition") ~= nil then if GetUserPrefB("UserPrefNotePosition") then - list[1] = true; + list[1] = true else - list[2] = true; - end; + list[2] = true + end else - WritePrefToFile("UserPrefNotePosition",false); - list[1] = true; - end; - end; + WritePrefToFile("UserPrefNotePosition", false) + list[1] = true + end + end, SaveSelections = function(self, list, pn) - local val; - if list[1] then - val = true; - else - val = false; - end; - WritePrefToFile("UserPrefNotePosition",val); - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); - THEME:ReloadMetrics(); - end; - }; - setmetatable( t, t ); - return t; + 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 = { 'Short','Long' }; + Name = "UserPrefLongFail", + LayoutType = "ShowAllInRow", + SelectType = "SelectOne", + OneChoiceForAllPlayers = true, + ExportOnChange = false, + Choices = { 'Short','Long' }, LoadSelections = function(self, list, pn) if ReadPrefFromFile("UserPrefLongFail") ~= nil then if GetUserPrefB("UserPrefLongFail") then - list[2] = true; + list[2] = true else - list[1] = true; - end; + list[1] = true + end else - WritePrefToFile("UserPrefLongFail",false); - list[1] = true; - end; - end; + WritePrefToFile("UserPrefLongFail", false) + list[1] = true + end + end, SaveSelections = function(self, list, pn) - local val; - if list[2] then - val = true; - else - val = false; - end; - WritePrefToFile("UserPrefLongFail",val); - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); - THEME:ReloadMetrics(); - end; - }; - setmetatable( t, t ); - return t; + 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 = { 'Off','On' }; + Name = "UserPrefComboOnRolls", + LayoutType = "ShowAllInRow", + SelectType = "SelectOne", + OneChoiceForAllPlayers = true, + ExportOnChange = false, + Choices = { 'Off','On' }, LoadSelections = function(self, list, pn) if ReadPrefFromFile("UserPrefComboOnRolls") ~= nil then if GetUserPrefB("UserPrefComboOnRolls") then @@ -391,130 +316,112 @@ function UserPrefComboOnRolls() WritePrefToFile("UserPrefComboOnRolls",false); list[1] = true; end; - end; + end, SaveSelections = function(self, list, pn) - local val; - if list[2] then - val = true; - else - val = false; - end; - WritePrefToFile("UserPrefComboOnRolls",val); - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); - THEME:ReloadMetrics(); - end; - }; - setmetatable( t, t ); - return t; + 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 = { 'Off','On' }; + Name = "UserPrefFlashyCombo", + LayoutType = "ShowAllInRow", + SelectType = "SelectOne", + OneChoiceForAllPlayers = true, + ExportOnChange = false, + Choices = { 'Off','On' }, LoadSelections = function(self, list, pn) if ReadPrefFromFile("UserPrefFlashyCombo") ~= nil then if GetUserPrefB("UserPrefFlashyCombo") then - list[2] = true; + list[2] = true else - list[1] = true; - end; + list[1] = true + end else - WritePrefToFile("UserPrefFlashyCombo",false); - list[1] = true; - end; - end; + WritePrefToFile("UserPrefFlashyCombo", false) + list[1] = true + end + end, SaveSelections = function(self, list, pn) - local val; - if list[2] then - val = true; - else - val = false; - end; - WritePrefToFile("UserPrefFlashyCombo",val); - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); - THEME:ReloadMetrics(); - end; - }; - setmetatable( t, t ); - return t; + 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 = { 'Off','On' }; + Name = "UserPrefComboUnderField", + LayoutType = "ShowAllInRow", + SelectType = "SelectOne", + OneChoiceForAllPlayers = true, + ExportOnChange = false, + Choices = { 'Off','On' }, LoadSelections = function(self, list, pn) if ReadPrefFromFile("UserPrefComboUnderField") ~= nil then if GetUserPrefB("UserPrefComboUnderField") then - list[2] = true; + list[2] = true else - list[1] = true; - end; + list[1] = true + end else - WritePrefToFile("UserPrefComboUnderField",true); - list[2] = true; - end; - end; + WritePrefToFile("UserPrefComboUnderField", true) + list[2] = true + end + end, SaveSelections = function(self, list, pn) - local val; - if list[2] then - val = true; - else - val = false; - end; - WritePrefToFile("UserPrefComboUnderField",val); - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); - THEME:ReloadMetrics(); - end; - }; - setmetatable( t, t ); + 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; + Name = "UserPrefFancyUIBG", + LayoutType = "ShowAllInRow", + SelectType = "SelectOne", + OneChoiceForAllPlayers = true, + ExportOnChange = false, Choices = { THEME:GetString('OptionNames','On'), THEME:GetString('OptionNames','Off') - }; + }, LoadSelections = function(self, list, pn) if ReadPrefFromFile("UserPrefFancyUIBG") ~= nil then if GetUserPrefB("UserPrefFancyUIBG") then - list[1] = true; + list[1] = true else - list[2] = true; - end; + list[2] = true + end else - WritePrefToFile("UserPrefFancyUIBG",true); - list[1] = true; - end; - end; + WritePrefToFile("UserPrefFancyUIBG", true) + list[1] = true + end + end, SaveSelections = function(self, list, pn) - local val; - if list[1] then val = true; - else val = false; - end; - WritePrefToFile("UserPrefFancyUIBG",val); - MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); - THEME:ReloadMetrics(); - end; - }; - setmetatable( t, t ); - return t; + local val = list[1] and true or false + WritePrefToFile("UserPrefFancyUIBG", val) + MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" }) + THEME:ReloadMetrics() + end + } + setmetatable(t, t) + return t end --[[ end option rows ]]