Skip to content

Commit

Permalink
added warning when closing anamnesis while posing mode is active
Browse files Browse the repository at this point in the history
Fixes #358
  • Loading branch information
Yuki-Codes committed May 14, 2021
1 parent 9b5be49 commit e1d10ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Anamnesis/Languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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!",
Expand Down Expand Up @@ -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.",
Expand Down
13 changes: 12 additions & 1 deletion Anamnesis/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit e1d10ac

Please sign in to comment.