DefaultFailType=Fail Type
Theme=Swap Theme
SpeedModType=Speed Mods
+CustomMods=Custom Mods
GoodLuckCameron=Good Luck Cameron
ProfileTable = PROFILEMAN:GetMachineProfile():GetSaved()
end
--- This function originally written by Marc Cannon ("Vyhd")
+-- This function written by Marc Cannon ("Vyhd")
function CreateOptionRow( Params, Names, LoadFctn, SaveFctn )
if not Params.Name then return nil end
return t
end
--- creates a row list given a list of names and values
-function CreateProfileRow( Params, Values )
- local pref = ProfileTable[Params.Name]
+function CreateGenericOptionRow( Params, Choices, Values )
+ local function Load(self, list, pn)
+ for i=1,table.getn(Choices) do
+ list[i] = Params.LoadCallback(list[i], Values[i], pn)
- local function Load(self, list, pn)
- -- what we're doing here is checking what we got from profileman against the valid names.
- for i=1,table.getn(Values) do
- if pref == Values[i] then list[i] = true return end
- end
+ if Params.SelectType ~= "SelectMultiple" and list[i] then return end
+ end
- if Params.Default then list[Params.Default] = true else list[1] = true end
+ if Params.Default then list[Params.Default] = true else list[1] = true SCREENMAN:SystemMessage("here") end
end
local function Save(self, list, pn)
- -- go through each item in the list and save the first one that is set to true
- for i=1,table.getn(Values) do
- if list[i] then
- ProfileTable[Params.Name] = Values[i]
- PROFILEMAN:SaveMachineProfile()
- return
- end
+ for i=1,table.getn(Choices) do
+ Params.SaveCallback(list[i], Values[i], pn)
end
end
- return CreateOptionRow( Params, Values, Load, Save )
+ return CreateOptionRow( Params, Choices, Load, Save )
+end
+
+-- creates a row list given a list of names and values
+function CreateProfileRow( Params, Choices, Values )
+ local pref = ProfileTable[Params.Name]
+
+ Params.LoadCallback = function(List, Value) if Params.SekectType ~= "SelectMultiple" then return Value == pref else return pref[Value] end end
+ Params.SaveCallback = function(List, Value)
+ if Params.SelectType ~= "SelectMultiple" and List then ProfileTable[Params.Name] = Value PROFILEMAN:SaveMachineProfile() return end
+ if Params.SelectType == "SelectMultiple" then
+ if type(ProfileTable[Params.Name]) ~= "table" then ProfileTable[Params.Name] = {} end
+ ProfileTable[Params.Name][Value] = List
+ PROFILEMAN:SaveMachineProfile()
+ end
+ end
+
+ return CreateGenericOptionRow( Params, Choices, Values )
end
function CreateProfileRowBool( Params )
- local choices = {"OFF", "ON"}
-
- local function Load(self, list, pn)
- if ProfileTable[Params.Name] then list[2] = true else list[1] = true end
- end
-
- local function Save(self, list, pn)
- if list[1] then ProfileTable[Params.Name] = false else ProfileTable[Params.Name] = true end
- PROFILEMAN:SaveMachineProfile()
- return
- end
- return CreateOptionRow( Params, choices, Load, Save )
+ local Choices = {"OFF", "ON"}
+ local Values = {false, true}
+ return CreateProfileRow( Params, Choices, Values )
end
function GetProfilePref(Name)
local Names = { "Basic", "Advanced", "Pro" }\r
\r
function SpeedModTypeRow()\r
- return CreateProfileRow( { Name = "SpeedModType", Default = 3 }, Names )\r
+ return CreateProfileRow( { Name = "SpeedModType", Default = 3 }, Names, Names )\r
end\r
\r
function GetSpeedModRowType()\r
--- /dev/null
+-- For tracking applied mods
+local AppliedModsTable = {}
+
+-- For resetting mods
+local WasInOptions = {PLAYER_1 = false, PLAYER_2 = false}
+
+-- Holds the mods
+local ModsTable = {}
+
+function RegisterCustomMod(Name, fn, Params, Choices)
+ assert(ModsTable[Name] == nil, "Cannot re-register custom mod" .. Name)
+ Params.Name = Name
+ ModsTable[Name] = { ["Params"] = Params, ["Choices"] = Choices, Callback = fn }
+
+ if not AppliedModsTable[PLAYER_1] then AppliedModsTable[PLAYER_1] = {} end
+ if not AppliedModsTable[PLAYER_2] then AppliedModsTable[PLAYER_2] = {} end
+
+ AppliedModsTable[PLAYER_1][Name] = false
+ AppliedModsTable[PLAYER_2][Name] = false
+end
+
+function CustomModOptionRow(Name)
+ local Choices = ModsTable[Name].Choices
+ local Params = ModsTable[Name].Params
+
+ Params.LoadCallback = function(List, Value, pn)
+ WasInOptions[pn] = true
+
+ -- If this is the first round, reset the skin as it may still be set from earlier
+ --if GetStageText() == "1" then AppliedModsTable[pn][Name] = nil end
+ if AppliedModsTable[pn][Name] then Trace("MODSTABLE IS " ..AppliedModsTable[pn][Name]) end
+ return AppliedModsTable[pn][Name] == Value
+ end
+
+ Params.SaveCallback = function(List, Value, pn) if List then AppliedModsTable[pn][Name] = Value end end
+
+ return CreateGenericOptionRow( Params, Choices, Choices )
+end
+
+function DoCustomMod(Name, pn, Params)
+ --if this is the first stage and the user was NOT in the options, reset the mod to default
+ if GetStageText() == "1" and not WasInOptions[pn] then AppliedModsTable[pn][Name] = nil end
+
+ if AppliedModsTable[pn][Name] ~= nil then Params.Value = AppliedModsTable[pn][Name] return ModsTable[Name].Callback(Params) end
+
+ WasInOptions[pn] = false
+end
+
+function CustomModsServiceOptionRow()
+ local Choices = {}
+ local Params = { Name = "CustomMods", SelectType = "SelectMultiple" }
+
+ for ModName,ModValue in pairs(ModsTable) do
+ table.insert(Choices, ModName)
+ end
+
+ return CreateProfileRow(Params, Choices, Choices)
+end
+
+function CustomModLines()
+
+end
+
+
+
end
function oitgACoptions()
- local OptionLines = "1,2,3,4,5,6,7,8,9,10,11,12"
+ local OptionLines = "1,2,3,4,5,6,7,8,9,10,11,12,13"
- if EasterEggsEnabled() then OptionLines = OptionLines .. ",13" end
+ if EasterEggsEnabled() then OptionLines = OptionLines .. ",14" end
return OptionLines
end
function SongModifiers()
-- this is very basic right now, but it can be modified to take in to account OITG specific stuff
- return SpeedLines() .. "4,5,25,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24"
+ return SpeedLines() .. "4,5,25,26,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24"
end
function SpeedLines()
RegisterGlobalCallback("TotalTimeMinutes", TotalTimeMinutes)
RegisterGlobalCallback("TotalTimeSeconds", TotalTimeSeconds)
+-- custom mods
+local function LoadJudgeSkin(Params)
+ Params.Actor:Load( THEME:GetPath( EC_GRAPHICS, '', '_Judgements/' .. Params.Value ))
+end
+
+local function DummyCallback(Params)
+ return true
+end
+
+RegisterCustomMod( "JudgeSkin", LoadJudgeSkin, { OneChoiceForAllPlayers = false, LineNumber = 25 }, { "GrooveNights", "Love", "Tactics", "Chromatic", "Deco", "FP", "ITG2" } )
+RegisterCustomMod( "DummyMod", DummyCallback, { OneChoiceForAllPlayers = false, LineNumber = 26 }, { "Yolo", "Swag", "Young", "Money", "Cash", "Money" } )
+
--actor setters
function SetFromDisplayScrollSpeed( Actor, pn )
local Params = { Name = "GoodLuckCameron" }
return CreateProfileRowBool( Params )
end
-
-function gnJudgementSkinsOptionRow()
- local Names = { "GrooveNights", "Love", "Tactics", "Chromatic", "Deco", "FP", "ITG2" }
- return JudgeSkinOptionsRow(Names, "GrooveNights")
-end
\ No newline at end of file
CombinedLifeY=SCREEN_TOP+54
CombinedLifeOnCommand=addy,-100;addy,+100
CombinedLifeOffCommand=
-PlayerP1OnCommand=%function(self) LoadSkin(self:GetChild('Judgment'):GetChild(''), PLAYER_1) end
-PlayerP2OnCommand=%function(self) LoadSkin(self:GetChild('Judgment'):GetChild(''), PLAYER_2) end
+PlayerP1OnCommand=%function(self) DoCustomMod("JudgeSkin", PLAYER_1, { Actor = self:GetChild('Judgment'):GetChild('') } )end
+PlayerP2OnCommand=%function(self) DoCustomMod("JudgeSkin", PLAYER_2, { Actor = self:GetChild('Judgment'):GetChild('') } )end
[ScreenGameplayTraining]
Fallback=ScreenGameplay
Line10=conf,Theme
Line11=lua,SpeedModTypeRow()
Line12=lua,EasterEggsOptionsRow()
-Line13=lua,GoodLuckCameronOptionsRow()
+Line13=lua,CustomModsServiceOptionRow()
+Line14=lua,GoodLuckCameronOptionsRow()
[ScreenGraphicOptions]
Fallback=ScreenOptionsSubmenu
Line3=lua,SpeedMods('Type')
Line4=list,Persp
Line5=lua,RateMods()
-Line25=lua,gnJudgementSkinsOptionRow()
+Line25=lua,CustomModOptionRow('JudgeSkin')
+Line26=lua,CustomModOptionRow('DummyMod')
Line6=list,NoteSkins2
Line7=list,Accel
Line8=list,Mini