Start cleaning up scripts. ThemePrefs makes me want to never look at code again.

This commit is contained in:
Colby Klein
2011-08-18 11:13:07 -07:00
parent b43ea11edf
commit e5d863fb93
5 changed files with 318 additions and 392 deletions
+1 -1
View File
@@ -6,4 +6,4 @@ themeInfo = {
Date = "20110720", Date = "20110720",
Internal = "rel 00000000-3500", Internal = "rel 00000000-3500",
Revision = 3500, Revision = 3500,
}; }
+21 -23
View File
@@ -1,46 +1,44 @@
function Actor:LyricCommand(side) function Actor:LyricCommand(side)
self:settext( Var "LyricText" ); self:settext(Var "LyricText")
self:stoptweening(); self:stoptweening()
self:shadowlengthx(0); self:shadowlengthx(0)
self:shadowlengthy(0); self:shadowlengthy(0)
self:strokecolor(Color("Outline")); self:strokecolor(Color("Outline"))
self:zoomx(clamp(SCREEN_WIDTH/(self:GetZoomedWidth()+1), 0, 1))
local Zoom = SCREEN_WIDTH/(self:GetZoomedWidth()+1); local Color = Var "LyricColor"
if( Zoom > 1 ) then Zoom = 1 end
self:zoomx( Zoom );
local Color = Var "LyricColor";
local Factor = 1 local Factor = 1
if side == "Back" then if side == "Back" then
Factor = 0.5 Factor = 0.5
elseif side == "Front" then elseif side == "Front" then
Factor = 0.9 Factor = 0.9
end end
self:diffuse( { self:diffuse({
Color[1] * Factor, Color[1] * Factor,
Color[2] * Factor, Color[2] * Factor,
Color[3] * Factor, Color[3] * Factor,
Color[4] * Factor } ) Color[4] * Factor
})
if side == "Front" then if side == "Front" then
self:cropright(1); self:cropright(1)
else else
self:cropleft(0); self:cropleft(0)
end end
self:diffusealpha(0); self:diffusealpha(0)
self:linear(0.2); self:linear(0.2)
self:diffusealpha(0.75); self:diffusealpha(0.75)
self:linear( Var "LyricDuration" * 0.75); self:linear(Var "LyricDuration" * 0.75)
if side == "Front" then if side == "Front" then
self:cropright(0); self:cropright(0)
else else
self:cropleft(1); self:cropleft(1)
end end
self:sleep( Var "LyricDuration" * 0.25 ); self:sleep(Var "LyricDuration" * 0.25)
self:linear(0.2); self:linear(0.2)
self:diffusealpha(0); self:diffusealpha(0)
end end
-- (c) 2006 Glenn Maynard -- (c) 2006 Glenn Maynard
+31 -10
View File
@@ -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 subMaxWidth = 420; -- zoom is 0.6 (multiply zoom,1 value by 1.4)
local artistMaxWidth = 300/0.8; local artistMaxWidth = 300/0.8;
--[[
-- The old (cmd(blah))(Actor) syntax is hard to read.
-- This is longer, but much easier to read. - Colby
--]]
function TextBannerAfterSet(self,param) function TextBannerAfterSet(self,param)
local Title=self:GetChild("Title"); local Title = self:GetChild("Title")
local Subtitle=self:GetChild("Subtitle"); local Subtitle = self:GetChild("Subtitle")
local Artist=self:GetChild("Artist"); local Artist = self:GetChild("Artist")
if Subtitle:GetText() == "" then if Subtitle:GetText() == "" then
(cmd(maxwidth,mainMaxWidth;y,-8;zoom,1;))(Title); Title:maxwidth(mainMaxWidth)
(cmd(visible,false))(Subtitle); Title:y(-8)
(cmd(zoom,0.66;maxwidth,artistMaxWidth;y,8))(Artist); Title:zoom(1)
-- hide so that the game skips drawing.
Subtitle:visible(false)
Artist:zoom(0.66)
Artist:maxwidth(artistMaxWidth)
Artist:y(8)
else else
-- subtitle below Title:maxwidth(mainMaxWidth*1.25)
(cmd(maxwidth,mainMaxWidth*1.25;y,-11;zoom,0.75;))(Title); Title:y(-11)
(cmd(visible,true;zoom,0.6;y,0;maxwidth,subMaxWidth))(Subtitle); Title:zoom(0.75)
(cmd(zoom,0.6;maxwidth,artistMaxWidth;y,10))(Artist);
-- 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
end end
+261 -354
View File
@@ -1,7 +1,6 @@
-- sm-ssc Default Theme Preferences Handler -- sm-ssc Default Theme Preferences Handler
-- Example usage of new system (not really implemented yet) -- Example usage of new system (not really implemented yet)
local Prefs = local Prefs =
{ {
AutoSetStyle = AutoSetStyle =
@@ -10,227 +9,169 @@ local Prefs =
Choices = { "ON", "OFF" }, Choices = { "ON", "OFF" },
Values = { true, false } Values = { true, false }
}, },
}; }
ThemePrefs.InitAll( Prefs ) ThemePrefs.InitAll(Prefs)
function InitUserPrefs() function InitUserPrefs()
if GetUserPref("UserPrefGameplayShowStepsDisplay") == nil then local Prefs = {
SetUserPref("UserPrefGameplayShowStepsDisplay", true); UserPrefGameplayShowStepsDisplay = true,
end; UserPrefGameplayShowStepsDisplay = true,
if GetUserPref("UserPrefGameplayShowScore") == nil then UserPrefGameplayShowScore = false,
SetUserPref("UserPrefGameplayShowScore", false); UserPrefScoringMode = 'DDR Extreme',
end; UserPrefShowLotsaOptions = true,
if GetUserPref("UserPrefScoringMode") == nil then UserPrefAutoSetStyle = false,
SetUserPref("UserPrefScoringMode", 'DDR Extreme'); UserPrefLongFail = false,
end; UserPrefNotePosition = true,
if GetUserPrefB("UserPrefShowLotsaOptions") == nil then UserPrefComboOnRolls = false,
SetUserPref("UserPrefShowLotsaOptions", true); UserPrefProtimingP1 = false,
end; UserPrefProtimingP2 = false,
if GetUserPrefB("UserPrefAutoSetStyle") == nil then FlashyCombos = false,
SetUserPref("UserPrefAutoSetStyle", false); UserPrefComboUnderField = true,
end; UserPrefFancyUIBG = true
if GetUserPrefB("UserPrefLongFail") == nil then }
SetUserPref("UserPrefLongFail", false); for k, v in pairs(Prefs) do
end; -- kind of xxx
if GetUserPrefB("UserPrefNotePosition") == nil then local GetPref = type(v) == "boolean" and GetUserPrefB or GetUserPref
SetUserPref("UserPrefNotePosition", true); if GetPref(k) == nil then
end; SetUserPref(k, v)
if GetUserPrefB("UserPrefComboOnRolls") == nil then end
SetUserPref("UserPrefComboOnRolls", false); end
end; 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;
function GetProTiming(pn) function GetProTiming(pn)
local pname = ToEnumShortString(pn); local pname = ToEnumShortString(pn)
if GetUserPref("ProTiming"..pname) then if GetUserPref("ProTiming"..pname) then
return GetUserPrefB("ProTiming"..pname); return GetUserPrefB("ProTiming"..pname)
else else
SetUserPref("ProTiming"..pname,false); SetUserPref("ProTiming"..pname,false)
return false; return false
end; end
end; end
--[[ option rows ]] --[[ option rows ]]
-- screen cover -- screen cover
function OptionRowProTiming() function OptionRowProTiming()
local t = { local t = {
Name = "ProTiming"; Name = "ProTiming",
LayoutType = "ShowAllInRow"; LayoutType = "ShowAllInRow",
SelectType = "SelectOne"; SelectType = "SelectOne",
OneChoiceForAllPlayers = false; OneChoiceForAllPlayers = false,
ExportOnChange = false; ExportOnChange = false,
Choices = { 'Off','On' }; Choices = { 'Off','On' },
LoadSelections = function(self, list, pn) LoadSelections = function(self, list, pn)
local bShow; if GetUserPrefB("UserPrefProtiming" .. ToEnumShortString(pn)) then
if GetUserPrefB("UserPrefProtiming" .. ToEnumShortString(pn) ) then local bShow = GetUserPrefB("UserPrefProtiming" .. ToEnumShortString(pn))
bShow = GetUserPrefB("UserPrefProtiming" .. ToEnumShortString(pn) );
if bShow then if bShow then
list[2] = true; list[2] = true
else else
list[1] = true; list[1] = true
end end
else else
list[1] = true; list[1] = true
end; end
--[[ local pname = ToEnumShortString(pn); end,
if getenv("ProTiming"..pname) == true then
list[2] = true;
else
list[1] = true;
end; --]]
end;
SaveSelections = function(self, list, pn) SaveSelections = function(self, list, pn)
local bSave; local bSave = list[2] and true or false
if list[2] then SetUserPref("UserPrefProtiming" .. ToEnumShortString(pn), bSave)
bSave = true; end
else }
bSave = false; setmetatable(t, t)
end; return t
SetUserPref("UserPrefProtiming" .. ToEnumShortString(pn),bSave); end
--[[ 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;
function UserPrefGameplayShowScore() function UserPrefGameplayShowScore()
local t = { local t = {
Name = "UserPrefGameplayShowScore"; Name = "UserPrefGameplayShowScore",
LayoutType = "ShowAllInRow"; LayoutType = "ShowAllInRow",
SelectType = "SelectOne"; SelectType = "SelectOne",
OneChoiceForAllPlayers = true; OneChoiceForAllPlayers = true,
ExportOnChange = false; ExportOnChange = false,
Choices = { 'Off','On' }; Choices = { 'Off','On' },
LoadSelections = function(self, list, pn) LoadSelections = function(self, list, pn)
if ReadPrefFromFile("UserPrefGameplayShowScore") ~= nil then if ReadPrefFromFile("UserPrefGameplayShowScore") ~= nil then
if GetUserPrefB("UserPrefGameplayShowScore") then if GetUserPrefB("UserPrefGameplayShowScore") then
list[2] = true; list[2] = true
else else
list[1] = true; list[1] = true
end; end
else else
WritePrefToFile("UserPrefGameplayShowScore",false); WritePrefToFile("UserPrefGameplayShowScore", false)
list[1] = true; list[1] = true
end; end
end; end,
SaveSelections = function(self, list, pn) SaveSelections = function(self, list, pn)
local val; local val = list[2] and true or false
if list[2] then WritePrefToFile("UserPrefGameplayShowScore", val)
val = true; MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" })
else THEME:ReloadMetrics()
val = false; end
end; }
WritePrefToFile("UserPrefGameplayShowScore",val); setmetatable(t, t)
MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); return t
THEME:ReloadMetrics();
end;
};
setmetatable( t, t );
return t;
end end
function UserPrefGameplayShowStepsDisplay() function UserPrefGameplayShowStepsDisplay()
local t = { local t = {
Name = "UserPrefGameplayShowStepsDisplay"; Name = "UserPrefGameplayShowStepsDisplay",
LayoutType = "ShowAllInRow"; LayoutType = "ShowAllInRow",
SelectType = "SelectOne"; SelectType = "SelectOne",
OneChoiceForAllPlayers = true; OneChoiceForAllPlayers = true,
ExportOnChange = false; ExportOnChange = false,
Choices = { 'Off','On' }; Choices = { 'Off','On' },
LoadSelections = function(self, list, pn) LoadSelections = function(self, list, pn)
if ReadPrefFromFile("UserPrefGameplayShowStepsDisplay") ~= nil then if ReadPrefFromFile("UserPrefGameplayShowStepsDisplay") ~= nil then
if GetUserPrefB("UserPrefGameplayShowStepsDisplay") then if GetUserPrefB("UserPrefGameplayShowStepsDisplay") then
list[2] = true; list[2] = true
else else
list[1] = true; list[1] = true
end; end
else else
WritePrefToFile("UserPrefGameplayShowStepsDisplay",false); WritePrefToFile("UserPrefGameplayShowStepsDisplay", false)
list[1] = true; list[1] = true
end; end
end; end,
SaveSelections = function(self, list, pn) SaveSelections = function(self, list, pn)
local val; local val = list[2] and true or false
if list[2] then WritePrefToFile("UserPrefGameplayShowStepsDisplay", val)
val = true; MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" })
else THEME:ReloadMetrics()
val = false; end
end; }
WritePrefToFile("UserPrefGameplayShowStepsDisplay",val); setmetatable(t, t)
MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); return t
THEME:ReloadMetrics();
end;
};
setmetatable( t, t );
return t;
end end
function UserPrefShowLotsaOptions() function UserPrefShowLotsaOptions()
local t = { local t = {
Name = "UserPrefShowLotsaOptions"; Name = "UserPrefShowLotsaOptions",
LayoutType = "ShowAllInRow"; LayoutType = "ShowAllInRow",
SelectType = "SelectOne"; SelectType = "SelectOne",
OneChoiceForAllPlayers = true; OneChoiceForAllPlayers = true,
ExportOnChange = false; ExportOnChange = false,
Choices = { 'Many','Few' }; Choices = { 'Many','Few' },
LoadSelections = function(self, list, pn) LoadSelections = function(self, list, pn)
if ReadPrefFromFile("UserPrefShowLotsaOptions") ~= nil then if ReadPrefFromFile("UserPrefShowLotsaOptions") ~= nil then
if GetUserPrefB("UserPrefShowLotsaOptions") then if GetUserPrefB("UserPrefShowLotsaOptions") then
list[1] = true; list[1] = true
else else
list[2] = true; list[2] = true
end; end
else else
WritePrefToFile("UserPrefShowLotsaOptions",false); WritePrefToFile("UserPrefShowLotsaOptions", false)
list[2] = true; list[2] = true
end; end
end; end,
SaveSelections = function(self, list, pn) SaveSelections = function(self, list, pn)
local val; local val = list[1] and true or false
if list[1] then WritePrefToFile("UserPrefShowLotsaOptions", val)
val = true; MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" })
else THEME:ReloadMetrics()
val = false; end
end; }
WritePrefToFile("UserPrefShowLotsaOptions",val); setmetatable(t, t);
MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); return t
THEME:ReloadMetrics();
end;
};
setmetatable( t, t );
return t;
end end
function GetDefaultOptionLines() function GetDefaultOptionLines()
@@ -248,138 +189,122 @@ function GetDefaultOptionLines()
local function CheckCharacters(mods) local function CheckCharacters(mods)
if CHARMAN:GetCharacterCount() > 0 then if CHARMAN:GetCharacterCount() > 0 then
return mods .. ",18"; --TODO: Better line name. return mods .. ",18" --TODO: Better line name.
end end
return mods; return mods
end end
modLines = LineSets[2]; modLines = LineSets[2]
if not IsExtra() then if not IsExtra() then
modLines = GetUserPrefB("UserPrefShowLotsaOptions") modLines = GetUserPrefB("UserPrefShowLotsaOptions")
and LineSets[1] or LineSets[2]; and LineSets[1] or LineSets[2]
end end
return CheckCharacters(modLines); return CheckCharacters(modLines)
end; end
function UserPrefAutoSetStyle() function UserPrefAutoSetStyle()
local t = { local t = {
Name = "UserPrefAutoSetStyle"; Name = "UserPrefAutoSetStyle",
LayoutType = "ShowAllInRow"; LayoutType = "ShowAllInRow",
SelectType = "SelectOne"; SelectType = "SelectOne",
OneChoiceForAllPlayers = true; OneChoiceForAllPlayers = true,
ExportOnChange = false; ExportOnChange = false,
Choices = { 'Off','On' }; Choices = { 'Off','On' },
LoadSelections = function(self, list, pn) LoadSelections = function(self, list, pn)
if ReadPrefFromFile("UserPrefAutoSetStyle") ~= nil then if ReadPrefFromFile("UserPrefAutoSetStyle") ~= nil then
if GetUserPrefB("UserPrefAutoSetStyle") then if GetUserPrefB("UserPrefAutoSetStyle") then
list[2] = true; list[2] = true
else else
list[1] = true; list[1] = true
end; end
else else
WritePrefToFile("UserPrefAutoSetStyle",false); WritePrefToFile("UserPrefAutoSetStyle", false)
list[1] = true; list[1] = true
end; end
end; end,
SaveSelections = function(self, list, pn) SaveSelections = function(self, list, pn)
local val; local val = list[2] and true or false
if list[2] then WritePrefToFile("UserPrefAutoSetStyle", val)
val = true; MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } )
else THEME:ReloadMetrics()
val = false; end
end; }
WritePrefToFile("UserPrefAutoSetStyle",val); setmetatable(t, t)
MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); return t
THEME:ReloadMetrics();
end;
};
setmetatable( t, t );
return t;
end end
function UserPrefNotePosition() function UserPrefNotePosition()
local t = { local t = {
Name = "UserPrefNotePosition"; Name = "UserPrefNotePosition",
LayoutType = "ShowAllInRow"; LayoutType = "ShowAllInRow",
SelectType = "SelectOne"; SelectType = "SelectOne",
OneChoiceForAllPlayers = true; OneChoiceForAllPlayers = true,
ExportOnChange = false; ExportOnChange = false,
Choices = { 'Normal','Lower' }; Choices = { 'Normal','Lower' },
LoadSelections = function(self, list, pn) LoadSelections = function(self, list, pn)
if ReadPrefFromFile("UserPrefNotePosition") ~= nil then if ReadPrefFromFile("UserPrefNotePosition") ~= nil then
if GetUserPrefB("UserPrefNotePosition") then if GetUserPrefB("UserPrefNotePosition") then
list[1] = true; list[1] = true
else else
list[2] = true; list[2] = true
end; end
else else
WritePrefToFile("UserPrefNotePosition",false); WritePrefToFile("UserPrefNotePosition", false)
list[1] = true; list[1] = true
end; end
end; end,
SaveSelections = function(self, list, pn) SaveSelections = function(self, list, pn)
local val; local val = list[1] and true or false
if list[1] then WritePrefToFile("UserPrefNotePosition", val)
val = true; MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" })
else THEME:ReloadMetrics()
val = false; end
end; }
WritePrefToFile("UserPrefNotePosition",val); setmetatable(t, t)
MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); return t
THEME:ReloadMetrics();
end;
};
setmetatable( t, t );
return t;
end end
function UserPrefLongFail() function UserPrefLongFail()
local t = { local t = {
Name = "UserPrefLongFail"; Name = "UserPrefLongFail",
LayoutType = "ShowAllInRow"; LayoutType = "ShowAllInRow",
SelectType = "SelectOne"; SelectType = "SelectOne",
OneChoiceForAllPlayers = true; OneChoiceForAllPlayers = true,
ExportOnChange = false; ExportOnChange = false,
Choices = { 'Short','Long' }; Choices = { 'Short','Long' },
LoadSelections = function(self, list, pn) LoadSelections = function(self, list, pn)
if ReadPrefFromFile("UserPrefLongFail") ~= nil then if ReadPrefFromFile("UserPrefLongFail") ~= nil then
if GetUserPrefB("UserPrefLongFail") then if GetUserPrefB("UserPrefLongFail") then
list[2] = true; list[2] = true
else else
list[1] = true; list[1] = true
end; end
else else
WritePrefToFile("UserPrefLongFail",false); WritePrefToFile("UserPrefLongFail", false)
list[1] = true; list[1] = true
end; end
end; end,
SaveSelections = function(self, list, pn) SaveSelections = function(self, list, pn)
local val; local val = list[2] and true or false
if list[2] then WritePrefToFile("UserPrefLongFail", val)
val = true; MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } )
else THEME:ReloadMetrics()
val = false; end
end; }
WritePrefToFile("UserPrefLongFail",val); setmetatable(t, t)
MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); return t
THEME:ReloadMetrics();
end;
};
setmetatable( t, t );
return t;
end end
function UserPrefComboOnRolls() function UserPrefComboOnRolls()
local t = { local t = {
Name = "UserPrefComboOnRolls"; Name = "UserPrefComboOnRolls",
LayoutType = "ShowAllInRow"; LayoutType = "ShowAllInRow",
SelectType = "SelectOne"; SelectType = "SelectOne",
OneChoiceForAllPlayers = true; OneChoiceForAllPlayers = true,
ExportOnChange = false; ExportOnChange = false,
Choices = { 'Off','On' }; Choices = { 'Off','On' },
LoadSelections = function(self, list, pn) LoadSelections = function(self, list, pn)
if ReadPrefFromFile("UserPrefComboOnRolls") ~= nil then if ReadPrefFromFile("UserPrefComboOnRolls") ~= nil then
if GetUserPrefB("UserPrefComboOnRolls") then if GetUserPrefB("UserPrefComboOnRolls") then
@@ -391,130 +316,112 @@ function UserPrefComboOnRolls()
WritePrefToFile("UserPrefComboOnRolls",false); WritePrefToFile("UserPrefComboOnRolls",false);
list[1] = true; list[1] = true;
end; end;
end; end,
SaveSelections = function(self, list, pn) SaveSelections = function(self, list, pn)
local val; local val = list[2] and true or false
if list[2] then WritePrefToFile("UserPrefComboOnRolls", val)
val = true; MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" })
else THEME:ReloadMetrics()
val = false; end
end; }
WritePrefToFile("UserPrefComboOnRolls",val); setmetatable(t, t)
MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); return t
THEME:ReloadMetrics();
end;
};
setmetatable( t, t );
return t;
end end
function UserPrefFlashyCombo() function UserPrefFlashyCombo()
local t = { local t = {
Name = "UserPrefFlashyCombo"; Name = "UserPrefFlashyCombo",
LayoutType = "ShowAllInRow"; LayoutType = "ShowAllInRow",
SelectType = "SelectOne"; SelectType = "SelectOne",
OneChoiceForAllPlayers = true; OneChoiceForAllPlayers = true,
ExportOnChange = false; ExportOnChange = false,
Choices = { 'Off','On' }; Choices = { 'Off','On' },
LoadSelections = function(self, list, pn) LoadSelections = function(self, list, pn)
if ReadPrefFromFile("UserPrefFlashyCombo") ~= nil then if ReadPrefFromFile("UserPrefFlashyCombo") ~= nil then
if GetUserPrefB("UserPrefFlashyCombo") then if GetUserPrefB("UserPrefFlashyCombo") then
list[2] = true; list[2] = true
else else
list[1] = true; list[1] = true
end; end
else else
WritePrefToFile("UserPrefFlashyCombo",false); WritePrefToFile("UserPrefFlashyCombo", false)
list[1] = true; list[1] = true
end; end
end; end,
SaveSelections = function(self, list, pn) SaveSelections = function(self, list, pn)
local val; local val = list[2] and true or false
if list[2] then WritePrefToFile("UserPrefFlashyCombo", val)
val = true; MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" })
else THEME:ReloadMetrics()
val = false; end
end; }
WritePrefToFile("UserPrefFlashyCombo",val); setmetatable(t, t)
MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); return t
THEME:ReloadMetrics();
end;
};
setmetatable( t, t );
return t;
end end
function UserPrefComboUnderField() function UserPrefComboUnderField()
local t = { local t = {
Name = "UserPrefComboUnderField"; Name = "UserPrefComboUnderField",
LayoutType = "ShowAllInRow"; LayoutType = "ShowAllInRow",
SelectType = "SelectOne"; SelectType = "SelectOne",
OneChoiceForAllPlayers = true; OneChoiceForAllPlayers = true,
ExportOnChange = false; ExportOnChange = false,
Choices = { 'Off','On' }; Choices = { 'Off','On' },
LoadSelections = function(self, list, pn) LoadSelections = function(self, list, pn)
if ReadPrefFromFile("UserPrefComboUnderField") ~= nil then if ReadPrefFromFile("UserPrefComboUnderField") ~= nil then
if GetUserPrefB("UserPrefComboUnderField") then if GetUserPrefB("UserPrefComboUnderField") then
list[2] = true; list[2] = true
else else
list[1] = true; list[1] = true
end; end
else else
WritePrefToFile("UserPrefComboUnderField",true); WritePrefToFile("UserPrefComboUnderField", true)
list[2] = true; list[2] = true
end; end
end; end,
SaveSelections = function(self, list, pn) SaveSelections = function(self, list, pn)
local val; local val = list[2] and true or false
if list[2] then WritePrefToFile("UserPrefComboUnderField", val)
val = true; MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" })
else THEME:ReloadMetrics()
val = false; end
end; }
WritePrefToFile("UserPrefComboUnderField",val); setmetatable(t, t)
MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } );
THEME:ReloadMetrics();
end;
};
setmetatable( t, t );
return t; return t;
end end
function UserPrefFancyUIBG() function UserPrefFancyUIBG()
local t = { local t = {
Name = "UserPrefFancyUIBG"; Name = "UserPrefFancyUIBG",
LayoutType = "ShowAllInRow"; LayoutType = "ShowAllInRow",
SelectType = "SelectOne"; SelectType = "SelectOne",
OneChoiceForAllPlayers = true; OneChoiceForAllPlayers = true,
ExportOnChange = false; ExportOnChange = false,
Choices = { Choices = {
THEME:GetString('OptionNames','On'), THEME:GetString('OptionNames','On'),
THEME:GetString('OptionNames','Off') THEME:GetString('OptionNames','Off')
}; },
LoadSelections = function(self, list, pn) LoadSelections = function(self, list, pn)
if ReadPrefFromFile("UserPrefFancyUIBG") ~= nil then if ReadPrefFromFile("UserPrefFancyUIBG") ~= nil then
if GetUserPrefB("UserPrefFancyUIBG") then if GetUserPrefB("UserPrefFancyUIBG") then
list[1] = true; list[1] = true
else else
list[2] = true; list[2] = true
end; end
else else
WritePrefToFile("UserPrefFancyUIBG",true); WritePrefToFile("UserPrefFancyUIBG", true)
list[1] = true; list[1] = true
end; end
end; end,
SaveSelections = function(self, list, pn) SaveSelections = function(self, list, pn)
local val; local val = list[1] and true or false
if list[1] then val = true; WritePrefToFile("UserPrefFancyUIBG", val)
else val = false; MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" })
end; THEME:ReloadMetrics()
WritePrefToFile("UserPrefFancyUIBG",val); end
MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); }
THEME:ReloadMetrics(); setmetatable(t, t)
end; return t
};
setmetatable( t, t );
return t;
end end
--[[ end option rows ]] --[[ end option rows ]]