Skip to content

Commit

Permalink
Game Driver UI: Return a friendly message instead of a crash
Browse files Browse the repository at this point in the history
This patch will provide a user-friendly message that will tell the user to update FFNx to the latest version if the FFNx.toml file parsing fails ( likely because is out of sync with 7th ).
  • Loading branch information
julianxhokaxhiu committed Aug 6, 2022
1 parent 2fdbdfc commit 294edda
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 4 deletions.
1 change: 1 addition & 0 deletions 7thHeaven.Code/StringKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -643,5 +643,6 @@ public enum StringKey
DoNotMount,
CanaryWarningTitle,
CanaryWarningMessage,
PleaseUpdateFFNx
}
}
2 changes: 2 additions & 0 deletions SeventhHeavenUI/Resources/Languages/StringResources.br.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1245,4 +1245,6 @@ Você quer aplicar essa configuração e tentar de novo?</system:String>

<system:String x:Key="CanaryWarningTitle">PLEASE READ THIS!</system:String>
<system:String x:Key="CanaryWarningMessage">Thank you for switching to the Canary channel.\n\nThis channel is suggested only for advanced users who are willing to support the development and report bugs. DO NOT USE this channel if you're willing to have a Stable gameplay experience.\n\nPlease be aware it may be prone to crashing and is NOT tested by anyone. Use this build AT YOUR OWN RISK!</system:String>

<system:String x:Key="PleaseUpdateFFNx">Could not load the settings from the FFNx.toml file. This likely happens when your current version of FFNx is outdated. Consider updating FFNx to the latest version available for your chosen Channel and try again.</system:String>
</ResourceDictionary>
2 changes: 2 additions & 0 deletions SeventhHeavenUI/Resources/Languages/StringResources.de.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1258,4 +1258,6 @@ Aktivieren und erneut versuchen?</system:String>

<system:String x:Key="CanaryWarningTitle">PLEASE READ THIS!</system:String>
<system:String x:Key="CanaryWarningMessage">Thank you for switching to the Canary channel.\n\nThis channel is suggested only for advanced users who are willing to support the development and report bugs. DO NOT USE this channel if you're willing to have a Stable gameplay experience.\n\nPlease be aware it may be prone to crashing and is NOT tested by anyone. Use this build AT YOUR OWN RISK!</system:String>

<system:String x:Key="PleaseUpdateFFNx">Could not load the settings from the FFNx.toml file. This likely happens when your current version of FFNx is outdated. Consider updating FFNx to the latest version available for your chosen Channel and try again.</system:String>
</ResourceDictionary>
2 changes: 2 additions & 0 deletions SeventhHeavenUI/Resources/Languages/StringResources.es.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1254,4 +1254,6 @@ Por último, si quieres usar archivos .OGG de alta calidad, cambia la opción de

<system:String x:Key="CanaryWarningTitle">PLEASE READ THIS!</system:String>
<system:String x:Key="CanaryWarningMessage">Thank you for switching to the Canary channel.\n\nThis channel is suggested only for advanced users who are willing to support the development and report bugs. DO NOT USE this channel if you're willing to have a Stable gameplay experience.\n\nPlease be aware it may be prone to crashing and is NOT tested by anyone. Use this build AT YOUR OWN RISK!</system:String>

<system:String x:Key="PleaseUpdateFFNx">Could not load the settings from the FFNx.toml file. This likely happens when your current version of FFNx is outdated. Consider updating FFNx to the latest version available for your chosen Channel and try again.</system:String>
</ResourceDictionary>
2 changes: 2 additions & 0 deletions SeventhHeavenUI/Resources/Languages/StringResources.fr.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1240,4 +1240,6 @@ Voulez-vous appliquer ce réglage et essayer à nouveau ?</system:String>

<system:String x:Key="CanaryWarningTitle">PLEASE READ THIS!</system:String>
<system:String x:Key="CanaryWarningMessage">Thank you for switching to the Canary channel.\n\nThis channel is suggested only for advanced users who are willing to support the development and report bugs. DO NOT USE this channel if you're willing to have a Stable gameplay experience.\n\nPlease be aware it may be prone to crashing and is NOT tested by anyone. Use this build AT YOUR OWN RISK!</system:String>

<system:String x:Key="PleaseUpdateFFNx">Could not load the settings from the FFNx.toml file. This likely happens when your current version of FFNx is outdated. Consider updating FFNx to the latest version available for your chosen Channel and try again.</system:String>
</ResourceDictionary>
2 changes: 2 additions & 0 deletions SeventhHeavenUI/Resources/Languages/StringResources.gr.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1248,4 +1248,6 @@

<system:String x:Key="CanaryWarningTitle">PLEASE READ THIS!</system:String>
<system:String x:Key="CanaryWarningMessage">Thank you for switching to the Canary channel.\n\nThis channel is suggested only for advanced users who are willing to support the development and report bugs. DO NOT USE this channel if you're willing to have a Stable gameplay experience.\n\nPlease be aware it may be prone to crashing and is NOT tested by anyone. Use this build AT YOUR OWN RISK!</system:String>

<system:String x:Key="PleaseUpdateFFNx">Could not load the settings from the FFNx.toml file. This likely happens when your current version of FFNx is outdated. Consider updating FFNx to the latest version available for your chosen Channel and try again.</system:String>
</ResourceDictionary>
2 changes: 2 additions & 0 deletions SeventhHeavenUI/Resources/Languages/StringResources.it.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1244,4 +1244,6 @@ Vuoi applicare questa modifica e riprovare?</system:String>

<system:String x:Key="CanaryWarningTitle">PLEASE READ THIS!</system:String>
<system:String x:Key="CanaryWarningMessage">Thank you for switching to the Canary channel.\n\nThis channel is suggested only for advanced users who are willing to support the development and report bugs. DO NOT USE this channel if you're willing to have a Stable gameplay experience.\n\nPlease be aware it may be prone to crashing and is NOT tested by anyone. Use this build AT YOUR OWN RISK!</system:String>

<system:String x:Key="PleaseUpdateFFNx">Could not load the settings from the FFNx.toml file. This likely happens when your current version of FFNx is outdated. Consider updating FFNx to the latest version available for your chosen Channel and try again.</system:String>
</ResourceDictionary>
2 changes: 2 additions & 0 deletions SeventhHeavenUI/Resources/StringResources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1253,4 +1253,6 @@ Do you want to apply the setting and try again?</system:String>

<system:String x:Key="CanaryWarningTitle">PLEASE READ THIS!</system:String>
<system:String x:Key="CanaryWarningMessage">Thank you for switching to the Canary channel.\n\nThis channel is suggested only for advanced users who are willing to support the development and report bugs. DO NOT USE this channel if you're willing to have a Stable gameplay experience.\n\nPlease be aware it may be prone to crashing and is NOT tested by anyone. Use this build AT YOUR OWN RISK!</system:String>

<system:String x:Key="PleaseUpdateFFNx">Could not load the settings from the FFNx.toml file. This likely happens when your current version of FFNx is outdated. Consider updating FFNx to the latest version available for your chosen Channel and try again.</system:String>
</ResourceDictionary>
16 changes: 12 additions & 4 deletions SeventhHeavenUI/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1824,10 +1824,18 @@ internal void ShowGameDriverConfigWindow()
{
Sys.FFNxConfig.Reload();

ConfigureGLWindow gLWindow = new ConfigureGLWindow();
if (gLWindow.Init(Sys.PathToGameDriverUiXml(Sys.Settings.AppLanguage)))
{
gLWindow.ShowDialog();
try
{
ConfigureGLWindow gLWindow = new ConfigureGLWindow();
if (gLWindow.Init(Sys.PathToGameDriverUiXml(Sys.Settings.AppLanguage)))
{
gLWindow.ShowDialog();
}
}
catch (Exception e)
{
Logger.Error(e);
MessageDialogWindow.Show(ResourceHelper.Get(StringKey.PleaseUpdateFFNx), ResourceHelper.Get(StringKey.Error), MessageBoxButton.OK, MessageBoxImage.Error);
}
}
else
Expand Down

0 comments on commit 294edda

Please sign in to comment.