@@ -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
0 commit comments