continuing the process of moving theme preferences to the new format. still haven't handled protiming, screen filter, or scoring system yet.

This commit is contained in:
AJ Kelly
2011-12-27 20:27:18 -06:00
parent 3565bc0b93
commit 448f64fc37
7 changed files with 32 additions and 401 deletions
@@ -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
@@ -1,4 +1,4 @@
local longFail = GetUserPrefB("UserPrefLongFail");
local longFail = ThemePrefs.Get("LongFail");
local t = Def.ActorFrame{};
@@ -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");
@@ -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
@@ -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);
@@ -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);
+18 -392
View File
@@ -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 ]]