mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 16:17:27 +00:00
40 lines
849 B
C#
40 lines
849 B
C#
|
|
using Content.Shared.Preferences;
|
|
using Robust.Client.UserInterface.Controls;
|
|
|
|
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 ?? "";
|
|
}
|
|
|
|
private void RandomizeEverything()
|
|
{
|
|
Profile = HumanoidCharacterProfile.Random();
|
|
SetProfile(Profile, CharacterSlot);
|
|
SetDirty();
|
|
}
|
|
|
|
private void RandomizeName()
|
|
{
|
|
if (Profile == null) return;
|
|
var name = HumanoidCharacterProfile.GetName(Profile.Species, Profile.Gender);
|
|
SetName(name);
|
|
UpdateNameEdit();
|
|
}
|
|
}
|