From 7626985b70a067bf9f52616bf9956510419e044d Mon Sep 17 00:00:00 2001 From: Museus Date: Fri, 30 Sep 2022 18:14:35 -0400 Subject: [PATCH 1/2] build(deps): update ModUtil from 2021Jun30 to v2.7.0 --- ModUtil | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ModUtil b/ModUtil index 6a98494..8c67846 160000 --- a/ModUtil +++ b/ModUtil @@ -1 +1 @@ -Subproject commit 6a98494b82f80fdfbb785395acc7bc7689327279 +Subproject commit 8c678461717ab7972675ace28851e8e65d63fd82 From 4aefe8a4b4e5673d3eaabc5aedde7383acf6366d Mon Sep 17 00:00:00 2001 From: Kenorah Date: Sat, 29 Oct 2022 18:52:14 +1100 Subject: [PATCH 2/2] refactor(deprecated): update ModUtil calls to newest version Fix: #80 --- Colorblind/colorblind.lua | 28 +++++++++---------- DoorVisualIndicators/DoorVisualIndicators.lua | 6 ++-- EmoteMod/EmoteMod.lua | 2 +- ErumiUILib/ErumiUILib.lua | 2 +- HadesSpeedrunningModpack/HSMConfigMenu.lua | 4 +-- .../HadesSpeedrunningModpack.lua | 4 +-- HadesSpeedrunningModpack/RngBalanceMenu.lua | 10 +++---- HadesSpeedrunningModpack/SettingsHashMenu.lua | 4 +-- InteractableChaos/InteractableChaos.lua | 8 +++--- LootChoiceExt/LootChoiceExt.lua | 10 +++---- MinibossControl/MinibossControl.lua | 16 +++++------ ModConfigMenu/ModConfigMenu.lua | 6 ++-- ModdedWarning/ModdedWarning.lua | 2 +- PrintUtil/PrintUtil.lua | 2 +- QuickRestart/QuickRestart.lua | 14 +++++----- RemoveCutscenes/RemoveCutscenes.lua | 6 ++-- RoomDeterminism/RoomDeterminism.lua | 10 +++---- RtaTimer/RtaTimer.lua | 8 +++--- SatyrSackControl/SatyrSackControl.lua | 8 +++--- ShowChamberNumber/ShowChamberNumber.lua | 8 +++--- ThanatosControl/ThanatosControl.lua | 8 +++--- 21 files changed, 83 insertions(+), 83 deletions(-) diff --git a/Colorblind/colorblind.lua b/Colorblind/colorblind.lua index 4d07906..5c31f33 100644 --- a/Colorblind/colorblind.lua +++ b/Colorblind/colorblind.lua @@ -1,4 +1,4 @@ -ModUtil.RegisterMod("ColorblindMod") +ModUtil.Mod.Register("ColorblindMod") local config = { @@ -98,7 +98,7 @@ function IsOutlineLegal(enemy) return true end -ModUtil.WrapBaseFunction("CreateLevelDisplay", function ( baseFunc, newEnemy, currentRun ) +ModUtil.Path.Wrap("CreateLevelDisplay", function ( baseFunc, newEnemy, currentRun ) local biome = CurrentRun.CurrentRoom.RoomSetName if ColorblindMod.config[(biome or "nil") .. "Enabled"] and IsOutlineLegal(newEnemy) then @@ -109,7 +109,7 @@ ModUtil.WrapBaseFunction("CreateLevelDisplay", function ( baseFunc, newEnemy, cu baseFunc(newEnemy, currentRun) end, ColorblindMod) -ModUtil.BaseOverride("DoEnemyHealthBufferDeplete", function ( enemy ) +ModUtil.Path.Override("DoEnemyHealthBufferDeplete", function ( enemy ) if enemy.OnHealthBufferDepleteFunctionName ~= nil then _G[enemy.OnHealthBufferDepleteFunctionName]( enemy ) end @@ -131,7 +131,7 @@ ModUtil.BaseOverride("DoEnemyHealthBufferDeplete", function ( enemy ) end, ColorblindMod) OnAnyLoad{function () - local biome = ModUtil.SafeGet(_G, ModUtil.PathToIndexArray("CurrentRun.CurrentRoom.RoomSetName")) + local biome = ModUtil.IndexArray.Get(_G, ModUtil.Path.IndexArray("CurrentRun.CurrentRoom.RoomSetName")) while ColorblindMod.config[(biome or "nil") .. "Enabled"] do local ammoIds = GetIdsByType({ Name = "AmmoPack" }) if ammoIds ~= nil then @@ -145,52 +145,52 @@ OnAnyLoad{function () end end} -ModUtil.WrapBaseFunction( "HarpyKillPresentation", function(baseFunc, unit, args) +ModUtil.Path.Wrap( "HarpyKillPresentation", function(baseFunc, unit, args) RemoveOutline({ Id = unit.ObjectId}) return baseFunc(unit, args) end) -ModUtil.WrapBaseFunction( "HydraKillPresentation", function(baseFunc, unit, args) +ModUtil.Path.Wrap( "HydraKillPresentation", function(baseFunc, unit, args) RemoveOutline({ Id = unit.ObjectId}) return baseFunc(unit, args) end) -ModUtil.WrapBaseFunction( "HydraKillPresentation", function(baseFunc, unit, args) +ModUtil.Path.Wrap( "HydraKillPresentation", function(baseFunc, unit, args) RemoveOutline({ Id = unit.ObjectId}) return baseFunc(unit, args) end) -ModUtil.WrapBaseFunction( "TheseusMinotaurKillPresentation", function(baseFunc, unit, args) +ModUtil.Path.Wrap( "TheseusMinotaurKillPresentation", function(baseFunc, unit, args) RemoveOutline({ Id = unit.ObjectId}) return baseFunc(unit, args) end) -ModUtil.WrapBaseFunction( "CrawlerMiniBossKillPresentation", function(baseFunc, unit, args) +ModUtil.Path.Wrap( "CrawlerMiniBossKillPresentation", function(baseFunc, unit, args) RemoveOutline({ Id = unit.ObjectId}) return baseFunc(unit, args) end) -ModUtil.WrapBaseFunction( "HadesKillPresentation", function(baseFunc, unit, args) +ModUtil.Path.Wrap( "HadesKillPresentation", function(baseFunc, unit, args) RemoveOutline({ Id = unit.ObjectId}) return baseFunc(unit, args) end) -ModUtil.WrapBaseFunction( "KillPresentation", function(baseFunc, victim, args) +ModUtil.Path.Wrap( "KillPresentation", function(baseFunc, victim, args) RemoveOutline({ Id = victim.ObjectId}) return baseFunc(victim, args) end) -ModUtil.WrapBaseFunction( "DeathPresentation", function(baseFunc, currentRun, killer, killingUnitWeapon ) +ModUtil.Path.Wrap( "DeathPresentation", function(baseFunc, currentRun, killer, killingUnitWeapon ) RemoveOutline({ Id = currentRun.Hero.ObjectId}) return baseFunc(currentRun, killer, killingUnitWeapon ) end) -ModUtil.WrapBaseFunction( "BoatToDeathAreaTransition", function(baseFunc, unit, args) +ModUtil.Path.Wrap( "BoatToDeathAreaTransition", function(baseFunc, unit, args) RemoveOutline({ Id = CurrentRun.Hero.ObjectId}) return baseFunc(unit, args) end) -ModUtil.WrapBaseFunction( "SurfaceDeathPresentation", function(baseFunc, unit, args) +ModUtil.Path.Wrap( "SurfaceDeathPresentation", function(baseFunc, unit, args) RemoveOutline({ Id = CurrentRun.Hero.ObjectId}) return baseFunc(unit, args) end) diff --git a/DoorVisualIndicators/DoorVisualIndicators.lua b/DoorVisualIndicators/DoorVisualIndicators.lua index 021699a..4a49a5b 100644 --- a/DoorVisualIndicators/DoorVisualIndicators.lua +++ b/DoorVisualIndicators/DoorVisualIndicators.lua @@ -1,4 +1,4 @@ -ModUtil.RegisterMod("DoorVisualIndicators") +ModUtil.Mod.Register("DoorVisualIndicators") local config = { ModName = "Door Visual Indicators", @@ -42,10 +42,10 @@ DoorVisualIndicators.MiniBossAnimations = { D_MiniBoss04 = {"EnemyStyxThiefIdle"}, } -ModUtil.WrapBaseFunction("CreateDoorPreviewIcon", function ( baseFunc, exitDoor, args ) +ModUtil.Path.Wrap("CreateDoorPreviewIcon", function ( baseFunc, exitDoor, args ) baseFunc(exitDoor, args) - local room_name = ModUtil.PathGet('RoomData.Name', args) or "" + local room_name = ModUtil.Path.Get('RoomData.Name', args) or "" local is_miniboss = RoomData[room_name].IsMiniBossRoom or false -- If the room is a fountain, add a visual effect to the door icon diff --git a/EmoteMod/EmoteMod.lua b/EmoteMod/EmoteMod.lua index 3c28e07..0e7bbd3 100644 --- a/EmoteMod/EmoteMod.lua +++ b/EmoteMod/EmoteMod.lua @@ -1,4 +1,4 @@ -ModUtil.RegisterMod("EmoteMod") +ModUtil.Mod.Register("EmoteMod") local config = { ModName = "EmoteMod", diff --git a/ErumiUILib/ErumiUILib.lua b/ErumiUILib/ErumiUILib.lua index e70051e..bcb56b4 100644 --- a/ErumiUILib/ErumiUILib.lua +++ b/ErumiUILib/ErumiUILib.lua @@ -1,4 +1,4 @@ -ModUtil.RegisterMod("ErumiUILib") +ModUtil.Mod.Register("ErumiUILib") ErumiUILib = { Slider = {}, Dropdown = {}, diff --git a/HadesSpeedrunningModpack/HSMConfigMenu.lua b/HadesSpeedrunningModpack/HSMConfigMenu.lua index 1e551d9..6b72a3c 100644 --- a/HadesSpeedrunningModpack/HSMConfigMenu.lua +++ b/HadesSpeedrunningModpack/HSMConfigMenu.lua @@ -47,14 +47,14 @@ function HSMConfigMenu.SaveSettingsToGlobal() HSMConfigMenu_SavedPersonalization.ModdedWarningColor = ModdedWarning.config.Color end -ModUtil.WrapBaseFunction("UnfreezePlayerUnit", function ( baseFunc, flag ) +ModUtil.Path.Wrap("UnfreezePlayerUnit", function ( baseFunc, flag ) DebugPrint({Text="This is in the wrapper"}) HSMConfigMenu.SaveSettingsToGlobal() baseFunc(flag) end, HSMConfigMenu) OnAnyLoad{function() - if ModUtil.PathGet("CurrentDeathAreaRoom") then + if ModUtil.Path.Get("CurrentDeathAreaRoom") then HSMConfigMenu.updateRulesetHashDisplay() end end} diff --git a/HadesSpeedrunningModpack/HadesSpeedrunningModpack.lua b/HadesSpeedrunningModpack/HadesSpeedrunningModpack.lua index 5f7d0ba..9653be1 100644 --- a/HadesSpeedrunningModpack/HadesSpeedrunningModpack.lua +++ b/HadesSpeedrunningModpack/HadesSpeedrunningModpack.lua @@ -1,7 +1,7 @@ -ModUtil.RegisterMod("HadesSpeedrunningModpack") +ModUtil.Mod.Register("HadesSpeedrunningModpack") config = { Version = "v1.2.0" } HadesSpeedrunningModpack.config = config -ModUtil.RegisterMod("HSMConfigMenu") +ModUtil.Mod.Register("HSMConfigMenu") diff --git a/HadesSpeedrunningModpack/RngBalanceMenu.lua b/HadesSpeedrunningModpack/RngBalanceMenu.lua index 0e373e1..df36772 100644 --- a/HadesSpeedrunningModpack/RngBalanceMenu.lua +++ b/HadesSpeedrunningModpack/RngBalanceMenu.lua @@ -1,6 +1,6 @@ HSMConfigMenu__UpdateGenericConfigCheckbox = function(screen, button) local radioButtonValue = "RadioButton_Unselected" - if ModUtil.SafeGet(_G, ModUtil.PathToIndexArray(button.Config)) then + if ModUtil.IndexArray.Get(_G, ModUtil.Path.IndexArray(button.Config)) then radioButtonValue = "RadioButton_Selected" end SetThingProperty({ @@ -27,13 +27,13 @@ function HSMConfigMenu__ToggleGenericConfigCheckBox(screen, button, overrideValu if button.Enabled == false then return end - local configPathArray = ModUtil.PathToIndexArray(button.Config) - local configValue = ModUtil.SafeGet(_G, configPathArray) + local configPathArray = ModUtil.Path.IndexArray(button.Config) + local configValue = ModUtil.IndexArray.Get(_G, configPathArray) if configValue ~= nil then if overrideValue ~= nil then - ModUtil.SafeSet(_G, configPathArray, overrideValue) + ModUtil.IndexArray.Set(_G, configPathArray, overrideValue) else - ModUtil.SafeSet(_G, configPathArray, not configValue) + ModUtil.IndexArray.Set(_G, configPathArray, not configValue) end HSMConfigMenu__UpdateGenericConfigCheckbox(screen, button) end diff --git a/HadesSpeedrunningModpack/SettingsHashMenu.lua b/HadesSpeedrunningModpack/SettingsHashMenu.lua index 22a0ddf..f0f18cc 100644 --- a/HadesSpeedrunningModpack/SettingsHashMenu.lua +++ b/HadesSpeedrunningModpack/SettingsHashMenu.lua @@ -237,7 +237,7 @@ end function GetConfigBits(parentTable, config) for i, val in ipairs(config.Values) do - local currentConfigVal = ModUtil.SafeGet(parentTable, ModUtil.PathToIndexArray(config.Key)) + local currentConfigVal = ModUtil.IndexArray.Get(parentTable, ModUtil.Path.IndexArray(config.Key)) if currentConfigVal == nil then currentConfigVal = config.Default -- One liner will not work for boolean values as it will be interpreted as a logical or end @@ -256,7 +256,7 @@ function SetConfigBits(parentTable, config, configBits) setValue = config.Default -- One liner will not work for boolean values as it will be interpreted as a logical or end - ModUtil.SafeSet(parentTable, ModUtil.PathToIndexArray(config.Key), setValue) + ModUtil.IndexArray.Set(parentTable, ModUtil.Path.IndexArray(config.Key), setValue) end function CalculateHash(settings, parentTable) diff --git a/InteractableChaos/InteractableChaos.lua b/InteractableChaos/InteractableChaos.lua index 5b1dd18..d7b7d62 100644 --- a/InteractableChaos/InteractableChaos.lua +++ b/InteractableChaos/InteractableChaos.lua @@ -1,4 +1,4 @@ -ModUtil.RegisterMod("InteractableChaos") +ModUtil.Mod.Register("InteractableChaos") local config = { ModName = "Interactable Chaos", @@ -7,7 +7,7 @@ local config = { InteractableChaos.config = config -- Spawn the chaos interactable and prevent interaction with the normal chaos gate -ModUtil.WrapBaseFunction("DoUnlockRoomExits", function ( baseFunc, run, room ) +ModUtil.Path.Wrap("DoUnlockRoomExits", function ( baseFunc, run, room ) baseFunc(run, room) if not config.Enabled then @@ -34,7 +34,7 @@ ModUtil.WrapBaseFunction("DoUnlockRoomExits", function ( baseFunc, run, room ) end, InteractableChaos) -- Prevent chaos gates from unlocking visually -ModUtil.WrapBaseFunction("ExitDoorUnlockedPresentation", function ( baseFunc, exitDoor ) +ModUtil.Path.Wrap("ExitDoorUnlockedPresentation", function ( baseFunc, exitDoor ) -- If this is a chaos gate, do not unlock if exitDoor.Name == "SecretDoor" and config.Enabled then return @@ -45,7 +45,7 @@ ModUtil.WrapBaseFunction("ExitDoorUnlockedPresentation", function ( baseFunc, ex end, InteractableChaos) -- Handling for picking up the special chaos interactable -ModUtil.WrapBaseFunction("HandleLootPickup", function ( baseFunc, currentRun, loot ) +ModUtil.Path.Wrap("HandleLootPickup", function ( baseFunc, currentRun, loot ) if loot.IsInteractableChaosLoot and config.Enabled then -- Calculate health cost and reduce it to 0 if chaos egg is equipped diff --git a/LootChoiceExt/LootChoiceExt.lua b/LootChoiceExt/LootChoiceExt.lua index e467278..74fa32b 100644 --- a/LootChoiceExt/LootChoiceExt.lua +++ b/LootChoiceExt/LootChoiceExt.lua @@ -1,4 +1,4 @@ -ModUtil.RegisterMod("LootChoiceExt") +ModUtil.Mod.Register("LootChoiceExt") local config = { MinExtraLootChoices = 0, @@ -19,16 +19,16 @@ OnAnyLoad{ function() LootChoiceExt.LastLootChoices = LootChoiceExt.Choices + RandomInt( config.MinExtraLootChoices, config.MaxExtraLootChoices ) end} -ModUtil.BaseOverride("GetTotalLootChoices", function() +ModUtil.Path.Override("GetTotalLootChoices", function() return LootChoiceExt.LastLootChoices end, LootChoiceExt) -ModUtil.BaseOverride("CalcNumLootChoices", function() +ModUtil.Path.Override("CalcNumLootChoices", function() local numChoices = LootChoiceExt.LastLootChoices - GetNumMetaUpgrades("ReducedLootChoicesShrineUpgrade") return numChoices end, LootChoiceExt) -ModUtil.BaseOverride("CreateBoonLootButtons", function( lootData, reroll ) +ModUtil.Path.Override("CreateBoonLootButtons", function( lootData, reroll ) -- BASE CODE ... (From Live Steam version v1.37996, pulled on 2021.04.27) local components = ScreenAnchors.ChoiceScreen.Components @@ -528,7 +528,7 @@ ModUtil.BaseOverride("CreateBoonLootButtons", function( lootData, reroll ) end, LootChoiceExt) -ModUtil.BaseOverride("DestroyBoonLootButtons", function( lootData ) +ModUtil.Path.Override("DestroyBoonLootButtons", function( lootData ) local components = ScreenAnchors.ChoiceScreen.Components local toDestroy = {} for index = 1, GetTotalLootChoices() do diff --git a/MinibossControl/MinibossControl.lua b/MinibossControl/MinibossControl.lua index 4c5904f..37e8ff0 100644 --- a/MinibossControl/MinibossControl.lua +++ b/MinibossControl/MinibossControl.lua @@ -6,7 +6,7 @@ Change the proportions of miniboss chambers, allowing minibosses to be removed or replaced with others. ]] -ModUtil.RegisterMod("MinibossControl") +ModUtil.Mod.Register("MinibossControl") local config = { MinibossSetting = "Leaderboard" @@ -116,7 +116,7 @@ end -- Apply the configured miniboss settings to the game data function MinibossControl.UpdateMaxCreations() - ModUtil.MapSetTable(RoomSetData, { + ModUtil.Table.Merge(RoomSetData, { -- [[ Tartarus Miniboss Counts ]] Tartarus = { A_MiniBoss01 = { @@ -159,21 +159,21 @@ function MinibossControl.UpdateMaxCreations() -- Remove Tiny Vermin if MinibossControl.Presets[config.MinibossSetting].RemoveTinyVermin then - ModUtil.MapSetTable(RoomSetData.Styx.D_MiniBoss03, { + ModUtil.Table.Merge(RoomSetData.Styx.D_MiniBoss03, { LegalEncounters = { "MiniBossHeavyRangedForked" }, }) else - ModUtil.MapSetTable(RoomSetData.Styx.D_MiniBoss03, { - LegalEncounters = { "MiniBossCrawler", "MiniBossHeavyRangedForked" }, + ModUtil.Table.Merge(RoomSetData.Styx.D_MiniBoss03, { + LegalEncounters = { "MiniBossCrawler", "MiniBossHeavyRangedForked" }, }) end end -- Scripts/RunManager.lua : 515 -ModUtil.WrapBaseFunction("ChooseNextRoomData", function( baseFunc, currentRun, args ) +ModUtil.Path.Wrap("ChooseNextRoomData", function( baseFunc, currentRun, args ) -- IsRoomEligible looks at RoomCreations and ignores it if it's nil. Make sure it's not nil -- Easier and cleaner than overriding the IsRoomEligible function to fix nil behavior - ModUtil.MapSetTable(CurrentRun.RoomCreations, { + ModUtil.Table.Merge(CurrentRun.RoomCreations, { A_MiniBoss01 = currentRun.RoomCreations.A_MiniBoss01 or 0, A_MiniBoss02 = currentRun.RoomCreations.A_MiniBoss02 or 0, A_MiniBoss03 = currentRun.RoomCreations.A_MiniBoss03 or 0, @@ -193,7 +193,7 @@ ModUtil.LoadOnce( function() end) -- When a new run is started, make sure to apply the miniboss modifications -ModUtil.WrapBaseFunction("StartNewRun", function ( baseFunc, currentRun ) +ModUtil.Path.Wrap("StartNewRun", function ( baseFunc, currentRun ) MinibossControl.UpdateMaxCreations() return baseFunc(currentRun) end, MinibossControl) diff --git a/ModConfigMenu/ModConfigMenu.lua b/ModConfigMenu/ModConfigMenu.lua index 2db0e20..3e2ed61 100644 --- a/ModConfigMenu/ModConfigMenu.lua +++ b/ModConfigMenu/ModConfigMenu.lua @@ -1,4 +1,4 @@ -ModUtil.RegisterMod("ModConfigMenu") +ModUtil.Mod.Register("ModConfigMenu") ModConfigMenu.Menus = {} ModConfigMenu.CurrentMenuIdx = 1 @@ -279,9 +279,9 @@ function ModConfigMenu__Close( screen, button ) OnScreenClosed({ Flag = screen.Name }) end -ModUtil.WrapBaseFunction("CreatePrimaryBacking", function ( baseFunc ) +ModUtil.Path.Wrap("CreatePrimaryBacking", function ( baseFunc ) -- Only show menu between runs - if not ModUtil.PathGet("CurrentDeathAreaRoom") then + if not ModUtil.Path.Get("CurrentDeathAreaRoom") then return baseFunc() end diff --git a/ModdedWarning/ModdedWarning.lua b/ModdedWarning/ModdedWarning.lua index 83c1e1a..75ca2fb 100644 --- a/ModdedWarning/ModdedWarning.lua +++ b/ModdedWarning/ModdedWarning.lua @@ -1,4 +1,4 @@ -ModUtil.RegisterMod("ModdedWarning") +ModUtil.Mod.Register("ModdedWarning") local config = { WarningMessage = "MODDED GAME", diff --git a/PrintUtil/PrintUtil.lua b/PrintUtil/PrintUtil.lua index 1a90d64..db9b688 100644 --- a/PrintUtil/PrintUtil.lua +++ b/PrintUtil/PrintUtil.lua @@ -8,7 +8,7 @@ manner, and to get the current stack trace, to determine who is calling a function and from where. ]] -ModUtil.RegisterMod("PrintUtil") +ModUtil.Mod.Register("PrintUtil") --- Util method to draw text to the screen -- @param obstacleName Name of textbox diff --git a/QuickRestart/QuickRestart.lua b/QuickRestart/QuickRestart.lua index 6c5eb21..9342a5d 100644 --- a/QuickRestart/QuickRestart.lua +++ b/QuickRestart/QuickRestart.lua @@ -1,4 +1,4 @@ -ModUtil.RegisterMod("QuickRestart") +ModUtil.Mod.Register("QuickRestart") local config = { Enabled = true, @@ -16,7 +16,7 @@ function QuickRestart.CanReset() wait(0.1) -- Zag must not be in the House - if ModUtil.PathGet("CurrentDeathAreaRoom") then return false end + if ModUtil.Path.Get("CurrentDeathAreaRoom") then return false end -- Zag must not be frozen if not IsEmpty( CurrentRun.Hero.FreezeInputKeys ) then return false end @@ -129,7 +129,7 @@ OnAnyLoad{ "RoomPreRun", end } -ModUtil.BaseOverride( "HandleDeath", function( currentRun, killer, killingUnitWeapon ) +ModUtil.Path.Override( "HandleDeath", function( currentRun, killer, killingUnitWeapon ) if GetConfigOptionValue({ Name = "EditingMode" }) then SetAnimation({ Name = "ZagreusDeadStartBlood", DestinationId = currentRun.Hero.ObjectId }) return @@ -212,25 +212,25 @@ ModUtil.BaseOverride( "HandleDeath", function( currentRun, killer, killingUnitWe LoadMap({ Name = deathMap, ResetBinks = true, ResetWeaponBinks = true }) end, QuickRestart) -ModUtil.WrapBaseFunction("WindowDropEntrance", function( baseFunc, ... ) +ModUtil.Path.Wrap("WindowDropEntrance", function( baseFunc, ... ) local val = baseFunc(...) -- Get starting keepsake GameState.QuickRestartStartingKeepsake = GameState.LastAwardTrait return val end, QuickRestart) -ModUtil.WrapBaseFunction("PlayerLastStandPresentationStart", function( baseFunc, ... ) +ModUtil.Path.Wrap("PlayerLastStandPresentationStart", function( baseFunc, ... ) QuickRestart.LastStanding = true return baseFunc( ... ) end, QuickRestart) -ModUtil.WrapBaseFunction("PlayerLastStandPresentationEnd", function( baseFunc, ... ) +ModUtil.Path.Wrap("PlayerLastStandPresentationEnd", function( baseFunc, ... ) local val = baseFunc( ... ) QuickRestart.LastStanding = false return val end, QuickRestart) -ModUtil.WrapBaseFunction("StartDevotionTestPresentation", function( baseFunc, ... ) +ModUtil.Path.Wrap("StartDevotionTestPresentation", function( baseFunc, ... ) QuickRestart.MidDevotion = true baseFunc(...) QuickRestart.MidDevotion = false diff --git a/RemoveCutscenes/RemoveCutscenes.lua b/RemoveCutscenes/RemoveCutscenes.lua index 5c4364a..cfb46b2 100644 --- a/RemoveCutscenes/RemoveCutscenes.lua +++ b/RemoveCutscenes/RemoveCutscenes.lua @@ -5,7 +5,7 @@ Optionally removes intro and outro cutscenes to runs ]] -ModUtil.RegisterMod("RemoveCutscenes") +ModUtil.Mod.Register("RemoveCutscenes") local config = { ModName = "RemoveCutscenes", @@ -15,7 +15,7 @@ local config = { RemoveCutscenes.config = config -- Remove starting cutscene -ModUtil.WrapBaseFunction("ShowRunIntro", function( baseFunc ) +ModUtil.Path.Wrap("ShowRunIntro", function( baseFunc ) if config.RemoveIntro then return end @@ -24,7 +24,7 @@ ModUtil.WrapBaseFunction("ShowRunIntro", function( baseFunc ) end, RemoveCutscenes) -ModUtil.WrapBaseFunction("EndEarlyAccessPresentation", function ( baseFunc ) +ModUtil.Path.Wrap("EndEarlyAccessPresentation", function ( baseFunc ) if config.RemoveOutro then CurrentRun.ActiveBiomeTimer = false diff --git a/RoomDeterminism/RoomDeterminism.lua b/RoomDeterminism/RoomDeterminism.lua index eafdd6f..84d2752 100644 --- a/RoomDeterminism/RoomDeterminism.lua +++ b/RoomDeterminism/RoomDeterminism.lua @@ -1,4 +1,4 @@ -ModUtil.RegisterMod("RoomDeterminism") +ModUtil.Mod.Register("RoomDeterminism") local config = { -- TODO: these configs can yield infinite loops. Needs addressing before exposing to player via a UI @@ -330,11 +330,11 @@ function GetRoomBiome(room_name_to_find) error("Invalid room name passed to GetRoomBiome: " .. (room_name_to_find or "nil")) end -ModUtil.WrapBaseFunction("ChooseNextRoomData", function ( baseFunc, run, args ) +ModUtil.Path.Wrap("ChooseNextRoomData", function ( baseFunc, run, args ) local next_room_data = baseFunc( run, args ) -- If the mod isn't enabled or the next room is a vanilla chaos, then don't override the next room - if (not config.Enabled) or ModUtil.SafeGet(args, {"RoomDataSet"}) ~= nil then + if (not config.Enabled) or ModUtil.IndexArray.Get(args, {"RoomDataSet"}) ~= nil then return next_room_data end @@ -372,14 +372,14 @@ ModUtil.WrapBaseFunction("ChooseNextRoomData", function ( baseFunc, run, args ) return next_room_data end, RoomDeterminism) -ModUtil.WrapBaseFunction("LeaveRoom", function ( baseFunc, currentRun, door ) +ModUtil.Path.Wrap("LeaveRoom", function ( baseFunc, currentRun, door ) -- Reset our naive exit door counter RoomDeterminism.CurrentExitForDepth = 1 baseFunc(currentRun, door) end, RoomDeterminism) -ModUtil.WrapBaseFunction("StartNewRun", function ( baseFunc, currentRun ) +ModUtil.Path.Wrap("StartNewRun", function ( baseFunc, currentRun ) if config.Enabled and config.RoomGenerationAlgorithm ~= nil then RandomSynchronize(3110) RoomDeterminism.RoomGenerationAlgorithms[config.RoomGenerationAlgorithm]() diff --git a/RtaTimer/RtaTimer.lua b/RtaTimer/RtaTimer.lua index a191e35..25fa729 100644 --- a/RtaTimer/RtaTimer.lua +++ b/RtaTimer/RtaTimer.lua @@ -5,7 +5,7 @@ Track RTA time and display it below the IGT timer ]] -ModUtil.RegisterMod("RtaTimer") +ModUtil.Mod.Register("RtaTimer") local config = { ModName = "RtaTimer", @@ -97,7 +97,7 @@ function RtaTimer__ResetRtaTimer() RtaTimer.UpdateRtaTimer() end -ModUtil.WrapBaseFunction("WindowDropEntrance", function( baseFunc, ... ) +ModUtil.Path.Wrap("WindowDropEntrance", function( baseFunc, ... ) local val = baseFunc(...) -- If single run, timer should always restart @@ -114,7 +114,7 @@ ModUtil.WrapBaseFunction("WindowDropEntrance", function( baseFunc, ... ) end, RtaTimer) -- Stop timer when Hades dies (but leave it on screen) -ModUtil.WrapBaseFunction("HadesKillPresentation", function( baseFunc, ...) +ModUtil.Path.Wrap("HadesKillPresentation", function( baseFunc, ...) RtaTimer.Running = false baseFunc(...) end, RtaTimer) @@ -122,7 +122,7 @@ end, RtaTimer) ModUtil.LoadOnce( function() -- If not in a run, reset timer and prepare for run start - if ModUtil.PathGet("CurrentDeathAreaRoom") then + if ModUtil.Path.Get("CurrentDeathAreaRoom") then RtaTimer.TimerWasReset = true -- If in a run, just start the timer from the time the mod was loaded diff --git a/SatyrSackControl/SatyrSackControl.lua b/SatyrSackControl/SatyrSackControl.lua index b1b1181..4e48edd 100644 --- a/SatyrSackControl/SatyrSackControl.lua +++ b/SatyrSackControl/SatyrSackControl.lua @@ -5,7 +5,7 @@ Forces the Styx satyr sack to appear in a specified range. ]] -ModUtil.RegisterMod("SatyrSackControl") +ModUtil.Mod.Register("SatyrSackControl") local config = { Enabled = true, -- If true, sack wil fall between MinSack and MaxSack @@ -15,17 +15,17 @@ local config = { SatyrSackControl.config = config -- Scripts/RoomManager.lua : 1874 -ModUtil.WrapBaseFunction("StartRoom", function ( baseFunc, currentRun, currentRoom ) +ModUtil.Path.Wrap("StartRoom", function ( baseFunc, currentRun, currentRoom ) baseFunc(currentRun, currentRoom) end, SatyrSackControl) -- Scripts/UIScripts.lua : 145 -ModUtil.WrapBaseFunction("ShowCombatUI", function ( baseFunc, flag ) +ModUtil.Path.Wrap("ShowCombatUI", function ( baseFunc, flag ) baseFunc(flag) end, SatyrSackControl) -- Scripts/RunManager.lua : 591 -ModUtil.BaseOverride("IsRoomForced", function(currentRun, currentRoom, nextRoomData, args) +ModUtil.Path.Override("IsRoomForced", function(currentRun, currentRoom, nextRoomData, args) if nextRoomData.AlwaysForce then return true end diff --git a/ShowChamberNumber/ShowChamberNumber.lua b/ShowChamberNumber/ShowChamberNumber.lua index 855ee4a..8fd2a2e 100644 --- a/ShowChamberNumber/ShowChamberNumber.lua +++ b/ShowChamberNumber/ShowChamberNumber.lua @@ -7,7 +7,7 @@ Shows the current Chamber Number immediately upon starting a room. If that fails for some reason, fall back to showing the Depth during ShowCombatUI. ]] -ModUtil.RegisterMod("ShowChamberNumber") +ModUtil.Mod.Register("ShowChamberNumber") local config = { ShowDepth = true, @@ -15,7 +15,7 @@ local config = { ShowChamberNumber.config = config -- Scripts/RoomManager.lua : 1874 -ModUtil.WrapBaseFunction("StartRoom", function ( baseFunc, currentRun, currentRoom ) +ModUtil.Path.Wrap("StartRoom", function ( baseFunc, currentRun, currentRoom ) if config.ShowDepth then ShowDepthCounter() end @@ -24,7 +24,7 @@ ModUtil.WrapBaseFunction("StartRoom", function ( baseFunc, currentRun, currentRo end, ShowChamberNumber) -- Scripts/UIScripts.lua : 145 -ModUtil.WrapBaseFunction("ShowCombatUI", function ( baseFunc, flag ) +ModUtil.Path.Wrap("ShowCombatUI", function ( baseFunc, flag ) if config.ShowDepth then ShowDepthCounter() end @@ -33,7 +33,7 @@ ModUtil.WrapBaseFunction("ShowCombatUI", function ( baseFunc, flag ) end, ShowChamberNumber) -- Hiding Depth Counter doesn't actually do anything -ModUtil.WrapBaseFunction("HideDepthCounter", function ( baseFunc ) +ModUtil.Path.Wrap("HideDepthCounter", function ( baseFunc ) if config.ShowDepth then return end diff --git a/ThanatosControl/ThanatosControl.lua b/ThanatosControl/ThanatosControl.lua index 5561376..2cae21b 100644 --- a/ThanatosControl/ThanatosControl.lua +++ b/ThanatosControl/ThanatosControl.lua @@ -7,7 +7,7 @@ Gives options to modify or remove Thanatos ]] -ModUtil.RegisterMod("ThanatosControl") +ModUtil.Mod.Register("ThanatosControl") local config = { ThanatosSetting = "Removed" @@ -69,7 +69,7 @@ function updateNumberOfThanatos() if config.ThanatosSetting == "Removed" then maxThans = 0 end - ModUtil.MapSetTable(EncounterData, { + ModUtil.Table.Merge(EncounterData, { ThanatosTartarus = { MaxThanatosSpawnsThisRun = maxThans, }, @@ -92,7 +92,7 @@ function updateThanatosValues(data) data.MaxWaves = ThanatosControl.Presets[config.ThanatosSetting][biome].MaxWaves end -ModUtil.WrapBaseFunction("SetupEncounter", function( baseFunc, encounterData, room ) +ModUtil.Path.Wrap("SetupEncounter", function( baseFunc, encounterData, room ) -- TODO: Make this actually work if false and config.ThanatosSetting ~= "Removed" then local moddedEncounter = DeepCopyTable( encounterData ) @@ -106,7 +106,7 @@ ModUtil.WrapBaseFunction("SetupEncounter", function( baseFunc, encounterData, ro end, ThanatosControl) -- When a new run is started, make sure to apply the than modifications -ModUtil.WrapBaseFunction("StartNewRun", function ( baseFunc, currentRun ) +ModUtil.Path.Wrap("StartNewRun", function ( baseFunc, currentRun ) updateNumberOfThanatos() return baseFunc(currentRun) end, ThanatosControl)