Files
tbd-station-14/Content.Client/UserInterface/AdminMenu/AdminMenuWindow.xaml.cs

59 lines
1.9 KiB
C#

#nullable enable
using System.Collections.Generic;
using Content.Client.UserInterface.AdminMenu.Tabs;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
namespace Content.Client.UserInterface.AdminMenu
{
[GenerateTypedNameReferences]
public partial class AdminMenuWindow : SS14Window
{
[Dependency] private readonly IGameHud? _gameHud = default!;
public event PlayerTab.PlayerListRefresh? OnPlayerListRefresh
{
add => PlayerTabControl.OnPlayerListRefresh += value;
remove => PlayerTabControl.OnPlayerListRefresh -= value;
}
protected override Vector2? CustomSize => (500, 250);
public AdminMenuWindow()
{
Title = Loc.GetString("Admin Menu");
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
MasterTabContainer.SetTabTitle(0, Loc.GetString("Admin"));
MasterTabContainer.SetTabTitle(1, Loc.GetString("Adminbus"));
MasterTabContainer.SetTabTitle(2, Loc.GetString("Atmos"));
MasterTabContainer.SetTabTitle(3, Loc.GetString("Round"));
MasterTabContainer.SetTabTitle(4, Loc.GetString("Server"));
MasterTabContainer.SetTabTitle(5, Loc.GetString("Players"));
}
protected override void EnteredTree()
{
base.EnteredTree();
if (_gameHud != null)
_gameHud.AdminButtonDown = true;
}
protected override void ExitedTree()
{
base.ExitedTree();
if (_gameHud != null)
_gameHud.AdminButtonDown = false;
}
public void RefreshPlayerList(Dictionary<string, string> namesToPlayers)
{
PlayerTabControl.RefreshPlayerList(namesToPlayers);
}
}
}