forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wielding refactor/fixes (space-wizards#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 <[email protected]> * real Co-authored-by: ScarKy0 <[email protected]> --------- Co-authored-by: deltanedas <@deltanedas:kde.org> Co-authored-by: Centronias <[email protected]> Co-authored-by: ScarKy0 <[email protected]>
- Loading branch information
1 parent
0639a49
commit 0aebc76
Showing
7 changed files
with
109 additions
and
111 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
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; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters