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>
This commit is contained in:
@@ -718,6 +718,9 @@ namespace Content.Client.Lobby.UI
|
||||
PreviewDummy = _controller.LoadProfileEntity(Profile, JobOverride, ShowClothes.Pressed);
|
||||
SpriteView.SetEntity(PreviewDummy);
|
||||
_entManager.System<MetaDataSystem>().SetEntityName(PreviewDummy, Profile.Name);
|
||||
|
||||
// Check and set the dirty flag to enable the save/reset buttons as appropriate.
|
||||
SetDirty();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -778,6 +781,9 @@ namespace Content.Client.Lobby.UI
|
||||
return;
|
||||
|
||||
_entManager.System<HumanoidAppearanceSystem>().LoadProfile(PreviewDummy, Profile);
|
||||
|
||||
// Check and set the dirty flag to enable the save/reset buttons as appropriate.
|
||||
SetDirty();
|
||||
}
|
||||
|
||||
private void OnSpeciesInfoButtonPressed(BaseButton.ButtonEventArgs args)
|
||||
@@ -1014,7 +1020,6 @@ namespace Content.Client.Lobby.UI
|
||||
roleLoadout.AddLoadout(loadoutGroup, loadoutProto, _prototypeManager);
|
||||
_loadoutWindow.RefreshLoadouts(roleLoadout, session, collection);
|
||||
Profile = Profile?.WithLoadout(roleLoadout);
|
||||
SetDirty();
|
||||
ReloadPreview();
|
||||
};
|
||||
|
||||
@@ -1023,7 +1028,6 @@ namespace Content.Client.Lobby.UI
|
||||
roleLoadout.RemoveLoadout(loadoutGroup, loadoutProto, _prototypeManager);
|
||||
_loadoutWindow.RefreshLoadouts(roleLoadout, session, collection);
|
||||
Profile = Profile?.WithLoadout(roleLoadout);
|
||||
SetDirty();
|
||||
ReloadPreview();
|
||||
};
|
||||
|
||||
@@ -1033,7 +1037,6 @@ namespace Content.Client.Lobby.UI
|
||||
_loadoutWindow.OnClose += () =>
|
||||
{
|
||||
JobOverride = null;
|
||||
SetDirty();
|
||||
ReloadPreview();
|
||||
};
|
||||
|
||||
@@ -1058,7 +1061,6 @@ namespace Content.Client.Lobby.UI
|
||||
return;
|
||||
|
||||
Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithMarkings(markings.GetForwardEnumerator().ToList()));
|
||||
SetDirty();
|
||||
ReloadProfilePreview();
|
||||
}
|
||||
|
||||
@@ -1126,7 +1128,6 @@ namespace Content.Client.Lobby.UI
|
||||
}
|
||||
}
|
||||
|
||||
SetDirty();
|
||||
ReloadProfilePreview();
|
||||
}
|
||||
|
||||
@@ -1157,7 +1158,6 @@ namespace Content.Client.Lobby.UI
|
||||
{
|
||||
Profile = Profile?.WithAge(newAge);
|
||||
ReloadPreview();
|
||||
SetDirty();
|
||||
}
|
||||
|
||||
private void SetSex(Sex newSex)
|
||||
@@ -1180,14 +1180,12 @@ namespace Content.Client.Lobby.UI
|
||||
UpdateGenderControls();
|
||||
Markings.SetSex(newSex);
|
||||
ReloadPreview();
|
||||
SetDirty();
|
||||
}
|
||||
|
||||
private void SetGender(Gender newGender)
|
||||
{
|
||||
Profile = Profile?.WithGender(newGender);
|
||||
ReloadPreview();
|
||||
SetDirty();
|
||||
}
|
||||
|
||||
private void SetSpecies(string newSpecies)
|
||||
@@ -1201,7 +1199,6 @@ namespace Content.Client.Lobby.UI
|
||||
RefreshLoadouts();
|
||||
UpdateSexControls(); // update sex for new species
|
||||
UpdateSpeciesGuidebookIcon();
|
||||
SetDirty();
|
||||
ReloadPreview();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user