@@ -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 actual game version detected from the game, 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,22 @@ 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
276
+ && GameVersion != GameVersionDetected ) // and the user manually selected a version
277
+ {
278
+ // show a waring about the version mismatch
279
+ var result = MessageBox . Show ( String . Format ( ( string ) Application . Current . FindResource ( "MainWindow:GameVersionMismatch" ) , GameVersion , GameVersionDetected ) ,
280
+ ( string ) Application . Current . FindResource ( "MainWindow:GameVersionMismatchTitle" ) , MessageBoxButton . OKCancel ) ;
281
+
282
+ if ( result == MessageBoxResult . OK )
283
+ {
284
+ Mods . Instance . InstallMods ( ) ;
285
+ }
286
+ }
287
+ else
288
+ {
289
+ Mods . Instance . InstallMods ( ) ;
290
+ }
274
291
}
275
292
276
293
private void InfoButton_Click ( object sender , RoutedEventArgs e )
0 commit comments