Fix being able to teleport with the ghost warp menu while alive (#3246)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#nullable enable
|
||||
using Content.Client.GameObjects.Components.Observer;
|
||||
using Robust.Client.Console;
|
||||
using Robust.Client.UserInterface;
|
||||
@@ -16,17 +17,19 @@ namespace Content.Client.UserInterface
|
||||
private readonly Button _ghostRoles = new() {Text = Loc.GetString("Ghost Roles")};
|
||||
private readonly GhostComponent _owner;
|
||||
|
||||
public GhostTargetWindow? TargetWindow { get; private set; }
|
||||
|
||||
public GhostGui(GhostComponent owner)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
_owner = owner;
|
||||
|
||||
var targetMenu = new GhostTargetWindow(owner);
|
||||
TargetWindow = new GhostTargetWindow(owner);
|
||||
|
||||
MouseFilter = MouseFilterMode.Ignore;
|
||||
|
||||
_ghostWarp.OnPressed += args => targetMenu.Populate();
|
||||
_ghostWarp.OnPressed += args => TargetWindow.Populate();
|
||||
_returnToBody.OnPressed += args => owner.SendReturnToBodyMessage();
|
||||
_ghostRoles.OnPressed += _ => IoCManager.Resolve<IClientConsoleHost>().RemoteExecuteCommand(null, "ghostroles");
|
||||
|
||||
@@ -49,7 +52,7 @@ namespace Content.Client.UserInterface
|
||||
}
|
||||
}
|
||||
|
||||
internal class GhostTargetWindow : SS14Window
|
||||
public class GhostTargetWindow : SS14Window
|
||||
{
|
||||
protected override Vector2? CustomSize => (300, 450);
|
||||
private readonly GhostComponent _owner;
|
||||
|
||||
Reference in New Issue
Block a user