Update radio prefix parsing (#13777)

This commit is contained in:
Leon Friedrich
2023-02-19 06:27:56 +13:00
committed by GitHub
parent 63a0c76ecc
commit 75a559fa55
32 changed files with 659 additions and 606 deletions

View File

@@ -1,4 +1,4 @@
using Content.Shared.Chat;
using Content.Shared.Chat;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Input;
@@ -64,12 +64,10 @@ public sealed class ChannelSelectorButton : Button
if (SelectedChannel == channel) return;
SelectedChannel = channel;
UpdateChannelSelectButton(channel);
OnChannelSelect?.Invoke(channel);
}
public string ChannelSelectorName(ChatSelectChannel channel)
public static string ChannelSelectorName(ChatSelectChannel channel)
{
return Loc.GetString($"hud-chatbox-select-channel-{channel}");
}
@@ -87,10 +85,10 @@ public sealed class ChannelSelectorButton : Button
};
}
public void UpdateChannelSelectButton(ChatSelectChannel channel)
public void UpdateChannelSelectButton(ChatSelectChannel channel, Shared.Radio.RadioChannelPrototype? radio)
{
Text = ChannelSelectorName(channel);
Modulate = ChannelSelectColor(channel);
Text = radio != null ? Loc.GetString(radio.Name) : ChannelSelectorName(channel);
Modulate = radio?.Color ?? ChannelSelectColor(channel);
}
private void OnSelectorButtonToggled(ButtonToggledEventArgs args)