@@ -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 game version detected from the game files, will be empty if not known by BeatMods
22
23
public static string GameVersionOverride ;
23
24
public TaskCompletionSource < bool > VersionLoadStatus = new TaskCompletionSource < bool > ( ) ;
24
25
@@ -118,6 +119,7 @@ private async void LoadVersionsAsync()
118
119
var aliases = await Utils . GetAliasDictionary ( ) ;
119
120
120
121
string version = await Utils . GetVersion ( ) ;
122
+ GameVersionDetected = version ;
121
123
if ( ! versions . Contains ( version ) && CheckAliases ( versions , aliases , version ) == string . Empty )
122
124
{
123
125
versions . Insert ( 0 , version ) ;
@@ -270,7 +272,29 @@ private void OptionsButton_Click(object sender, RoutedEventArgs e)
270
272
271
273
private void InstallButton_Click ( object sender , RoutedEventArgs e )
272
274
{
273
- Mods . Instance . InstallMods ( ) ;
275
+ if ( string . IsNullOrEmpty ( GameVersionOverride ) // game version not listed in aliases at all, i.e. not a known version by BeatMods
276
+ && GameVersion != GameVersionDetected ) // and the user manually selected a version
277
+ {
278
+
279
+ string detected = string . IsNullOrEmpty ( GameVersionDetected )
280
+ ? ( string ) Application . Current . FindResource ( "MainWindow:GameVersionUnknown" )
281
+ : GameVersionDetected ;
282
+
283
+ // show a waring about the version mismatch
284
+ var result = MessageBox . Show (
285
+ string . Format ( ( string ) Application . Current . FindResource ( "MainWindow:GameVersionMismatch" ) , GameVersion , detected ) ,
286
+ ( string ) Application . Current . FindResource ( "MainWindow:GameVersionMismatchTitle" ) ,
287
+ MessageBoxButton . OKCancel ) ;
288
+
289
+ if ( result == MessageBoxResult . OK )
290
+ {
291
+ Mods . Instance . InstallMods ( ) ;
292
+ }
293
+ }
294
+ else
295
+ {
296
+ Mods . Instance . InstallMods ( ) ;
297
+ }
274
298
}
275
299
276
300
private void InfoButton_Click ( object sender , RoutedEventArgs e )
0 commit comments