Skip to content

Commit

Permalink
Fix for BTD6 v38.1
Browse files Browse the repository at this point in the history
  • Loading branch information
doombubbles committed Jul 28, 2023
1 parent e5ad6ab commit 56394c4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
3 changes: 1 addition & 2 deletions LATEST.md
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
- Fixed for BTD6 v37.0
- Fixed error message when selecting the Rare Quincy Action Figure
- Fixed for BTD6 v38.1
2 changes: 1 addition & 1 deletion ModHelperData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace PathsPlusPlus;
internal static class ModHelperData
{
public const string WorksOnVersion = "37.0";
public const string Version = "1.0.1";
public const string Version = "1.0.2";
public const string Name = "Paths++";

public const string Description = "A helper mod allowing additional upgrade paths to be made for towers.\n\n" +
Expand Down
26 changes: 26 additions & 0 deletions Patches/UiPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,30 @@ private static void Postfix(Tower tower, int path, ref Il2CppReferenceArray<Upgr
tower.towerModel.upgrades = __state;
}
}
}

/// <summary>
/// Fix v38.1 inlining of TowerSelectionMenu.IsUpgradePathClosed method
/// </summary>
[HarmonyPatch(typeof(UpgradeObject), nameof(UpgradeObject.UpdateVisuals))]
internal static class UpgradeObject_UpdateVisuals
{
[HarmonyPrefix]
private static bool Prefix(UpgradeObject __instance, int path, bool upgradeClicked)
{
if (ModHelper.HasMod("UltimateCrosspathing")) return false;

if (__instance.towerSelectionMenu.IsUpgradePathClosed(path))
{
__instance.upgradeButton.SetUpgradeModel(null);
}
__instance.CheckLocked();
var maxTier = __instance.CheckBlockedPath();
var maxTierRestricted = __instance.CheckRestrictedPath();
__instance.SetTier(__instance.tier, maxTier, maxTierRestricted);
__instance.currentUpgrade.UpdateVisuals();
__instance.upgradeButton.UpdateVisuals(path, upgradeClicked);

return false;
}
}

0 comments on commit 56394c4

Please sign in to comment.