From 685b1f68acb7dcc728043faa499ddc856006ff89 Mon Sep 17 00:00:00 2001 From: eoineoineoin Date: Tue, 27 Aug 2024 13:20:12 +0300 Subject: [PATCH] Minor fixes to character profile editor save/reset buttons (#31505) Merge SetDirty() with preview reload People were forgetting to SetDirty() when changing a property; move SetDirty() into preview reloading, since if the preview is being reloaded, some property has definitely changed anyway. Co-authored-by: Eoin Mcloughlin (cherry picked from commit 55771cab745bf45e4756ded41382ef990b84d505) --- .../Lobby/UI/HumanoidProfileEditor.xaml.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs index fc7850bcb4..95d56da65d 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs @@ -948,6 +948,9 @@ namespace Content.Client.Lobby.UI SpriteViewN.SetEntity(PreviewDummy); SpriteViewE.SetEntity(PreviewDummy); SpriteViewW.SetEntity(PreviewDummy); + + // Check and set the dirty flag to enable the save/reset buttons as appropriate. + SetDirty(); } /// @@ -1046,6 +1049,9 @@ namespace Content.Client.Lobby.UI TraitsTabs.UpdateTabMerging(); LoadoutsTabs.UpdateTabMerging(); + + // Check and set the dirty flag to enable the save/reset buttons as appropriate. + SetDirty(); } private void LoadoutsChanged(bool enabled) @@ -1226,7 +1232,6 @@ namespace Content.Client.Lobby.UI return; Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithMarkings(markings.GetForwardEnumerator().ToList())); - SetDirty(); ReloadProfilePreview(); } @@ -1315,7 +1320,6 @@ namespace Content.Client.Lobby.UI } } - SetDirty(); ReloadProfilePreview(); } @@ -1335,7 +1339,6 @@ namespace Content.Client.Lobby.UI { Profile = Profile?.WithAge(newAge); ReloadPreview(); - IsDirty = true; } private void SetSex(Sex newSex) @@ -1361,7 +1364,6 @@ namespace Content.Client.Lobby.UI UpdateBodyTypes(); // WD EDIT UpdateBarksControl(); // WD EDIT ReloadProfilePreview(); - SetDirty(); } // WD EDIT START @@ -1383,7 +1385,6 @@ namespace Content.Client.Lobby.UI { Profile = Profile?.WithGender(newGender); ReloadPreview(); - IsDirty = true; } private void SetDisplayPronouns(string? displayPronouns) @@ -1447,7 +1448,6 @@ namespace Content.Client.Lobby.UI UpdateWeight(); UpdateSpeciesGuidebookIcon(); UpdateBodyTypes(); // WD EDIT - IsDirty = true; ReloadProfilePreview(); ReloadClothes(); // Species may have job-specific gear, reload the clothes }