@@ -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,15 @@ private static bool CheckSignatures(Action<int, BaseEventData> action, int id, B
6767 }
6868 if ( ! doChecksumsMatch )
6969 {
70- PopupManager . GetBasicPopup ( new (
71- Localization . Get ( "polymod.signature.mismatch" ) ,
72- Localization . Get ( "polymod.signature.incompatible" ) ,
73- new ( new PopupBase . PopupButtonData [ ] {
74- new ( "OK" )
75- } )
76- ) ) . Show ( ) ;
70+ BasicPopup popup = PopupManager . GetBasicPopup ( ) ;
71+ popup . Header = Localization . Get ( "polymod.signature.mismatch" ) ;
72+ popup . Description = Localization . Get ( "polymod.signature.incompatible" ) ;
73+ popup . buttonData = new PopupBase . PopupButtonData [ ] {
74+ new ( "OK" )
75+ } ;
76+
77+ popup . Show ( ) ;
78+
7779 return false ;
7880 }
7981 return true ;
@@ -83,8 +85,8 @@ private static bool CheckSignatures(Action<int, BaseEventData> action, int id, B
8385 /// Performs compatibility checks when the start screen is shown.
8486 /// </summary>
8587 [ HarmonyPostfix ]
86- [ HarmonyPatch ( typeof ( StartScreen ) , nameof ( StartScreen . Start ) ) ]
87- private static void StartScreen_Start ( )
88+ [ HarmonyPatch ( typeof ( StartScreen_UI2 ) , nameof ( StartScreen_UI2 . OnShow ) ) ]
89+ private static void StartScreen_UI2_OnShow ( )
8890 {
8991 string lastChecksum = checksum ;
9092 try
@@ -113,19 +115,21 @@ private static void StartScreen_Start()
113115 VersionManager . SemanticVersion . Cast ( ) . CutRevision ( ) . ToString ( )
114116 ) ;
115117 PlayerPrefs . Save ( ) ;
116- PopupManager . GetBasicPopup ( new (
117- Localization . Get ( "polymod.version.mismatch" ) ,
118- Localization . Get ( "polymod.version.mismatch.description" ) ,
119- new ( new PopupBase . PopupButtonData [ ] {
118+
119+ BasicPopup popup = PopupManager . GetBasicPopup ( ) ;
120+ popup . Header = Localization . Get ( "polymod.version.mismatch" ) ;
121+ popup . Description = Localization . Get ( "polymod.version.mismatch.description" ) ;
122+ popup . buttonData = new PopupBase . PopupButtonData [ ] {
120123 new ( "buttons.stay" , customColorStates : ColorConstants . redButtonColorStates ) ,
121124 new (
122125 "buttons.exitgame" ,
123126 PopupBase . PopupButtonData . States . None ,
124127 ( Il2CppSystem . Action ) Application . Quit ,
125128 closesPopup : false
126129 )
127- } ) )
128- ) . Show ( ) ;
130+ } ;
131+
132+ popup . Show ( ) ;
129133 }
130134 }
131135
@@ -134,19 +138,19 @@ private static void StartScreen_Start()
134138 /// </summary>
135139 [ HarmonyPrefix ]
136140 [ HarmonyPatch ( typeof ( GameInfoPopup ) , nameof ( GameInfoPopup . OnMainButtonClicked ) ) ]
137- private static bool GameInfoPopup_OnMainButtonClicked ( GameInfoPopup __instance , int id , BaseEventData eventData )
141+ private static bool GameInfoPopup_OnMainButtonClicked ( GameInfoPopup __instance )
138142 {
139- return CheckSignatures ( __instance . OnMainButtonClicked , id , eventData , __instance . gameId ) ;
143+ return CheckSignatures ( __instance . OnMainButtonClicked , __instance . gameId ) ;
140144 }
141145
142146 /// <summary>
143147 /// Checks the signature of a single-player game before resuming it.
144148 /// </summary>
145149 [ HarmonyPrefix ]
146- [ HarmonyPatch ( typeof ( StartScreen ) , nameof ( StartScreen . OnResumeButtonClick ) ) ]
147- private static bool StartScreen_OnResumeButtonClick ( StartScreen __instance , int id , BaseEventData eventData )
150+ [ HarmonyPatch ( typeof ( StartScreen_UI2 ) , nameof ( StartScreen_UI2 . OnResumeButtonLongPress ) ) ]
151+ private static bool StartScreen_OnResumeButtonClick ( StartScreen_UI2 __instance )
148152 {
149- return CheckSignatures ( __instance . OnResumeButtonClick , id , eventData , LocalSaveFileUtils . GetSaveFiles ( PolytopiaBackendBase . Game . GameType . SinglePlayer ) [ 0 ] ) ;
153+ return CheckSignatures ( __instance . OnResumeButtonLongPress , LocalSaveFileUtils . GetSaveFiles ( PolytopiaBackendBase . Game . GameType . SinglePlayer ) [ 0 ] ) ;
150154 }
151155
152156 /// <summary>
0 commit comments