36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using Content.Shared.CCVar;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Client.UserInterface.Controls;
|
|
using Robust.Client.UserInterface.XAML;
|
|
using Robust.Shared.Configuration;
|
|
|
|
namespace Content.Client._White.JoinQueue;
|
|
|
|
[GenerateTypedNameReferences]
|
|
public sealed partial class QueueGui : Control
|
|
{
|
|
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
|
|
|
public event Action? QuitPressed;
|
|
|
|
public QueueGui()
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
LayoutContainer.SetAnchorPreset(this, LayoutContainer.LayoutPreset.Wide);
|
|
|
|
QuitButton.OnPressed += (_) => QuitPressed?.Invoke();
|
|
PriorityJoinButton.OnPressed += (_) =>
|
|
{
|
|
var linkPatreon = _cfg.GetCVar(CCVars.InfoLinksPatreon);
|
|
IoCManager.Resolve<IUriOpener>().OpenUri(linkPatreon);
|
|
};
|
|
}
|
|
|
|
public void UpdateInfo(int total, int position)
|
|
{
|
|
QueueTotal.Text = total.ToString();
|
|
QueuePosition.Text = position.ToString();
|
|
}
|
|
}
|