private void onRelaunch() { var mainWindow = this.MainWindow; _splashWindow = buildSplashWindow(); MainWindow = _splashWindow; mainWindow.Close(); this.MainWindow.Show(); EventLogger.logEvent("showGameFilesWindow"); var gameFilesWindow = new GameFilesWindow(allowNoContent: false); gameFilesWindow.Owner = this.MainWindow; gameFilesWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen; gameFilesWindow.ShowDialog(); var gameFilesWindowResult = gameFilesWindow.result; switch (gameFilesWindowResult) { case GameFilesWindow.GameFilesWindowResult.exit: this.Shutdown(); break; case GameFilesWindow.GameFilesWindowResult.useSelectedPath: loadGameContentAsync(gameFilesWindow.selectedPath !); break; case GameFilesWindow.GameFilesWindowResult.noContent: showMainWindow(); break; } }
public static GameFilesWindow createGameFilesWindow(string?defaultPath, bool allowNoContent) { var gameFilesWindow = new GameFilesWindow(defaultPath, allowNoContent: allowNoContent); gameFilesWindow.Owner = Application.Current.MainWindow; gameFilesWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen; return(gameFilesWindow); }
private void load() { //check default install locations string?paksFolderPath = ImageUriHelper.usableGameContentIfExists(); if (_askForGameContentLocation || string.IsNullOrWhiteSpace(paksFolderPath)) { //show dialog asking for install location EventLogger.logEvent("showGameFilesWindow"); var gameFilesWindow = new GameFilesWindow(allowNoContent: true); gameFilesWindow.Owner = this.MainWindow; gameFilesWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen; gameFilesWindow.ShowDialog(); var gameFilesWindowResult = gameFilesWindow.result; switch (gameFilesWindowResult) { case GameFilesWindow.GameFilesWindowResult.exit: this.Shutdown(); break; case GameFilesWindow.GameFilesWindowResult.useSelectedPath: loadGameContentAsync(gameFilesWindow.selectedPath !); break; case GameFilesWindow.GameFilesWindowResult.noContent: showMainWindow(); break; } } else { try { loadGameContentAsync(paksFolderPath !); } catch (Exception e) { MessageBox.Show($"{e.Message}\n{e.StackTrace}", R.ERROR); this.Shutdown(); return; } } }