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 <helloworld@eoinrul.es>

(cherry picked from commit 55771cab745bf45e4756ded41382ef990b84d505)
This commit is contained in:
eoineoineoin
2024-08-27 13:20:12 +03:00
committed by Spatison
parent b7164a9bd2
commit 685b1f68ac

View File

@@ -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();
}
/// <summary>
@@ -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
}