Skip to content

Commit 654b6f6

Browse files
committed
Updated to balance pass
1 parent 7774308 commit 654b6f6

4 files changed

Lines changed: 22 additions & 10 deletions

File tree

PolyMod.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
https://polymod.dev/nuget/v3/index.json;
1111
</RestoreAdditionalProjectSources>
1212
<Configurations>IL2CPP</Configurations>
13-
<Version>1.1.8</Version>
14-
<PolytopiaVersion>2.13.0.14218</PolytopiaVersion>
13+
<Version>1.1.9</Version>
14+
<PolytopiaVersion>2.14.0.14524</PolytopiaVersion>
1515
<Authors>PolyModdingTeam</Authors>
1616
<Description>The Battle of Polytopia's mod loader.</Description>
1717
<NoWarn>IDE0130</NoWarn>
1818
<NoWarn>NU5104</NoWarn>
1919
</PropertyGroup>
2020

2121
<ItemGroup>
22-
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.733" />
22+
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.738" />
2323
<PackageReference Include="TheBattleOfPolytopia" Version="$(PolytopiaVersion)" />
2424
<EmbeddedResource Include="resources\*.*" />
2525
</ItemGroup>

src/Managers/Compatibility.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,23 +106,26 @@ private static bool GameInfoPopup_OnMainButtonClicked(GameInfoPopup __instance,
106106
[HarmonyPatch(typeof(StartScreen), nameof(StartScreen.OnResumeButtonClick))]
107107
private static bool StartScreen_OnResumeButtonClick(StartScreen __instance, int id, BaseEventData eventData)
108108
{
109-
return CheckSignatures(__instance.OnResumeButtonClick, id, eventData, ClientBase.GetSinglePlayerSessions()[0]);
109+
return CheckSignatures(__instance.OnResumeButtonClick, id, eventData, LocalSaveFileUtils.GetSaveFiles(PolytopiaBackendBase.Game.GameType.SinglePlayer)[0]);
110110
}
111111

112112
[HarmonyPostfix]
113113
[HarmonyPatch(typeof(GameInfoPopup), nameof(GameInfoPopup.DeletePaPGame))]
114-
private static void ClientBase_DeletePassAndPlayGame(GameInfoPopup __instance)
114+
private static void GameInfoPopup_DeletePaPGame(GameInfoPopup __instance)
115115
{
116116
File.Delete(Path.Combine(Application.persistentDataPath, $"{__instance.gameId}.signatures"));
117117
}
118118

119119
[HarmonyPrefix]
120-
[HarmonyPatch(typeof(ClientBase), nameof(ClientBase.DeleteSinglePlayerGames))]
121-
private static void ClientBase_DeleteSinglePlayerGames()
120+
[HarmonyPatch(typeof(LocalSaveFileUtils), nameof(LocalSaveFileUtils.DeleteAllSaveFilesOfType))]
121+
private static void LocalSaveFileUtils_DeleteAllSaveFilesOfType(PolytopiaBackendBase.Game.GameType gameType, bool localOnly)
122122
{
123-
foreach (var gameId in ClientBase.GetSinglePlayerSessions())
123+
if(gameType == PolytopiaBackendBase.Game.GameType.SinglePlayer)
124124
{
125-
File.Delete(Path.Combine(Application.persistentDataPath, $"{gameId}.signatures"));
125+
foreach (var gameId in LocalSaveFileUtils.GetSaveFiles(PolytopiaBackendBase.Game.GameType.SinglePlayer))
126+
{
127+
File.Delete(Path.Combine(Application.persistentDataPath, $"{gameId}.signatures"));
128+
}
126129
}
127130
}
128131

src/Managers/Loc.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ private static void SetDescription(SelectTribePopup __instance)
2525
__instance.Description = description + "\n\n" + Localization.GetSkinned(__instance.SkinType, __instance.tribeData.description2, new Il2CppSystem.Object[]
2626
{
2727
__instance.tribeName,
28-
Localization.Get(__instance.startTechSid, Array.Empty<Il2CppSystem.Object>())
28+
Localization.Get(__instance.startTechSid, Array.Empty<Il2CppSystem.Object>()),
29+
__instance.tribeData.startingStars
2930
});
3031
}
3132
}

src/Managers/Main.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ private static void PurchaseManager_IsTribeUnlocked(ref bool __result, TribeData
4848
__result = (int)type >= Plugin.AUTOIDX_STARTS_FROM || __result;
4949
}
5050

51+
[HarmonyPrefix]
52+
[HarmonyPatch(typeof(SteamPlatformPurchaseManager), nameof(SteamPlatformPurchaseManager.IsProductUnlocked))]
53+
private static bool SteamPlatformPurchaseManager_IsProductUnlocked(ref bool __result, IAPProduct iapProduct)
54+
{
55+
__result = iapProduct == null;
56+
return iapProduct != null;
57+
}
58+
5159
[HarmonyPostfix]
5260
[HarmonyPatch(typeof(PurchaseManager), nameof(PurchaseManager.GetUnlockedTribes))]
5361
private static void PurchaseManager_GetUnlockedTribes(

0 commit comments

Comments
 (0)