Files
crystall-punk-14/Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml.cs

41 lines
1.1 KiB
C#
Raw Permalink Normal View History

2023-01-17 12:47:52 -06:00
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.Administration.UI.Bwoink
{
/// <summary>
/// This window connects to a BwoinkSystem channel. BwoinkSystem manages the rest.
/// </summary>
[GenerateTypedNameReferences]
public sealed partial class BwoinkWindow : DefaultWindow
{
public BwoinkWindow()
{
RobustXamlLoader.Load(this);
Bwoink.ChannelSelector.OnSelectionChanged += sel =>
{
if (sel is null)
2023-01-17 12:47:52 -06:00
{
Title = Loc.GetString("bwoink-title-none-selected");
return;
}
Title = $"{sel.CharacterName} / {sel.Username}";
if (sel.OverallPlaytime != null)
{
Title += $" | {Loc.GetString("generic-playtime-title")}: {sel.PlaytimeString}";
2023-01-17 12:47:52 -06:00
}
};
OnOpen += () =>
{
Bwoink.ChannelSelector.StopFiltering();
Bwoink.PopulateList();
};
2023-01-17 12:47:52 -06:00
}
}
}