mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* init * tweak lightness * add randomize helpers, refactor to use * wip * wip * wip * wip * docs, cleanup * review partial * review wip (doesnt build) * wip (now working, but found a bug) * touchups * less ambiguity * Tweak the UI, make LockButton a BoxContainer --------- Co-authored-by: AJCM-git <ajcm_mail@disroot.org>
35 lines
810 B
C#
35 lines
810 B
C#
|
|
using Content.Shared.Preferences;
|
|
|
|
namespace Content.Client.Lobby.UI;
|
|
|
|
public sealed partial class HumanoidProfileEditor
|
|
{
|
|
private void SetName(string newName)
|
|
{
|
|
Profile = Profile?.WithName(newName);
|
|
SetDirty();
|
|
|
|
if (!IsDirty)
|
|
return;
|
|
|
|
SpriteView.SetName(newName);
|
|
}
|
|
|
|
private void UpdateNameEdit()
|
|
{
|
|
NameEdit.Text = Profile?.Name ?? "";
|
|
}
|
|
|
|
/// <summary>
|
|
/// Randomize values selectively while respecting locked values.
|
|
/// </summary>
|
|
private void RandomizeProfile()
|
|
{
|
|
Profile = Profile == null
|
|
? HumanoidCharacterProfile.Random()
|
|
: HumanoidCharacterProfile.Random(RandomizeLockButton.RandomizeCfg, Profile!);
|
|
SetProfile(Profile, CharacterSlot);
|
|
SetDirty();
|
|
}
|
|
}
|