AutoCompState + ItemToggle fixes (#23422)
* AutoCompState + ItemToggle fixes Fix a lot of the comp states that are never actually networked and also cleaned up ItemToggle events a bunch. ItemToggle will still need some future work for lights and sounds. * Also catch these
This commit is contained in:
@@ -5,6 +5,7 @@ using Content.Shared.Eye.Blinding.Components;
|
||||
using Content.Shared.Eye.Blinding.Systems;
|
||||
using Content.Shared.Tools.Components;
|
||||
using Content.Shared.Item.ItemToggle;
|
||||
using Content.Shared.Item.ItemToggle.Components;
|
||||
|
||||
namespace Content.Server.Eye.Blinding.EyeProtection
|
||||
{
|
||||
@@ -18,7 +19,7 @@ namespace Content.Server.Eye.Blinding.EyeProtection
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<RequiresEyeProtectionComponent, ToolUseAttemptEvent>(OnUseAttempt);
|
||||
SubscribeLocalEvent<RequiresEyeProtectionComponent, ItemToggleDoneEvent>(OnWelderToggled);
|
||||
SubscribeLocalEvent<RequiresEyeProtectionComponent, ItemToggledEvent>(OnWelderToggled);
|
||||
|
||||
SubscribeLocalEvent<EyeProtectionComponent, GetEyeProtectionEvent>(OnGetProtection);
|
||||
SubscribeLocalEvent<EyeProtectionComponent, InventoryRelayedEvent<GetEyeProtectionEvent>>(OnGetRelayedProtection);
|
||||
@@ -57,7 +58,7 @@ namespace Content.Server.Eye.Blinding.EyeProtection
|
||||
_statusEffectsSystem.TryAddStatusEffect(args.User, TemporaryBlindnessSystem.BlindingStatusEffect,
|
||||
statusTimeSpan, false, TemporaryBlindnessSystem.BlindingStatusEffect);
|
||||
}
|
||||
private void OnWelderToggled(EntityUid uid, RequiresEyeProtectionComponent component, ItemToggleDoneEvent args)
|
||||
private void OnWelderToggled(EntityUid uid, RequiresEyeProtectionComponent component, ItemToggledEvent args)
|
||||
{
|
||||
component.Toggled = _itemToggle.IsActivated(uid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user