fish-station/Content.Client/_Sunrise/ChatIcons/RadioIconsSystem.cs
ThereDrD e194bc1fe3
Иконки в чате (#1168)
* init

* refactor: move scale to tag argument

* fix: chatbox rebuild fix

* tweak: add icons for non-humanoid roles like ai and borgs

* add: switch option for radio icons

* blyat commit

* fix
2025-01-22 00:57:20 +03:00

31 lines
870 B
C#

using Content.Client.UserInterface.Systems.Chat;
using Content.Shared._Sunrise.SunriseCCVars;
using Robust.Client.UserInterface;
using Robust.Shared.Configuration;
namespace Content.Client._Sunrise.ChatIcons;
public sealed class ChatIconsSystem : EntitySystem
{
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IUserInterfaceManager _uiMan = default!;
public override void Initialize()
{
base.Initialize();
_cfg.OnValueChanged(SunriseCCVars.ChatIconsEnable, OnRadioIconsChanged, true);
}
public override void Shutdown()
{
base.Shutdown();
_cfg.UnsubValueChanged(SunriseCCVars.ChatIconsEnable, OnRadioIconsChanged);
}
private void OnRadioIconsChanged(bool enable)
{
_uiMan.GetUIController<ChatUIController>().Repopulate();
}
}