Replace VerbTypes with verb classes (#6525)
This commit is contained in:
@@ -32,8 +32,8 @@ namespace Content.Server.Storage.EntitySystems
|
||||
SubscribeLocalEvent<EntRemovedFromContainerMessage>(HandleEntityRemovedFromContainer);
|
||||
SubscribeLocalEvent<EntInsertedIntoContainerMessage>(HandleEntityInsertedIntoContainer);
|
||||
|
||||
SubscribeLocalEvent<EntityStorageComponent, GetInteractionVerbsEvent>(AddToggleOpenVerb);
|
||||
SubscribeLocalEvent<ServerStorageComponent, GetActivationVerbsEvent>(AddOpenUiVerb);
|
||||
SubscribeLocalEvent<EntityStorageComponent, GetVerbsEvent<InteractionVerb>>(AddToggleOpenVerb);
|
||||
SubscribeLocalEvent<ServerStorageComponent, GetVerbsEvent<ActivationVerb>>(AddOpenUiVerb);
|
||||
SubscribeLocalEvent<EntityStorageComponent, RelayMovementEntityEvent>(OnRelayMovement);
|
||||
|
||||
SubscribeLocalEvent<StorageFillComponent, MapInitEvent>(OnStorageFillMapInit);
|
||||
@@ -63,7 +63,7 @@ namespace Content.Server.Storage.EntitySystems
|
||||
}
|
||||
}
|
||||
|
||||
private void AddToggleOpenVerb(EntityUid uid, EntityStorageComponent component, GetInteractionVerbsEvent args)
|
||||
private void AddToggleOpenVerb(EntityUid uid, EntityStorageComponent component, GetVerbsEvent<InteractionVerb> args)
|
||||
{
|
||||
if (!args.CanAccess || !args.CanInteract)
|
||||
return;
|
||||
@@ -71,7 +71,7 @@ namespace Content.Server.Storage.EntitySystems
|
||||
if (!component.CanOpen(args.User, silent: true))
|
||||
return;
|
||||
|
||||
Verb verb = new();
|
||||
InteractionVerb verb = new();
|
||||
if (component.Open)
|
||||
{
|
||||
verb.Text = Loc.GetString("verb-common-close");
|
||||
@@ -86,7 +86,7 @@ namespace Content.Server.Storage.EntitySystems
|
||||
args.Verbs.Add(verb);
|
||||
}
|
||||
|
||||
private void AddOpenUiVerb(EntityUid uid, ServerStorageComponent component, GetActivationVerbsEvent args)
|
||||
private void AddOpenUiVerb(EntityUid uid, ServerStorageComponent component, GetVerbsEvent<ActivationVerb> args)
|
||||
{
|
||||
if (!args.CanAccess || !args.CanInteract)
|
||||
return;
|
||||
@@ -102,7 +102,7 @@ namespace Content.Server.Storage.EntitySystems
|
||||
// Does this player currently have the storage UI open?
|
||||
var uiOpen = component.SubscribedSessions.Contains(session);
|
||||
|
||||
Verb verb = new();
|
||||
ActivationVerb verb = new();
|
||||
verb.Act = () => component.OpenStorageUI(args.User);
|
||||
if (uiOpen)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user