2023-02-19 06:27:56 +13:00
|
|
|
using Content.Client.Stylesheets;
|
2022-10-12 01:16:23 -07:00
|
|
|
using Content.Shared.Chat;
|
|
|
|
|
using Robust.Client.UserInterface.Controls;
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.UserInterface.Systems.Chat.Controls;
|
|
|
|
|
|
|
|
|
|
public sealed class ChannelSelectorItemButton : Button
|
|
|
|
|
{
|
|
|
|
|
public readonly ChatSelectChannel Channel;
|
|
|
|
|
|
|
|
|
|
public bool IsHidden => Parent == null;
|
|
|
|
|
|
|
|
|
|
public ChannelSelectorItemButton(ChatSelectChannel selector)
|
|
|
|
|
{
|
|
|
|
|
Channel = selector;
|
|
|
|
|
AddStyleClass(StyleNano.StyleClassChatChannelSelectorButton);
|
2023-02-19 06:27:56 +13:00
|
|
|
|
|
|
|
|
Text = ChannelSelectorButton.ChannelSelectorName(selector);
|
|
|
|
|
|
2022-11-15 17:14:40 +13:00
|
|
|
var prefix = ChatUIController.ChannelPrefixes[selector];
|
2023-02-19 06:27:56 +13:00
|
|
|
|
|
|
|
|
if (prefix != default)
|
|
|
|
|
Text = Loc.GetString("hud-chatbox-select-name-prefixed", ("name", Text), ("prefix", prefix));
|
2022-10-12 01:16:23 -07:00
|
|
|
}
|
|
|
|
|
}
|