Skip to content

Commit

Permalink
Added support for notifying / asking user to allow 7th heaven to rest…
Browse files Browse the repository at this point in the history
…art because they have changed there game path in the settings
  • Loading branch information
barkermn01 committed Dec 11, 2024
1 parent 39647fd commit 649f5d5
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 1 deletion.
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
27 changes: 27 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,22 @@ 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);

AppUI.MainWindow.dirtyHack.Close();
}
}

if (settingsSaved)
{
this.DialogResult = true;
Expand Down Expand Up @@ -80,6 +101,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
6 changes: 6 additions & 0 deletions AppUI/Windows/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ namespace AppUI
/// </summary>
public partial class MainWindow : Window
{
// whom ever though that the settigns save should be handled by this window was wrong
// the settings class it's self should have a save method inside it but it does not this is horrible but the only way for
// game directory change notification to work.
public static MainWindow dirtyHack;

private static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger();

internal MainWindowViewModel ViewModel { get; set; }
Expand All @@ -29,6 +34,7 @@ public partial class MainWindow : Window
public MainWindow()
{
InitializeComponent();
dirtyHack = this;

ViewModel = new MainWindowViewModel();
this.DataContext = ViewModel;
Expand Down

0 comments on commit 649f5d5

Please sign in to comment.