Skip to content

Commit

Permalink
Co Op tower selection menu fix
Browse files Browse the repository at this point in the history
  • Loading branch information
doombubbles committed Jun 1, 2022
1 parent a4c904e commit 8eb4c56
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion BTD Mod Helper Core/Api/ModOptions/ModSettingsHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ internal static void SaveModSettings(string modSettingsDir)
{
foreach (var mod in MelonHandler.Mods.OfType<BloonsMod>())
{
if (!mod.ModSettings.Any()) continue;
if (mod.ModSettings == null || !mod.ModSettings.Any()) continue;
SaveModSettings(mod, modSettingsDir);
}
}
Expand Down
2 changes: 1 addition & 1 deletion BTD Mod Helper Core/ModHelperData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
{
public static class ModHelperData
{
public const string currentVersion = "2.4.8";
public const string currentVersion = "2.4.9";
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
using Assets.Scripts.Models.Towers.Upgrades;
using Assets.Scripts.Unity.UI_New.InGame.TowerSelectionMenu;
using Assets.Scripts.Unity.UI_New.InGame.TowerSelectionMenu;
using HarmonyLib;

namespace BTD_Mod_Helper.Patches.UI
{
/// <summary>
/// This is a benign patch that helps fix unexpected issues with changing upgrade restrictions
/// </summary>
[HarmonyPatch(typeof(TowerSelectionMenu), nameof(TowerSelectionMenu.UpgradeTower), typeof(UpgradeModel), typeof(int), typeof(float))]
[HarmonyPatch(typeof(TowerSelectionMenu), nameof(TowerSelectionMenu.TowerUpgraded))]
internal class TowerSelectionMenu_UpgradeTower
{
[HarmonyPostfix]
internal static void Postfix(TowerSelectionMenu __instance)
{
__instance.InitUpgradeButtons();
__instance.triggerUiUpdate = true;
}
}
}

0 comments on commit 8eb4c56

Please sign in to comment.