Add trigger-refactor components and systems: Batch 1 (#39391)

* Adds the following batch of trigger refactor components and their associated systems:

TriggerOnLand: LandEvent
TriggerOnExamined: ExaminedEvent
TriggerOnUnbuckle: UnbuckledEvent
TriggerOnBuckle: BuckledEvent
TriggerOnStrap: StrappedEvent
TriggerOnUnstrapped: UnstrappedEvent

* Removes unnecessary lines from comment

* Fix comment formatting, corrects grammar and increases comment clarity.

* adds last forgotten edit to comments

* Update Content.Shared/Trigger/Systems/TriggerOnStrappedOrBuckledSystem.cs

Removes unnecessary comments

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Shared/Trigger/Components/Triggers/TriggerOnBuckledComponent.cs

Increases comment clarity

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Shared/Trigger/Components/Triggers/TriggerOnExaminedComponent.cs

Increases comment clarity

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Shared/Trigger/Components/Triggers/TriggerOnLandComponent.cs

Increases comment clarity

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Shared/Trigger/Components/Triggers/TriggerOnStrappedComponent.cs

Increases comment clarity

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Shared/Trigger/Components/Triggers/TriggerOnUnbuckledComponent.cs

Increases comment clarity

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Shared/Trigger/Components/Triggers/TriggerOnUnstrappedComponent.cs

Increases comment clarity

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* refactored TriggerOnStrappedOrBuckledSystem.cs
removed TriggerOnExaminedSystem.cs and moved it into TriggerSystem.Interaction.cs

Changes currently untested, not sure how to make it so modders can change what method they want sending out the appropriate trigger key but want to save progress working on it and get feedback from maintainers

* Removed component which already exists as part of TriggerSystem.Interaction.cs

* Restores accidentally removed component

* Apply suggestions from code review

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
Studio Fae-Wilds
2025-08-14 17:39:54 +10:00
committed by GitHub
parent 0872c4d7e1
commit 770dc68a48
9 changed files with 143 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
using Content.Shared.Throwing;
using Content.Shared.Trigger.Components.Triggers;
namespace Content.Shared.Trigger.Systems;
public sealed partial class TriggerOnLandSystem : EntitySystem
{
[Dependency] private readonly TriggerSystem _trigger = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<TriggerOnLandComponent, LandEvent>(OnLand);
}
private void OnLand(Entity<TriggerOnLandComponent> ent, ref LandEvent args)
{
_trigger.Trigger(ent.Owner, args.User, ent.Comp.KeyOut);
}
}