Files
tbd-station-14/Content.Shared/Wieldable/Events.cs
deltanedas 0aebc76feb wielding refactor/fixes (#32188)
* refactor wieldable events

* fix inconsitency with wielding and use updated events

* wieldable cosmetic refactoring

* Update Content.Shared/Wieldable/Events.cs

Co-authored-by: Centronias <charlie.t.santos@gmail.com>

* real

Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
Co-authored-by: Centronias <charlie.t.santos@gmail.com>
Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>
2025-01-05 20:06:10 +01:00

44 lines
1.2 KiB
C#

namespace Content.Shared.Wieldable;
/// <summary>
/// Raised directed on an item when it is wielded.
/// </summary>
[ByRefEvent]
public readonly record struct ItemWieldedEvent(EntityUid User);
/// <summary>
/// Raised directed on an item that has been unwielded.
/// Force is whether the item is being forced to be unwielded, or if the player chose to unwield it themselves.
/// </summary>
[ByRefEvent]
public readonly record struct ItemUnwieldedEvent(EntityUid User, bool Force);
/// <summary>
/// Raised directed on an item before a user tries to wield it.
/// If this event is cancelled wielding will not happen.
/// </summary>
[ByRefEvent]
public record struct WieldAttemptEvent(EntityUid User, bool Cancelled = false)
{
public void Cancel()
{
Cancelled = true;
}
}
/// <summary>
/// Raised directed on an item before a user tries to stop wielding it willingly.
/// If this event is cancelled unwielding will not happen.
/// </summary>
/// <remarks>
/// This event is not raised if the user is forced to unwield the item.
/// </remarks>
[ByRefEvent]
public record struct UnwieldAttemptEvent(EntityUid User, bool Cancelled = false)
{
public void Cancel()
{
Cancelled = true;
}
}