Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions Colorblind/colorblind.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ModUtil.RegisterMod("ColorblindMod")
ModUtil.Mod.Register("ColorblindMod")

local config =
{
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)
6 changes: 3 additions & 3 deletions DoorVisualIndicators/DoorVisualIndicators.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ModUtil.RegisterMod("DoorVisualIndicators")
ModUtil.Mod.Register("DoorVisualIndicators")

local config = {
ModName = "Door Visual Indicators",
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion EmoteMod/EmoteMod.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ModUtil.RegisterMod("EmoteMod")
ModUtil.Mod.Register("EmoteMod")

local config = {
ModName = "EmoteMod",
Expand Down
2 changes: 1 addition & 1 deletion ErumiUILib/ErumiUILib.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ModUtil.RegisterMod("ErumiUILib")
ModUtil.Mod.Register("ErumiUILib")
ErumiUILib = {
Slider = {},
Dropdown = {},
Expand Down
4 changes: 2 additions & 2 deletions HadesSpeedrunningModpack/HSMConfigMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions HadesSpeedrunningModpack/HadesSpeedrunningModpack.lua
Original file line number Diff line number Diff line change
@@ -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")
10 changes: 5 additions & 5 deletions HadesSpeedrunningModpack/RngBalanceMenu.lua
Original file line number Diff line number Diff line change
@@ -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({
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions HadesSpeedrunningModpack/SettingsHashMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions InteractableChaos/InteractableChaos.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ModUtil.RegisterMod("InteractableChaos")
ModUtil.Mod.Register("InteractableChaos")

local config = {
ModName = "Interactable Chaos",
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions LootChoiceExt/LootChoiceExt.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ModUtil.RegisterMod("LootChoiceExt")
ModUtil.Mod.Register("LootChoiceExt")

local config = {
MinExtraLootChoices = 0,
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions MinibossControl/MinibossControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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" },
})

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed one indent but not the other :(

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,
Expand All @@ -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)
6 changes: 3 additions & 3 deletions ModConfigMenu/ModConfigMenu.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ModUtil.RegisterMod("ModConfigMenu")
ModUtil.Mod.Register("ModConfigMenu")

ModConfigMenu.Menus = {}
ModConfigMenu.CurrentMenuIdx = 1
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion ModUtil
2 changes: 1 addition & 1 deletion ModdedWarning/ModdedWarning.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ModUtil.RegisterMod("ModdedWarning")
ModUtil.Mod.Register("ModdedWarning")

local config = {
WarningMessage = "MODDED GAME",
Expand Down
2 changes: 1 addition & 1 deletion PrintUtil/PrintUtil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading