Skip to content

Commit

Permalink
TowerSets, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
doombubbles committed Dec 27, 2022
1 parent ba496a9 commit e0c77c1
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 3 deletions.
2 changes: 1 addition & 1 deletion BloonsTD6 Mod Helper/MelonMain.Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ internal partial class MelonMain
description = "Hides mods from the Mod Browser that are almost certainly broken from being too out of date. " +
"This is currently just based on having a 'WorksOnVersion' value in its ModHelperData >= 34",
category = ModBrowserSettings,
icon = HideIcon
icon = CloseBtn
};

public static readonly ModSettingBool ShowUnverifiedModBrowserContent = new(false)
Expand Down
1 change: 1 addition & 0 deletions BloonsTD6 Mod Helper/MelonMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using BTD_Mod_Helper.Api.Towers;
using BTD_Mod_Helper.Patches;
using BTD_Mod_Helper.UI.Modded;
using Il2CppAssets.Scripts.Models.TowerSets;
using TaskScheduler = BTD_Mod_Helper.Api.TaskScheduler;

[assembly: MelonInfo(typeof(MelonMain), ModHelper.Name, ModHelper.Version, ModHelper.Author)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace BTD_Mod_Helper.Patches.Sim;
internal static class UnityToSimulation_UpgradeTower_Impl
{
[HarmonyPrefix]
private static void Before(UnityToSimulation __instance, ObjectId id, int pathIndex)
private static void Prefix(UnityToSimulation __instance, ObjectId id, int pathIndex)
{
var towerManager = __instance.simulation.towerManager;
var tower = towerManager.GetTowerById(id).towerModel;
Expand Down
17 changes: 17 additions & 0 deletions BloonsTD6 Mod Helper/Patches/UI/MonkeyButton_Init.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using BTD_Mod_Helper.Api.Towers;
using Il2CppAssets.Scripts.Unity.UI_New.Main.MonkeySelect;
namespace BTD_Mod_Helper.Patches.UI;

[HarmonyPatch(typeof(MonkeyButton), nameof(MonkeyButton.Init))]
internal static class MonkeyButton_Init
{
[HarmonyPostfix]
private static void Postfix(MonkeyButton __instance)
{
if (ModTowerHelper.ModTowerCache.TryGetValue(__instance.towerId, out var tower) &&
tower.ModTowerSet is { } towerSet)
{
__instance.bgImage.SetSprite(towerSet.ContainerReference);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using BTD_Mod_Helper.Api.Towers;
using Il2CppAssets.Scripts.Unity.UI_New.Upgrade;
namespace BTD_Mod_Helper.Patches.UI;

[HarmonyPatch(typeof(UpgradeScreen), nameof(UpgradeScreen.UpdatePortraitBackground))]
internal static class UpgradeScreen_UpdatePortraitBackground
{
[HarmonyPostfix]
private static void Postfix(UpgradeScreen __instance)
{
if (ModTowerHelper.ModTowerCache.TryGetValue(__instance.currTowerId, out var tower) &&
tower.ModTowerSet is { } towerSet)
{
__instance.selectedUpgrade.portraitBackground.SetSprite(towerSet.ContainerReference);
}
}
}
2 changes: 1 addition & 1 deletion Shared/ModHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static class ModHelper
#region ModHelperData for the Mod Helper

internal const string Name = "BloonsTD6 Mod Helper";
internal const string Version = "3.1.0";
internal const string Version = "3.1.1";
internal const string RepoOwner = "gurrenm3";
internal const string RepoName = "BTD-Mod-Helper";
internal const string Description = "A powerful and easy to use API for modding BTD6. Also the mod that is allowing all of this UI to happen right now :P";
Expand Down

0 comments on commit e0c77c1

Please sign in to comment.