* 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
31 lines
870 B
C#
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();
|
|
}
|
|
}
|