Skip to content

Commit 61bc194

Browse files
committed
returned removed patch
1 parent 22eca2a commit 61bc194

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/Managers/Compatibility.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,27 @@ private static bool StartScreen_OnResumeButtonClick(StartScreen __instance, int
155155
/// </summary>
156156
[HarmonyPostfix]
157157
[HarmonyPatch(typeof(GameInfoPopup), nameof(GameInfoPopup.DeletePaPGame))]
158-
private static void ClientBase_DeletePassAndPlayGame(GameInfoPopup __instance)
158+
private static void GameInfoPopup_DeletePaPGame(GameInfoPopup __instance)
159159
{
160160
File.Delete(Path.Combine(Application.persistentDataPath, $"{__instance.gameId}.signatures"));
161161
}
162162

163+
/// <summary>
164+
/// Deletes the signature file of all singleplayer games when they are deleted.
165+
/// </summary>
166+
[HarmonyPrefix]
167+
[HarmonyPatch(typeof(LocalSaveFileUtils), nameof(LocalSaveFileUtils.DeleteAllSaveFilesOfType))]
168+
private static void LocalSaveFileUtils_DeleteAllSaveFilesOfType(PolytopiaBackendBase.Game.GameType gameType, bool localOnly)
169+
{
170+
if (gameType == PolytopiaBackendBase.Game.GameType.SinglePlayer)
171+
{
172+
foreach (var gameId in LocalSaveFileUtils.GetSaveFiles(PolytopiaBackendBase.Game.GameType.SinglePlayer))
173+
{
174+
File.Delete(Path.Combine(Application.persistentDataPath, $"{gameId}.signatures"));
175+
}
176+
}
177+
}
178+
163179
/// <summary>
164180
/// Deletes the signature file of a game when the match ends.
165181
/// </summary>

0 commit comments

Comments
 (0)