Role subtypes (#35359)
This commit is contained in:
@@ -221,18 +221,11 @@ public sealed class CharacterUIController : UIController, IOnStateEntered<Gamepl
|
||||
if (!_ent.TryGetComponent<MindComponent>(container.Mind.Value, out var mind))
|
||||
return;
|
||||
|
||||
var roleText = Loc.GetString("role-type-crew-aligned-name");
|
||||
var color = Color.White;
|
||||
if (_prototypeManager.TryIndex(mind.RoleType, out var proto))
|
||||
{
|
||||
roleText = Loc.GetString(proto.Name);
|
||||
color = proto.Color;
|
||||
}
|
||||
else
|
||||
_sawmill.Error($"{_player.LocalEntity} has invalid Role Type '{mind.RoleType}'. Displaying '{roleText}' instead");
|
||||
if (!_prototypeManager.TryIndex(mind.RoleType, out var proto))
|
||||
_sawmill.Error($"Player '{_player.LocalSession}' has invalid Role Type '{mind.RoleType}'. Displaying default instead");
|
||||
|
||||
_window.RoleType.Text = roleText;
|
||||
_window.RoleType.FontColorOverride = color;
|
||||
_window.RoleType.Text = Loc.GetString(proto?.Name ?? "role-type-crew-aligned-name");
|
||||
_window.RoleType.FontColorOverride = proto?.Color ?? Color.White;
|
||||
}
|
||||
|
||||
private void CharacterDetached(EntityUid uid)
|
||||
|
||||
Reference in New Issue
Block a user