@@ -19,6 +19,7 @@ public partial class MainWindow : Window
19
19
public static bool ModsOpened = false ;
20
20
public static bool ModsLoading = false ;
21
21
public static string GameVersion ;
22
+ public static string GameVersionDetected ; // the real game version detected from the game
22
23
public static string GameVersionOverride ;
23
24
public TaskCompletionSource < bool > VersionLoadStatus = new TaskCompletionSource < bool > ( ) ;
24
25
@@ -123,6 +124,7 @@ private async void LoadVersionsAsync()
123
124
Dictionary < string , string [ ] > aliases = JsonSerializer . Deserialize < Dictionary < string , string [ ] > > ( body ) ;
124
125
125
126
string version = Utils . GetVersion ( ) ;
127
+ GameVersionDetected = version ;
126
128
if ( ! versions . Contains ( version ) && CheckAliases ( versions , aliases , version ) == string . Empty )
127
129
{
128
130
versions . Insert ( 0 , version ) ;
@@ -275,7 +277,22 @@ private void OptionsButton_Click(object sender, RoutedEventArgs e)
275
277
276
278
private void InstallButton_Click ( object sender , RoutedEventArgs e )
277
279
{
278
- Mods . Instance . InstallMods ( ) ;
280
+ if ( string . IsNullOrEmpty ( GameVersionOverride ) // game version not listed in aliases at all
281
+ && GameVersion != GameVersionDetected ) // and the user manually selected a version
282
+ {
283
+ // show a waring about the version mismatch
284
+ var result = MessageBox . Show ( String . Format ( ( string ) Application . Current . FindResource ( "MainWindow:GameVersionMismatch" ) , GameVersion , GameVersionDetected ) ,
285
+ ( string ) Application . Current . FindResource ( "MainWindow:GameVersionMismatchTitle" ) , MessageBoxButton . OKCancel ) ;
286
+
287
+ if ( result == MessageBoxResult . OK )
288
+ {
289
+ Mods . Instance . InstallMods ( ) ;
290
+ }
291
+ }
292
+ else
293
+ {
294
+ Mods . Instance . InstallMods ( ) ;
295
+ }
279
296
}
280
297
281
298
private void InfoButton_Click ( object sender , RoutedEventArgs e )
0 commit comments