mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* Initial commit * RMC? I 'ardly know 'er * Sprout * Rework it to use job icons * Revert the one change * Always the one yaml * Easy review changes * We do a little salami * Review changes * NIGHTMARE NIGHTMARE NIGHTMARE * Update to use StatusIconPrototype only * Remove async * Aaaand remove the comment, bah * Review fixes * Update master * Add the ability for ghosts to see * Byte backing * Review fix + comment * Update to 90 min * Add todo message
29 lines
936 B
C#
29 lines
936 B
C#
using Content.Shared.CCVar;
|
|
using Content.Shared.NewPlayer;
|
|
using Content.Shared.StatusIcon.Components;
|
|
using Robust.Shared.Configuration;
|
|
|
|
namespace Content.Client.NewPlayer;
|
|
|
|
/// <summary>
|
|
/// Used to visualize <see cref="NewPlayerIconComponent"/> status icons, if enabled on the server.
|
|
/// </summary>
|
|
public sealed partial class NewPlayerSystem : EntitySystem
|
|
{
|
|
[Dependency] private IConfigurationManager _configManager = default!;
|
|
|
|
private bool _showPlayerIcons;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
Subs.CVar(_configManager, CCVars.ShowNewPlayerIcons, v => _showPlayerIcons = v, true);
|
|
}
|
|
|
|
[SubscribeLocalEvent]
|
|
private void GetNewPlayerIcon(Entity<NewPlayerIconComponent> ent, ref GetStatusIconsEvent args)
|
|
{
|
|
if (_showPlayerIcons && ProtoMan.Resolve(ent.Comp.StatusIcon, out var iconPrototype))
|
|
args.StatusIcons.Add(iconPrototype);
|
|
}
|
|
}
|