diff --git a/Anamnesis/Languages/en.json b/Anamnesis/Languages/en.json index d7a375ae7..7429265f8 100644 --- a/Anamnesis/Languages/en.json +++ b/Anamnesis/Languages/en.json @@ -8,6 +8,7 @@ "Common_All": "All", "Common_Scale": "Scale", "Common_LinkVector": "Link X, Y, and Z axes together", + "Common_Confirm": "Confirm", "Error_NotInGame": "Not Signed In", "Error_WrongVersion": "Unsupported game version: {0}. Has a patch come out recently?\nUsing Anamnesis with unsupported game versions can cause game/app crashes.\nWe will have an update out as soon as we can. Thank you for your patience!", @@ -147,6 +148,7 @@ "Pose_WarningNotGPose": "Posing is only available while in Group Pose. Type /gpose in chat.", "Pose_WarningNotFrozen": "Actor motion must be disabled in the Group Pose settings.", + "Pose_WarningQuit": "Are you sure you want to quit? Current pose will be lost.", "Pose_GenerateSkeletonTitle": "Skeleton not found", "Pose_GenerateSkeleton": "No skeleton was found for the actor {0}. Generate one now?\nThis will disable posing, resetting all models to their default positions.\nWithout a skeleton, parenting will not work correctly.", "Pose_Generating": "Generating Skeleton. Please Wait.", diff --git a/Anamnesis/MainWindow.xaml.cs b/Anamnesis/MainWindow.xaml.cs index 5c332b0ab..0165d773b 100644 --- a/Anamnesis/MainWindow.xaml.cs +++ b/Anamnesis/MainWindow.xaml.cs @@ -18,6 +18,7 @@ namespace Anamnesis.GUI using Anamnesis.GUI.Dialogs; using Anamnesis.GUI.Views; using Anamnesis.Memory; + using Anamnesis.PoseModule; using Anamnesis.Services; using Anamnesis.Utils; using Anamnesis.Views; @@ -190,8 +191,18 @@ private void Window_Deactivated(object sender, EventArgs e) this.ActiveBorder.Visibility = Visibility.Collapsed; } - private void OnCloseClick(object sender, RoutedEventArgs e) + private async void OnCloseClick(object sender, RoutedEventArgs e) { + if (PoseService.Exists && PoseService.Instance.IsEnabled) + { + bool? result = await GenericDialog.Show(LocalizationService.GetString("Pose_WarningQuit"), LocalizationService.GetString("Common_Confirm"), MessageBoxButton.OKCancel); + + if (result != true) + { + return; + } + } + this.Close(); }