Skip to content

Commit

Permalink
Initial v44 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
doombubbles committed Aug 1, 2024
1 parent 26efe3b commit f1c8ce2
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 85 deletions.
2 changes: 1 addition & 1 deletion BloonsTD6 Mod Helper/Api/Towers/ModTower.cs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public override void Register()
var index = GetTowerIndex(Game.instance.model.towerSet.ToList());
if (index >= 0)
{
var shopTowerDetailsModel = new ShopTowerDetailsModel(Id, index, 5, 5, 5, ShopTowerCount, 0);
var shopTowerDetailsModel = new ShopTowerDetailsModel(Id, index, 5, 5, 5, ShopTowerCount);
Game.instance.model.AddTowerDetails(shopTowerDetailsModel, index);
}
}
Expand Down
2 changes: 1 addition & 1 deletion BloonsTD6 Mod Helper/Api/Towers/ModTowerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ internal static void FinalizeHero(ModHero modHero)
if (index >= 0)
{
var heroDetailsModel =
new HeroDetailsModel(modHero.Id, index, 20, 1, 0, 0, 0, false);
new HeroDetailsModel(modHero.Id, index, 20, 1, 0, 0,false);
Game.instance.model.AddHeroDetails(heroDetailsModel, index);

var skinsData = GameData.Instance.skinsData;
Expand Down
3 changes: 1 addition & 2 deletions BloonsTD6 Mod Helper/Extensions/GameExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public static SpriteReference CreateSpriteReference(this Game game, string guid)
/// <returns></returns>
public static bool IsAccountFlagged(this Game game)
{
var hackerStatus = game.GetBtd6Player().Hakxr;
return hackerStatus.genrl || hackerStatus.ledrbrd;
return game.GetBtd6Player().IsFlagged;
}

/// <summary>
Expand Down
16 changes: 4 additions & 12 deletions BloonsTD6 Mod Helper/Extensions/SystemExtensions/StringExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,12 @@ public static string GetBtd6Localization(this string id, bool returnAsSpacedIfNo
{
return LocalizationManager.Instance.textTable[id];
}
else if (LocalizationManager.Instance.defaultTable.ContainsKey(id))

if (LocalizationManager.Instance.defaultTable.ContainsKey(id))
{
return LocalizationManager.Instance.defaultTable[id];
}
else
{
if (returnAsSpacedIfNoEntry)
{
return id.Spaced();
}
else
{
return id;
}
}

return returnAsSpacedIfNoEntry ? id.Spaced() : id;
}
}
8 changes: 4 additions & 4 deletions BloonsTD6 Mod Helper/LATEST.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- Initial fixes for BTD6 v43.0
- Initial fixes for BTD6 v44
- Removed the BypassSavingRestrictions settings as it's no longer needed (hurray!)
- Also removed the AutoHideModdedClientPopup setting as the new popup requests

### Notes for Modders

- For any place where you previously used `InGame.instance.UnityToSimulation`, just switch it now to either `InGame.instance.bridge` or `InGame.Bridge` or `InGame.instance.GetUnityToSimulation()`
- Added a new String extension for GetBtd6Localization (thanks @DarkTerraYT !)
24 changes: 5 additions & 19 deletions BloonsTD6 Mod Helper/MelonMain.Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,12 @@ internal partial class MelonMain
icon = AlternateBloonsBtn
};

public static readonly ModSettingBool BypassSavingRestrictions = new(true)
{
description =
"With BTD6 v30.0, Ninja Kiwi made it so that progress can not be saved on your profile if it detects that you have mods, or even just MelonLoader, installed. " +
"We think that they have gone too far with this change, and that it is not consistent with their stated goal in the patch notes of trying 'not to detract from modding'. " +
"So, this setting overrides that restriction and will allow progress to be saved once more.",
category = General,
icon = SaveGameIcon
};

internal static readonly ModSettingBool AutoHideModdedClientPopup = new(false)
/*internal static readonly ModSettingBool AutoHideModdedClientPopup = new(false)
{
category = General,
description = "Removes the popup telling you that you're using a modded client. Like, we get it already.",
icon = HideIcon,
onValueChanged = x =>
{
PopupScreen.instance.hasSeenModderWarning = x;
}
};
icon = HideIcon
};*/

public static readonly ModSettingBool CleanProfile = new(true)
{
Expand All @@ -58,7 +44,7 @@ internal partial class MelonMain
icon = CleansingFoamUpgradeIcon
};

public static readonly ModSettingBool UseOldLoading = new(false)
/*public static readonly ModSettingBool UseOldLoading = new(false)
{
description =
"Switches back to the old system of loading all mod content all at once as soon as the Title Screen is reached " +
Expand All @@ -67,7 +53,7 @@ internal partial class MelonMain
category = General,
requiresRestart = true,
icon = RetroTechbotIcon
};
};*/

private static readonly ModSettingCategory ModBrowserSettings = new("Mod Browser Settings")
{
Expand Down
4 changes: 2 additions & 2 deletions BloonsTD6 Mod Helper/ModHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace BTD_Mod_Helper;
public static class ModHelper
{
internal const string Name = "BloonsTD6 Mod Helper";
internal const string Version = "3.1.21";
internal const string Version = "3.1.22";
internal const string RepoOwner = "gurrenm3";
internal const string RepoName = "BTD-Mod-Helper";
internal const string Description =
Expand Down Expand Up @@ -65,7 +65,7 @@ public static class ModHelper
internal static bool FallbackToOldLoading
{
set => fallBackToOldLoading = value;
get => fallBackToOldLoading || MelonMain.UseOldLoading;
get => fallBackToOldLoading /*|| MelonMain.UseOldLoading*/;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@
using Il2CppAssets.Scripts.Unity.UI_New.Popups;
namespace BTD_Mod_Helper.Patches.ModdedClientChecking;

[HarmonyPatch(typeof(DataConflict), nameof(DataConflict.ShowUpdatePopup))]
internal static class DataConflict_ShowUpdatePopup
{
[HarmonyPrefix]
private static bool Prefix()
{
PopupScreen.instance.SafelyQueue(screen => screen.ShowOkPopup(
"You aren't using the latest version of the game, " +
"so Mod Helper's profile saving fix has been disabled."));
IsModdedClientPatches.ForceNoSave = true;
return false;
}
}

[HarmonyPatch(typeof(DataConflict), nameof(DataConflict.ReportIncompatibleDataVersion))]
internal static class DataConflict_ReportIncompatibleDataVersion
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using Il2CppAssets.Scripts.Unity.UI_New.Popups;
namespace BTD_Mod_Helper.Patches.Popups;

[HarmonyPatch(typeof(PopupScreen), nameof(PopupScreen.ShowModderPopup))]
/*[HarmonyPatch(typeof(PopupScreen), nameof(PopupScreen.ShowModderPopup))]
internal class PopupScreen_ShowModderPopup
{
[HarmonyPrefix]
private static bool Prefix(PopupScreen __instance)
{
__instance.hasSeenModderWarning = MelonMain.AutoHideModdedClientPopup;
return MelonMain.AutoHideModdedClientPopup;
}
}
}*/
1 change: 1 addition & 0 deletions BloonsTD6 Mod Helper/UI/Modded/ModsButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public static void Create(MainMenu mainMenu)
modsButton.name = "Mods";
modsButton.transform.localPosition = new Vector3(1600, 0, 0);
modsButton.RemoveComponent<PipEventChecker>();
modsButton.GetComponentInChildrenByName<RectTransform>("NewRibbon").gameObject.SetActive(false);
modsButton.GetComponentInChildrenByName<Image>("Button").SetSprite(Sprite);
modsButton.GetComponentInChildren<NK_TextMeshProUGUI>().localizeKey = $" Mods ({ModHelper.Melons.Count()})";
modsButton.GetComponentInChildren<Button>().SetOnClick(() => ModGameMenu.Open<ModsMenu>());
Expand Down

0 comments on commit f1c8ce2

Please sign in to comment.