Delta-v/Content.Client/_DV/Curation/UI/Cwoink/CwoinkWindow.xaml.cs

39 lines
1.1 KiB
C#

using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client._DV.Curation.UI.Cwoink;
/// <summary>
/// This window connects to a CwoinkSystem channel. CwoinkSystem manages the rest.
/// </summary>
[GenerateTypedNameReferences]
public sealed partial class CwoinkWindow : DefaultWindow
{
public CwoinkWindow()
{
RobustXamlLoader.Load(this);
Cwoink.ChannelSelector.OnSelectionChanged += sel =>
{
if (sel is null)
{
Title = Loc.GetString("cwoink-title-none-selected");
return;
}
Title = $"{sel.CharacterName} / {sel.Username} | {Loc.GetString("generic-playtime-title")}: "
+ (sel.OverallPlaytime != null
? sel.PlaytimeString
: Loc.GetString("generic-unknown-title"));
OnOpen += () =>
{
Cwoink.ChannelSelector.StopFiltering();
Cwoink.PopulateList();
};
};
}
}