Add admin teleport button (#2435)
Co-authored-by: zionnBE <zionn@tfwno.gf>
This commit is contained in:
@@ -37,7 +37,7 @@ namespace Content.Client.UserInterface.AdminMenu
|
|||||||
{
|
{
|
||||||
new KickCommandButton(),
|
new KickCommandButton(),
|
||||||
new DirectCommandButton("Admin Ghost", "aghost"),
|
new DirectCommandButton("Admin Ghost", "aghost"),
|
||||||
//TODO: teleport
|
new TeleportCommandButton(),
|
||||||
};
|
};
|
||||||
private readonly List<CommandButton> _adminbusButtons = new List<CommandButton>
|
private readonly List<CommandButton> _adminbusButtons = new List<CommandButton>
|
||||||
{
|
{
|
||||||
@@ -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<IPlayerManager>().Sessions.ToList<object>(),
|
||||||
|
GetDisplayName = (obj) => $"{((IPlayerSession) obj).Name} ({((IPlayerSession) obj).AttachedEntity?.Name})",
|
||||||
|
GetValueFromData = (obj) => ((IPlayerSession) obj).Name,
|
||||||
|
};
|
||||||
|
|
||||||
|
public override List<CommandUIControl> UI => new List<CommandUIControl>
|
||||||
|
{
|
||||||
|
_playerDropDown
|
||||||
|
};
|
||||||
|
|
||||||
|
public override void Submit()
|
||||||
|
{
|
||||||
|
IoCManager.Resolve<IClientConsole>().ProcessCommand($"tpto \"{_playerDropDown.GetValue()}\"");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private class AddAtmosCommandButton : UICommandButton
|
private class AddAtmosCommandButton : UICommandButton
|
||||||
{
|
{
|
||||||
public override string Name => "Add Atmos";
|
public override string Name => "Add Atmos";
|
||||||
|
|||||||
@@ -60,6 +60,7 @@
|
|||||||
- spawn
|
- spawn
|
||||||
- delete
|
- delete
|
||||||
- tp
|
- tp
|
||||||
|
- tpto
|
||||||
- tpgrid
|
- tpgrid
|
||||||
- setgamepreset
|
- setgamepreset
|
||||||
- forcepreset
|
- forcepreset
|
||||||
@@ -142,6 +143,7 @@
|
|||||||
- spawn
|
- spawn
|
||||||
- delete
|
- delete
|
||||||
- tp
|
- tp
|
||||||
|
- tpto
|
||||||
- tpgrid
|
- tpgrid
|
||||||
- setgamepreset
|
- setgamepreset
|
||||||
- forcepreset
|
- forcepreset
|
||||||
|
|||||||
Reference in New Issue
Block a user