@@ -19,6 +19,7 @@ public partial class MainWindow : Window
1919 public static bool ModsOpened = false ;
2020 public static bool ModsLoading = false ;
2121 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
2223 public static string GameVersionOverride ;
2324 public TaskCompletionSource < bool > VersionLoadStatus = new TaskCompletionSource < bool > ( ) ;
2425
@@ -118,6 +119,7 @@ private async void LoadVersionsAsync()
118119 var aliases = await Utils . GetAliasDictionary ( ) ;
119120
120121 string version = await Utils . GetVersion ( ) ;
122+ GameVersionDetected = version ;
121123 if ( ! versions . Contains ( version ) && CheckAliases ( versions , aliases , version ) == string . Empty )
122124 {
123125 versions . Insert ( 0 , version ) ;
@@ -270,7 +272,22 @@ private void OptionsButton_Click(object sender, RoutedEventArgs e)
270272
271273 private void InstallButton_Click ( object sender , RoutedEventArgs e )
272274 {
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+ }
274291 }
275292
276293 private void InfoButton_Click ( object sender , RoutedEventArgs e )
0 commit comments