Separate ghost warp message into two (#3310)

* Separate ghost warp message into two

* Remove redundant arguments

* Address reviews

* Move properties up
This commit is contained in:
DrSmugleaf
2021-02-19 19:29:34 +01:00
committed by GitHub
parent 6d666b92e9
commit 5667cffe95
6 changed files with 81 additions and 47 deletions

View File

@@ -17,7 +17,7 @@ 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 GhostTargetWindow? TargetWindow { get; }
public GhostGui(GhostComponent owner)
{
@@ -29,8 +29,8 @@ namespace Content.Client.UserInterface
MouseFilter = MouseFilterMode.Ignore;
_ghostWarp.OnPressed += args => TargetWindow.Populate();
_returnToBody.OnPressed += args => owner.SendReturnToBodyMessage();
_ghostWarp.OnPressed += _ => TargetWindow.Populate();
_returnToBody.OnPressed += _ => owner.SendReturnToBodyMessage();
_ghostRoles.OnPressed += _ => IoCManager.Resolve<IClientConsoleHost>().RemoteExecuteCommand(null, "ghostroles");
AddChild(new HBoxContainer
@@ -114,7 +114,7 @@ namespace Content.Client.UserInterface
ClipText = true,
};
currentButtonRef.OnPressed += (args) =>
currentButtonRef.OnPressed += (_) =>
{
_owner.SendGhostWarpRequestMessage(key);
};
@@ -138,9 +138,9 @@ namespace Content.Client.UserInterface
ClipText = true,
};
currentButtonRef.OnPressed += (args) =>
currentButtonRef.OnPressed += (_) =>
{
_owner.SendGhostWarpRequestMessage(default,name);
_owner.SendGhostWarpRequestMessage(name);
};
_buttonContainer.AddChild(currentButtonRef);