Skip to content

Commit

Permalink
Fix for BTD6 v39
Browse files Browse the repository at this point in the history
  • Loading branch information
doombubbles committed Oct 14, 2023
1 parent 5a07c2c commit 14cb86a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
8 changes: 5 additions & 3 deletions AscendedUpgrade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ public abstract class AscendedUpgrade : NamedModContent
{
protected abstract ModBuffIcon ModBuffIcon { get; }

protected BuffIndicatorModel BuffIndicatorModel => (InGame.instance.Exists()?.GetGameModel() ?? Game.instance.model)
protected BuffIndicatorModel? BuffIndicatorModel => AscendedUpgradesMod.ShowBuffIndicators
? (InGame.instance.Exists()?.GetGameModel() ?? Game.instance.model)
.buffIndicatorModels
.First(model => model.name == $"BuffIndicatorModel_{ModBuffIcon.Id}-{ModBuffIcon.Icon}");
.First(model => model.name == $"BuffIndicatorModel_{ModBuffIcon.Id}-{ModBuffIcon.Icon}")
: null;

public static readonly Dictionary<int, string> IdByPath = new();
public static readonly Dictionary<int, AscendedUpgrade> ByPath = new();
Expand Down Expand Up @@ -70,7 +72,7 @@ public void UnApply()
private void ChangeUpgradeCosts(float delta)
{
if (!AscendedUpgradesMod.SharedTowerScaling) return;

var gameModel = InGame.instance.bridge.Model;
var affected = AscendedUpgradesMod.SharedUpgradeScaling
? GetContent<AscendedUpgrade>()
Expand Down
8 changes: 8 additions & 0 deletions AscendedUpgradesMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ public class AscendedUpgradesMod : BloonsTD6Mod
description = "Whether the grid of blue upgrade pips appears as you purchase Ascended Upgrades",
icon = ModContent.GetTextureGUID<AscendedUpgradesMod>("AscendedPip")
};

public static readonly ModSettingBool ShowBuffIndicators = new(true)
{
displayName = "Show Buff Indicators",
description = "",
icon = VanillaSprites.BuffIconComeOnEverybodyRate
};


public static readonly ModSettingBool SharedUpgradeScaling = new(false)
{
Expand Down
2 changes: 1 addition & 1 deletion LATEST.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- Fixed for BTD6 v38.1
- Fixed for BTD6 v39.0
4 changes: 2 additions & 2 deletions ModHelperData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ namespace AscendedUpgrades;

public static class ModHelperData
{
public const string WorksOnVersion = "38.1";
public const string Version = "1.0.5";
public const string WorksOnVersion = "39.0";
public const string Version = "1.0.6";
public const string Name = "Ascended Upgrades";

public const string Description = "Adds special Ascended Upgrades that you can use to infinitely upgrade towers.\n" +
Expand Down
2 changes: 1 addition & 1 deletion Patches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private static void Postfix(UpgradeButton __instance)
}

[HarmonyPatch(typeof(TowerSelectionMenu), nameof(TowerSelectionMenu.UpgradeTower), typeof(UpgradeModel), typeof(int),
typeof(float))]
typeof(float), typeof(double))]
internal static class TowerSelectionMenu_UpgradeTower
{
[HarmonyPrefix]
Expand Down

0 comments on commit 14cb86a

Please sign in to comment.