Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ThemePrefs.InitAll(Prefs)
- function InitUserPrefs()
- local Prefs = {
- USWUseDefaultColour = true,
- USWNoteskin4thRed = '255'
- }
- 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;
- local tChoices = {};
- for i=1,256 do tChoices[i] = i; end;
- -- what the fuck am I doing - Jousway
- function USWUseDefaultColour()
- local t = {
- Name = "USWUseDefaultColour";
- LayoutType = "ShowAllInRow";
- SelectType = "SelectOne";
- OneChoiceForAllPlayers = true;
- ExportOnChange = false;
- Choices = { 'True','False' };
- LoadSelections = function(self, list, pn)
- if ReadPrefFromFile("USWUseDefaultColour") ~= nil then
- if GetUserPrefB("USWUseDefaultColour") then
- list[2] = true;
- else
- list[1] = true;
- end;
- else
- WritePrefToFile("USWUseDefaultColour",false);
- list[1] = true;
- end;
- end;
- SaveSelections = function(self, list, pn)
- local val;
- if list[2] then
- val = true;
- else
- val = false;
- end;
- WritePrefToFile("USWUseDefaultColour",val);
- MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } );
- THEME:ReloadMetrics();
- end;
- };
- setmetatable( t, t );
- return t;
- end;
- -- I dont even... *flips table*
- function USWNoteskin4thRed()
- local t = {
- Name = "USWNoteskin4thRed";
- LayoutType = "ShowAllInRow";
- SelectType = "SelectOne";
- OneChoiceForAllPlayers = true;
- ExportOnChange = true;
- Choices = tChoices;
- LoadSelections = function(self, list, pn)
- if ReadPrefFromFile("USWNoteskin4thRed") ~= nil then
- if GetUserPrefB("USWNoteskin4thRed") then
- list = val
- end;
- end;
- end;
- SaveSelections = function(self, list, pn)
- local val = list;
- WritePrefToFile("USWNoteskin4thRed",val);
- end;
- };
- setmetatable(t, t);
- return t;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement