diff --git a/Content.Client/UserInterface/AdminMenu/AdminMenuWindow.cs b/Content.Client/UserInterface/AdminMenu/AdminMenuWindow.cs index 0025f0df6b..f45ac25c88 100644 --- a/Content.Client/UserInterface/AdminMenu/AdminMenuWindow.cs +++ b/Content.Client/UserInterface/AdminMenu/AdminMenuWindow.cs @@ -37,7 +37,7 @@ namespace Content.Client.UserInterface.AdminMenu { new KickCommandButton(), new DirectCommandButton("Admin Ghost", "aghost"), - //TODO: teleport + new TeleportCommandButton(), }; private readonly List _adminbusButtons = new List { @@ -534,6 +534,30 @@ namespace Content.Client.UserInterface.AdminMenu } } + private class TeleportCommandButton : UICommandButton + { + public override string Name => "Teleport"; + public override string RequiredCommand => "tpto"; + + private readonly CommandUIDropDown _playerDropDown = new CommandUIDropDown + { + Name = "Player", + GetData = () => IoCManager.Resolve().Sessions.ToList(), + GetDisplayName = (obj) => $"{((IPlayerSession) obj).Name} ({((IPlayerSession) obj).AttachedEntity?.Name})", + GetValueFromData = (obj) => ((IPlayerSession) obj).Name, + }; + + public override List UI => new List + { + _playerDropDown + }; + + public override void Submit() + { + IoCManager.Resolve().ProcessCommand($"tpto \"{_playerDropDown.GetValue()}\""); + } + } + private class AddAtmosCommandButton : UICommandButton { public override string Name => "Add Atmos"; diff --git a/Resources/Groups/groups.yml b/Resources/Groups/groups.yml index 9ca4970747..dbcc86b674 100644 --- a/Resources/Groups/groups.yml +++ b/Resources/Groups/groups.yml @@ -60,6 +60,7 @@ - spawn - delete - tp + - tpto - tpgrid - setgamepreset - forcepreset @@ -142,6 +143,7 @@ - spawn - delete - tp + - tpto - tpgrid - setgamepreset - forcepreset