@@ -34,7 +34,7 @@ public static void HashSignatures(StringBuilder checksumString)
3434 /// Checks the signature of a saved game to ensure it is compatible with the current mods.
3535 /// </summary>
3636 /// <returns>True if the signatures match or if the check is ignored, false otherwise.</returns>
37- private static bool CheckSignatures ( Action < int , BaseEventData > action , int id , BaseEventData eventData , Il2CppSystem . Guid gameId )
37+ private static bool CheckSignatures ( Action action , Il2CppSystem . Guid gameId )
3838 {
3939 if ( sawSignatureWarning )
4040 {
@@ -67,13 +67,14 @@ private static bool CheckSignatures(Action<int, BaseEventData> action, int id, B
6767 }
6868 if ( ! doChecksumsMatch )
6969 {
70- PopupManager . GetBasicPopup ( new (
70+ PopupManager . GetBasicPopupWithData ( new (
7171 Localization . Get ( "polymod.signature.mismatch" ) ,
7272 Localization . Get ( "polymod.signature.incompatible" ) ,
7373 new ( new PopupBase . PopupButtonData [ ] {
7474 new ( "OK" )
7575 } )
7676 ) ) . Show ( ) ;
77+
7778 return false ;
7879 }
7980 return true ;
@@ -83,8 +84,8 @@ private static bool CheckSignatures(Action<int, BaseEventData> action, int id, B
8384 /// Performs compatibility checks when the start screen is shown.
8485 /// </summary>
8586 [ HarmonyPostfix ]
86- [ HarmonyPatch ( typeof ( StartScreen ) , nameof ( StartScreen . Start ) ) ]
87- private static void StartScreen_Start ( )
87+ [ HarmonyPatch ( typeof ( StartScreen_UI2 ) , nameof ( StartScreen_UI2 . OnShow ) ) ]
88+ private static void StartScreen_UI2_OnShow ( )
8889 {
8990 string lastChecksum = checksum ;
9091 try
@@ -113,18 +114,20 @@ private static void StartScreen_Start()
113114 VersionManager . SemanticVersion . Cast ( ) . CutRevision ( ) . ToString ( )
114115 ) ;
115116 PlayerPrefs . Save ( ) ;
116- PopupManager . GetBasicPopup ( new (
117- Localization . Get ( "polymod.version.mismatch" ) ,
118- Localization . Get ( "polymod.version.mismatch.description" ) ,
119- new ( new PopupBase . PopupButtonData [ ] {
120- new ( "buttons.stay" , customColorStates : ColorConstants . redButtonColorStates ) ,
121- new (
122- "buttons.exitgame" ,
123- PopupBase . PopupButtonData . States . None ,
124- ( Il2CppSystem . Action ) Application . Quit ,
125- closesPopup : false
126- )
127- } ) )
117+ PopupManager . GetBasicPopupWithData (
118+ new (
119+ Localization . Get ( "polymod.version.mismatch" ) ,
120+ Localization . Get ( "polymod.version.mismatch.description" ) ,
121+ new PopupBase . PopupButtonData [ ] {
122+ new ( "buttons.stay" , customColorStates : ColorConstants . redButtonColorStates ) ,
123+ new (
124+ "buttons.exitgame" ,
125+ PopupBase . PopupButtonData . States . None ,
126+ ( Il2CppSystem . Action ) Application . Quit ,
127+ closesPopup : false
128+ )
129+ }
130+ )
128131 ) . Show ( ) ;
129132 }
130133 }
@@ -134,19 +137,19 @@ private static void StartScreen_Start()
134137 /// </summary>
135138 [ HarmonyPrefix ]
136139 [ HarmonyPatch ( typeof ( GameInfoPopup ) , nameof ( GameInfoPopup . OnMainButtonClicked ) ) ]
137- private static bool GameInfoPopup_OnMainButtonClicked ( GameInfoPopup __instance , int id , BaseEventData eventData )
140+ private static bool GameInfoPopup_OnMainButtonClicked ( GameInfoPopup __instance )
138141 {
139- return CheckSignatures ( __instance . OnMainButtonClicked , id , eventData , __instance . gameId ) ;
142+ return CheckSignatures ( __instance . OnMainButtonClicked , __instance . gameId ) ;
140143 }
141144
142145 /// <summary>
143146 /// Checks the signature of a single-player game before resuming it.
144147 /// </summary>
145148 [ HarmonyPrefix ]
146- [ HarmonyPatch ( typeof ( StartScreen ) , nameof ( StartScreen . OnResumeButtonClick ) ) ]
147- private static bool StartScreen_OnResumeButtonClick ( StartScreen __instance , int id , BaseEventData eventData )
149+ [ HarmonyPatch ( typeof ( StartScreen_UI2 ) , nameof ( StartScreen_UI2 . OnResumeButtonLongPress ) ) ]
150+ private static bool StartScreen_OnResumeButtonClick ( StartScreen_UI2 __instance )
148151 {
149- return CheckSignatures ( __instance . OnResumeButtonClick , id , eventData , LocalSaveFileUtils . GetSaveFiles ( PolytopiaBackendBase . Game . GameType . SinglePlayer ) [ 0 ] ) ;
152+ return CheckSignatures ( __instance . OnResumeButtonLongPress , LocalSaveFileUtils . GetSaveFiles ( PolytopiaBackendBase . Game . GameType . SinglePlayer ) [ 0 ] ) ;
150153 }
151154
152155 /// <summary>
0 commit comments