@@ -20,6 +20,7 @@ public partial class MainWindow : Window
20
20
public static bool ModsOpened = false ;
21
21
public static bool ModsLoading = false ;
22
22
public static string GameVersion ;
23
+ public static string GameVersionDetected ; // the real game version detected from the game
23
24
public static string GameVersionOverride ;
24
25
public TaskCompletionSource < bool > VersionLoadStatus = new TaskCompletionSource < bool > ( ) ;
25
26
public static string [ ] serverList = { "国际源@BeatMods" , "国内源@WGzeyu" , "包子源@BeatTop" } ;
@@ -129,6 +130,7 @@ private async void LoadVersionsAsync()
129
130
Dictionary < string , string [ ] > aliases = JsonSerializer . Deserialize < Dictionary < string , string [ ] > > ( body ) ;
130
131
131
132
string version = Utils . GetVersion ( ) ;
133
+ GameVersionDetected = version ;
132
134
if ( ! versions . Contains ( version ) && CheckAliases ( versions , aliases , version ) == string . Empty )
133
135
{
134
136
versions . Insert ( 0 , version ) ;
@@ -281,7 +283,22 @@ private void OptionsButton_Click(object sender, RoutedEventArgs e)
281
283
282
284
private void InstallButton_Click ( object sender , RoutedEventArgs e )
283
285
{
284
- Mods . Instance . InstallMods ( ) ;
286
+ if ( string . IsNullOrEmpty ( GameVersionOverride ) // game version not listed in aliases at all
287
+ && GameVersion != GameVersionDetected ) // and the user manually selected a version
288
+ {
289
+ // show a waring about the version mismatch
290
+ var result = MessageBox . Show ( String . Format ( ( string ) Application . Current . FindResource ( "MainWindow:GameVersionMismatch" ) , GameVersion , GameVersionDetected ) ,
291
+ ( string ) Application . Current . FindResource ( "MainWindow:GameVersionMismatchTitle" ) , MessageBoxButton . OKCancel ) ;
292
+
293
+ if ( result == MessageBoxResult . OK )
294
+ {
295
+ Mods . Instance . InstallMods ( ) ;
296
+ }
297
+ }
298
+ else
299
+ {
300
+ Mods . Instance . InstallMods ( ) ;
301
+ }
285
302
}
286
303
287
304
private void InfoButton_Click ( object sender , RoutedEventArgs e )
0 commit comments