Replace VerbTypes with verb classes (#6525)
This commit is contained in:
@@ -39,7 +39,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
SubscribeLocalEvent<DockingComponent, PowerChangedEvent>(OnPowerChange);
|
||||
SubscribeLocalEvent<DockingComponent, AnchorStateChangedEvent>(OnAnchorChange);
|
||||
|
||||
SubscribeLocalEvent<DockingComponent, GetInteractionVerbsEvent>(OnVerb);
|
||||
SubscribeLocalEvent<DockingComponent, GetVerbsEvent<InteractionVerb>>(OnVerb);
|
||||
SubscribeLocalEvent<DockingComponent, BeforeDoorAutoCloseEvent>(OnAutoClose);
|
||||
}
|
||||
|
||||
@@ -50,12 +50,12 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
args.Cancel();
|
||||
}
|
||||
|
||||
private void OnVerb(EntityUid uid, DockingComponent component, GetInteractionVerbsEvent args)
|
||||
private void OnVerb(EntityUid uid, DockingComponent component, GetVerbsEvent<InteractionVerb> args)
|
||||
{
|
||||
if (!args.CanInteract ||
|
||||
!args.CanAccess) return;
|
||||
|
||||
Verb? verb;
|
||||
InteractionVerb? verb;
|
||||
|
||||
// TODO: Have it open the UI and have the UI do this.
|
||||
if (!component.Docked &&
|
||||
@@ -67,7 +67,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
if (component.Enabled)
|
||||
otherDock = GetDockable(body, xform);
|
||||
|
||||
verb = new Verb
|
||||
verb = new InteractionVerb
|
||||
{
|
||||
Disabled = otherDock == null,
|
||||
Text = Loc.GetString("docking-component-dock"),
|
||||
@@ -80,7 +80,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
}
|
||||
else if (component.Docked)
|
||||
{
|
||||
verb = new Verb
|
||||
verb = new InteractionVerb
|
||||
{
|
||||
Disabled = !component.Docked,
|
||||
Text = Loc.GetString("docking-component-undock"),
|
||||
|
||||
@@ -34,13 +34,13 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
SubscribeLocalEvent<ShuttleConsoleComponent, ComponentShutdown>(HandleConsoleShutdown);
|
||||
SubscribeLocalEvent<ShuttleConsoleComponent, ActivateInWorldEvent>(HandleConsoleInteract);
|
||||
SubscribeLocalEvent<ShuttleConsoleComponent, PowerChangedEvent>(HandlePowerChange);
|
||||
SubscribeLocalEvent<ShuttleConsoleComponent, GetInteractionVerbsEvent>(OnConsoleInteract);
|
||||
SubscribeLocalEvent<ShuttleConsoleComponent, GetVerbsEvent<InteractionVerb>>(OnConsoleInteract);
|
||||
|
||||
SubscribeLocalEvent<PilotComponent, ComponentShutdown>(HandlePilotShutdown);
|
||||
SubscribeLocalEvent<PilotComponent, MoveEvent>(HandlePilotMove);
|
||||
}
|
||||
|
||||
private void OnConsoleInteract(EntityUid uid, ShuttleConsoleComponent component, GetInteractionVerbsEvent args)
|
||||
private void OnConsoleInteract(EntityUid uid, ShuttleConsoleComponent component, GetVerbsEvent<InteractionVerb> args)
|
||||
{
|
||||
if (!args.CanAccess ||
|
||||
!args.CanInteract)
|
||||
@@ -52,7 +52,7 @@ namespace Content.Server.Shuttles.EntitySystems
|
||||
if (!_mapManager.TryGetGrid(xform.GridID, out var grid) ||
|
||||
!EntityManager.TryGetComponent(grid.GridEntityId, out ShuttleComponent? shuttle)) return;
|
||||
|
||||
Verb verb = new()
|
||||
InteractionVerb verb = new()
|
||||
{
|
||||
Text = Loc.GetString("shuttle-mode-toggle"),
|
||||
Act = () => ToggleShuttleMode(args.User, component, shuttle),
|
||||
|
||||
Reference in New Issue
Block a user