1
0

BwoinkWindow.xaml.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using Robust.Client.AutoGenerated;
  2. using Robust.Client.UserInterface.CustomControls;
  3. using Robust.Client.UserInterface.XAML;
  4. namespace Content.Client.Administration.UI.Bwoink
  5. {
  6. /// <summary>
  7. /// This window connects to a BwoinkSystem channel. BwoinkSystem manages the rest.
  8. /// </summary>
  9. [GenerateTypedNameReferences]
  10. public sealed partial class BwoinkWindow : DefaultWindow
  11. {
  12. public BwoinkWindow()
  13. {
  14. RobustXamlLoader.Load(this);
  15. Bwoink.ChannelSelector.OnSelectionChanged += sel =>
  16. {
  17. if (sel is null)
  18. {
  19. Title = Loc.GetString("bwoink-title-none-selected");
  20. return;
  21. }
  22. Title = $"{sel.CharacterName} / {sel.Username} | {Loc.GetString("generic-playtime-title")}: ";
  23. Title += sel.OverallPlaytime != null ? sel.PlaytimeString : Loc.GetString("generic-unknown-title");
  24. };
  25. OnOpen += () =>
  26. {
  27. Bwoink.ChannelSelector.StopFiltering();
  28. Bwoink.PopulateList();
  29. };
  30. }
  31. }
  32. }