Skip to content

Commit

Permalink
AppUI: Prompt to restart the app when changing the game path (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
barkermn01 authored Dec 11, 2024
1 parent 39647fd commit e1e2d19
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 5 deletions.
3 changes: 2 additions & 1 deletion AppCore/StringKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ public enum StringKey
EnterNameForCatalog,
GeneralSettingsHaveBeenUpdated,
SettingsNotValid,
MissingFf7ExePath,
MissingFf7ExePath,
Ff7ExePathChanged,
MissingLibraryPath,
MissingTexturesPath,
MissingMoviePath,
Expand Down
1 change: 1 addition & 0 deletions AppUI/Resources/Languages/StringResources.br.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@ Mais tarde, se quiser utilizar os arquivos de alta qualidade .OGG, mude a config

<system:String x:Key="VerifyingFf7Exe">Verificando ff7 exe ...</system:String>
<system:String x:Key="VerifyingFf7LauncherExe">Verifying FF7_Launcher exe ...</system:String>
<system:String x:Key="Ff7ExePathChanged">Alteração no caminho do jogo detectada, recomendamos fortemente que você reinicie o 7th Heaven. Você gostaria de fazer isso agora?</system:String>
<system:String x:Key="Ff7ExeDetectedToBeDifferent">ff7.exe detectado como diferente. Criando backup e copiando .exe correto ...</system:String>
<system:String x:Key="FailedToCopyFf7Exe">Não foi possível copiar ff7.exe. Abortando ...</system:String>
<system:String x:Key="FailedToCreateBackupOfFf7Exe">Não foi possível criar backup de ff7.exe. Abortando ...</system:String>
Expand Down
1 change: 1 addition & 0 deletions AppUI/Resources/Languages/StringResources.es.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ Haz clic en 'Cancelar' para detener el proceso.</system:String>

<system:String x:Key="SettingsNotValid">Configuración no válida</system:String>
<system:String x:Key="MissingFf7ExePath">Falta la ruta del FF7 Exe.</system:String>
<system:String x:Key="Ff7ExePathChanged">Se detectó un cambio en la ruta del juego, recomendamos encarecidamente que reinicies 7th Heaven. ¿Te gustaría hacerlo ahora?</system:String>
<system:String x:Key="MissingLibraryPath">Falta la ruta de la Biblioteca.</system:String>
<system:String x:Key="MissingTexturesPath">Falta la ruta de las Texturas (Aali OpenGL).</system:String>
<system:String x:Key="MissingMoviePath">Falta la ruta para las Cinemáticas.</system:String>
Expand Down
1 change: 1 addition & 0 deletions AppUI/Resources/Languages/StringResources.fr.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ Plus tard, si vous souhaitez utiliser des fichiers .OGG de haute qualité, remet

<system:String x:Key="VerifyingFf7Exe">Vérification de ff7 exe...</system:String>
<system:String x:Key="VerifyingFf7LauncherExe">Verifying FF7_Launcher exe ...</system:String>
<system:String x:Key="Ff7ExePathChanged">Changement de chemin de jeu détecté, nous vous recommandons vivement de redémarrer 7th Heaven. Souhaitez-vous le faire maintenant ?</system:String>
<system:String x:Key="Ff7ExeDetectedToBeDifferent">ff7.exe détecté comme étant différent. création d'une sauvegarde et copie du bon fichier .exe...</system:String>
<system:String x:Key="FailedToCopyFf7Exe">échec de la copie de ff7.exe. Abandon...</system:String>
<system:String x:Key="FailedToCreateBackupOfFf7Exe">échec de la création d'une sauvegarde de ff7.exe. Abandon...</system:String>
Expand Down
1 change: 1 addition & 0 deletions AppUI/Resources/Languages/StringResources.gr.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@

<system:String x:Key="SettingsNotValid">Οι ρυθμίσεις δεν είναι έγκυρες</system:String>
<system:String x:Key="MissingFf7ExePath">Λείπει η διαδρομή FF7 Exe.</system:String>
<system:String x:Key="Ff7ExePathChanged">Änderung des Spielpfads erkannt, wir empfehlen dringend, dass Sie 7th Heaven neu starten. Möchten Sie dies jetzt tun?</system:String>
<system:String x:Key="MissingLibraryPath">Λείπει η διαδρομή βιβλιοθήκης.</system:String>
<system:String x:Key="MissingTexturesPath">Λείπει η διαδρομή για Υφές (Aali OpenGL).</system:String>
<system:String x:Key="MissingMoviePath">Λείπει η διαδρομή για αρχεία βίντεο.</system:String>
Expand Down
1 change: 1 addition & 0 deletions AppUI/Resources/Languages/StringResources.ja.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ Click 'Cancel' to stop the process.</system:String>

<system:String x:Key="SettingsNotValid">Settings Not Valid</system:String>
<system:String x:Key="MissingFf7ExePath">Missing FF7 Exe path.</system:String>
<system:String x:Key="Ff7ExePathChanged">Game path change detected, we highly recommend you restart 7th heaven would you like to now?</system:String>
<system:String x:Key="MissingLibraryPath">Missing Library path.</system:String>
<system:String x:Key="MissingTexturesPath">Missing Textures (Aali OpenGL) path.</system:String>
<system:String x:Key="MissingMoviePath">Missing Movie path.</system:String>
Expand Down
1 change: 1 addition & 0 deletions AppUI/Resources/StringResources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ Click 'Cancel' to stop the process.</system:String>

<system:String x:Key="SettingsNotValid">Settings Not Valid</system:String>
<system:String x:Key="MissingFf7ExePath">Missing FF7 Exe path.</system:String>
<system:String x:Key="Ff7ExePathChanged">Game path change detected, we highly recommend you restart 7th heaven would you like to now?</system:String>
<system:String x:Key="MissingLibraryPath">Missing Library path.</system:String>
<system:String x:Key="MissingTexturesPath">Missing Textures (Aali OpenGL) path.</system:String>
<system:String x:Key="MissingMoviePath">Missing Movie path.</system:String>
Expand Down
4 changes: 0 additions & 4 deletions AppUI/ViewModels/GeneralSettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
using Microsoft.Win32;
using AppUI.Classes;
using AppUI.Windows;
using AppUI;
using AppUI.ViewModels;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace AppUI.ViewModels
Expand Down
26 changes: 26 additions & 0 deletions AppUI/Windows/GeneralSettingsWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
using AppUI.ViewModels;
using System.IO;
using System.Windows;
using System.Diagnostics;
using System;
using System.Threading;

namespace AppUI.Windows
{
Expand All @@ -20,6 +23,8 @@ public partial class GeneralSettingsWindow : Window

private FFNxDriverUpdater FFNxUpdater = new FFNxDriverUpdater();

private bool PathChanged = false;

public GeneralSettingsWindow()
{
InitializeComponent();
Expand All @@ -41,6 +46,21 @@ private void btnOk_Click(object sender, RoutedEventArgs e)
{
bool settingsSaved = ViewModel.SaveSettings();

if (PathChanged)
{
MessageDialogViewModel mdvm = MessageDialogWindow.Show(ResourceHelper.Get(StringKey.Ff7ExePathChanged),
ResourceHelper.Get(StringKey.Ff7ExePathChanged).Split(",")[0],
MessageBoxButton.YesNo,
MessageBoxImage.Warning);

if (mdvm.Result == MessageBoxResult.Yes)
{
string exePath = Process.GetCurrentProcess().MainModule.FileName;
Process.Start(exePath);
System.Windows.Application.Current.Shutdown();
}
}

if (settingsSaved)
{
this.DialogResult = true;
Expand Down Expand Up @@ -80,6 +100,12 @@ private void btnFf7Exe_Click(object sender, RoutedEventArgs e)

ViewModel.FF7ExePathInput = exePath;
}

string original = Sys.Settings.FF7Exe;
if ((original != null || original != "") && original != exePath )
{
PathChanged = true;
}
}

private void btnLibrary_Click(object sender, RoutedEventArgs e)
Expand Down

0 comments on commit e1e2d19

Please sign in to comment.