[sm130score] Possibly bad commit, but need a record.

This commit will be reverted if required.
This commit is contained in:
Jason Felds
2011-04-10 22:44:23 -04:00
parent 7597c5d867
commit e6d3881e8a
3 changed files with 40 additions and 4 deletions
@@ -139,3 +139,39 @@ ThemePrefs =
-- global aliases
GetThemePref = ThemePrefs.Get
SetThemePref = ThemePrefs.Set
-- bring in SpecialScoring from default.
function InitUserPrefs()
if GetUserPref("UserPrefSpecialScoringMode") == nil then
SetUserPref("UserPrefSpecialScoringMode", 'DDR Extreme');
end;
function UserPrefSpecialScoringMode()
local baseChoices = { 'DDR 1stMIX', 'DDR 4thMIX', 'DDR Extreme', 'DDR SuperNOVA', 'DDR SuperNOVA 2', 'MIGS' }; --'[SSC] Radar Master'
local t = {
Name = "UserPrefSpecialScoringMode";
LayoutType = "ShowAllInRow";
SelectType = "SelectOne";
OneChoiceForAllPlayers = true;
ExportOnChange = false;
Choices = baseChoices;
LoadSelections = function(self, list, pn)
if ReadPrefFromFile("UserPrefSpecialScoringMode") ~= nil then
local theValue = ReadPrefFromFile("UserPrefSpecialScoringMode");
local success = false;
for k,v in ipairs(baseChoices) do if v == theValue then list[k] = true success = true break end end;
if success == false then list[1] = true end;
else
WritePrefToFile("UserPrefSpecialScoringMode", 'DDR Extreme');
list[1] = true;
end;
end;
SaveSelections = function(self, list, pn)
for k,v in ipairs(list) do if v then WritePrefToFile("UserPrefSpecialScoringMode", baseChoices[k]) break end end;
end;
};
setmetatable( t, t );
return t;
end