Replace VerbTypes with verb classes (#6525)
This commit is contained in:
@@ -19,7 +19,7 @@ public sealed partial class GunSystem
|
||||
{
|
||||
// Probably needs combining with magazines in future given the common functionality.
|
||||
|
||||
private void OnAmmoBoxAltVerbs(EntityUid uid, AmmoBoxComponent component, GetAlternativeVerbsEvent args)
|
||||
private void OnAmmoBoxAltVerbs(EntityUid uid, AmmoBoxComponent component, GetVerbsEvent<AlternativeVerb> args)
|
||||
{
|
||||
if (args.Hands == null || !args.CanAccess || !args.CanInteract)
|
||||
return;
|
||||
@@ -27,7 +27,7 @@ public sealed partial class GunSystem
|
||||
if (component.AmmoLeft == 0)
|
||||
return;
|
||||
|
||||
Verb verb = new()
|
||||
AlternativeVerb verb = new()
|
||||
{
|
||||
Text = Loc.GetString("dump-vert-get-data-text"),
|
||||
IconTexture = "/Textures/Interface/VerbIcons/eject.svg.192dpi.png",
|
||||
|
||||
@@ -17,14 +17,14 @@ namespace Content.Server.Weapon.Ranged;
|
||||
|
||||
public sealed partial class GunSystem
|
||||
{
|
||||
private void AddToggleBoltVerb(EntityUid uid, BoltActionBarrelComponent component, GetInteractionVerbsEvent args)
|
||||
private void AddToggleBoltVerb(EntityUid uid, BoltActionBarrelComponent component, GetVerbsEvent<InteractionVerb> args)
|
||||
{
|
||||
if (args.Hands == null ||
|
||||
!args.CanAccess ||
|
||||
!args.CanInteract)
|
||||
return;
|
||||
|
||||
Verb verb = new()
|
||||
InteractionVerb verb = new()
|
||||
{
|
||||
Text = component.BoltOpen
|
||||
? Loc.GetString("close-bolt-verb-get-data-text")
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Content.Server.Weapon.Ranged;
|
||||
|
||||
public sealed partial class GunSystem
|
||||
{
|
||||
private void AddEjectMagazineVerb(EntityUid uid, MagazineBarrelComponent component, GetAlternativeVerbsEvent args)
|
||||
private void AddEjectMagazineVerb(EntityUid uid, MagazineBarrelComponent component, GetVerbsEvent<AlternativeVerb> args)
|
||||
{
|
||||
if (args.Hands == null ||
|
||||
!args.CanAccess ||
|
||||
@@ -34,7 +34,7 @@ public sealed partial class GunSystem
|
||||
if (component.MagNeedsOpenBolt && !component.BoltOpen)
|
||||
return;
|
||||
|
||||
Verb verb = new()
|
||||
AlternativeVerb verb = new()
|
||||
{
|
||||
Text = MetaData(component.MagazineContainer.ContainedEntity!.Value).EntityName,
|
||||
Category = VerbCategory.Eject,
|
||||
@@ -43,7 +43,7 @@ public sealed partial class GunSystem
|
||||
args.Verbs.Add(verb);
|
||||
}
|
||||
|
||||
private void AddMagazineInteractionVerbs(EntityUid uid, MagazineBarrelComponent component, GetInteractionVerbsEvent args)
|
||||
private void AddMagazineInteractionVerbs(EntityUid uid, MagazineBarrelComponent component, GetVerbsEvent<InteractionVerb> args)
|
||||
{
|
||||
if (args.Hands == null ||
|
||||
!args.CanAccess ||
|
||||
@@ -51,7 +51,7 @@ public sealed partial class GunSystem
|
||||
return;
|
||||
|
||||
// Toggle bolt verb
|
||||
Verb toggleBolt = new()
|
||||
InteractionVerb toggleBolt = new()
|
||||
{
|
||||
Text = component.BoltOpen
|
||||
? Loc.GetString("close-bolt-verb-get-data-text")
|
||||
@@ -67,7 +67,7 @@ public sealed partial class GunSystem
|
||||
return;
|
||||
|
||||
// Insert mag verb
|
||||
Verb insert = new()
|
||||
InteractionVerb insert = new()
|
||||
{
|
||||
Text = MetaData(@using).EntityName,
|
||||
Category = VerbCategory.Insert,
|
||||
|
||||
@@ -175,7 +175,7 @@ public sealed partial class GunSystem
|
||||
appearance.SetData(AmmoVisuals.AmmoMax, component.Capacity);
|
||||
}
|
||||
|
||||
private void AddSpinVerb(EntityUid uid, RevolverBarrelComponent component, GetAlternativeVerbsEvent args)
|
||||
private void AddSpinVerb(EntityUid uid, RevolverBarrelComponent component, GetVerbsEvent<AlternativeVerb> args)
|
||||
{
|
||||
if (args.Hands == null || !args.CanAccess || !args.CanInteract)
|
||||
return;
|
||||
@@ -183,7 +183,7 @@ public sealed partial class GunSystem
|
||||
if (component.Capacity <= 1 || component.ShotsLeft == 0)
|
||||
return;
|
||||
|
||||
Verb verb = new()
|
||||
AlternativeVerb verb = new()
|
||||
{
|
||||
Text = Loc.GetString("spin-revolver-verb-get-data-text"),
|
||||
IconTexture = "/Textures/Interface/VerbIcons/refresh.svg.192dpi.png",
|
||||
|
||||
@@ -70,7 +70,7 @@ public sealed partial class GunSystem : EntitySystem
|
||||
SubscribeLocalEvent<AmmoBoxComponent, InteractUsingEvent>(OnAmmoBoxInteractUsing);
|
||||
SubscribeLocalEvent<AmmoBoxComponent, UseInHandEvent>(OnAmmoBoxUse);
|
||||
SubscribeLocalEvent<AmmoBoxComponent, InteractHandEvent>(OnAmmoBoxInteractHand);
|
||||
SubscribeLocalEvent<AmmoBoxComponent, GetAlternativeVerbsEvent>(OnAmmoBoxAltVerbs);
|
||||
SubscribeLocalEvent<AmmoBoxComponent, GetVerbsEvent<AlternativeVerb>>(OnAmmoBoxAltVerbs);
|
||||
|
||||
SubscribeLocalEvent<RangedMagazineComponent, ComponentInit>(OnRangedMagInit);
|
||||
SubscribeLocalEvent<RangedMagazineComponent, MapInitEvent>(OnRangedMagMapInit);
|
||||
@@ -96,7 +96,7 @@ public sealed partial class GunSystem : EntitySystem
|
||||
SubscribeLocalEvent<BoltActionBarrelComponent, InteractUsingEvent>(OnBoltInteractUsing);
|
||||
SubscribeLocalEvent<BoltActionBarrelComponent, ComponentGetState>(OnBoltGetState);
|
||||
SubscribeLocalEvent<BoltActionBarrelComponent, ExaminedEvent>(OnBoltExamine);
|
||||
SubscribeLocalEvent<BoltActionBarrelComponent, GetInteractionVerbsEvent>(AddToggleBoltVerb);
|
||||
SubscribeLocalEvent<BoltActionBarrelComponent, GetVerbsEvent<InteractionVerb>>(AddToggleBoltVerb);
|
||||
|
||||
SubscribeLocalEvent<MagazineBarrelComponent, ComponentInit>(OnMagazineInit);
|
||||
SubscribeLocalEvent<MagazineBarrelComponent, MapInitEvent>(OnMagazineMapInit);
|
||||
@@ -104,8 +104,8 @@ public sealed partial class GunSystem : EntitySystem
|
||||
SubscribeLocalEvent<MagazineBarrelComponent, UseInHandEvent>(OnMagazineUse);
|
||||
SubscribeLocalEvent<MagazineBarrelComponent, InteractUsingEvent>(OnMagazineInteractUsing);
|
||||
SubscribeLocalEvent<MagazineBarrelComponent, ComponentGetState>(OnMagazineGetState);
|
||||
SubscribeLocalEvent<MagazineBarrelComponent, GetInteractionVerbsEvent>(AddMagazineInteractionVerbs);
|
||||
SubscribeLocalEvent<MagazineBarrelComponent, GetAlternativeVerbsEvent>(AddEjectMagazineVerb);
|
||||
SubscribeLocalEvent<MagazineBarrelComponent, GetVerbsEvent<InteractionVerb>>(AddMagazineInteractionVerbs);
|
||||
SubscribeLocalEvent<MagazineBarrelComponent, GetVerbsEvent<AlternativeVerb>>(AddEjectMagazineVerb);
|
||||
|
||||
SubscribeLocalEvent<PumpBarrelComponent, ComponentGetState>(OnPumpGetState);
|
||||
SubscribeLocalEvent<PumpBarrelComponent, ComponentInit>(OnPumpInit);
|
||||
@@ -118,7 +118,7 @@ public sealed partial class GunSystem : EntitySystem
|
||||
SubscribeLocalEvent<RevolverBarrelComponent, UseInHandEvent>(OnRevolverUse);
|
||||
SubscribeLocalEvent<RevolverBarrelComponent, InteractUsingEvent>(OnRevolverInteractUsing);
|
||||
SubscribeLocalEvent<RevolverBarrelComponent, ComponentGetState>(OnRevolverGetState);
|
||||
SubscribeLocalEvent<RevolverBarrelComponent, GetAlternativeVerbsEvent>(AddSpinVerb);
|
||||
SubscribeLocalEvent<RevolverBarrelComponent, GetVerbsEvent<AlternativeVerb>>(AddSpinVerb);
|
||||
|
||||
SubscribeLocalEvent<SpeedLoaderComponent, ComponentInit>(OnSpeedLoaderInit);
|
||||
SubscribeLocalEvent<SpeedLoaderComponent, MapInitEvent>(OnSpeedLoaderMapInit);
|
||||
|
||||
Reference in New Issue
Block a user