From 44db676b24c8781e3290d499c7233125d7789cf6 Mon Sep 17 00:00:00 2001 From: Saphire Date: Wed, 20 Nov 2024 09:32:50 +0600 Subject: [PATCH] Actually make the emagging popup work properly --- .../Singularity/Systems/EventHorizonSystem.cs | 2 +- .../Systems/SingularityGeneratorSystem.cs | 12 ++++++++++++ .../Singularity/Systems/SingularitySystem.cs | 2 +- Content.Shared/Emag/Systems/EmagSystem.cs | 7 +++++++ .../Components/SingularityGeneratorComponent.cs | 3 ++- .../SharedSingularityGeneratorSystem.cs | 1 - 6 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 Content.Client/Singularity/Systems/SingularityGeneratorSystem.cs diff --git a/Content.Client/Singularity/Systems/EventHorizonSystem.cs b/Content.Client/Singularity/Systems/EventHorizonSystem.cs index 3dd63a0c9c..606116fced 100644 --- a/Content.Client/Singularity/Systems/EventHorizonSystem.cs +++ b/Content.Client/Singularity/Systems/EventHorizonSystem.cs @@ -1,7 +1,7 @@ using Content.Shared.Singularity.EntitySystems; using Content.Shared.Singularity.Components; -namespace Content.Client.Singularity.EntitySystems; +namespace Content.Client.Singularity.Systems; /// /// The client-side version of . diff --git a/Content.Client/Singularity/Systems/SingularityGeneratorSystem.cs b/Content.Client/Singularity/Systems/SingularityGeneratorSystem.cs new file mode 100644 index 0000000000..f5b85f8b3c --- /dev/null +++ b/Content.Client/Singularity/Systems/SingularityGeneratorSystem.cs @@ -0,0 +1,12 @@ +using Content.Shared.Singularity.EntitySystems; +using Content.Shared.Singularity.Components; + +namespace Content.Client.Singularity.Systems; + +/// +/// The client-side version of . +/// Manages s. +/// Exists to make relevant signal handlers (ie: ) work on the client. +/// +public sealed class SingularityGeneratorSystem : SharedSingularityGeneratorSystem +{} diff --git a/Content.Client/Singularity/Systems/SingularitySystem.cs b/Content.Client/Singularity/Systems/SingularitySystem.cs index 5293ad499d..50a12466be 100644 --- a/Content.Client/Singularity/Systems/SingularitySystem.cs +++ b/Content.Client/Singularity/Systems/SingularitySystem.cs @@ -5,7 +5,7 @@ using Robust.Client.GameObjects; using Robust.Shared.GameStates; using Robust.Shared.Utility; -namespace Content.Client.Singularity.EntitySystems; +namespace Content.Client.Singularity.Systems; /// /// The client-side version of . diff --git a/Content.Shared/Emag/Systems/EmagSystem.cs b/Content.Shared/Emag/Systems/EmagSystem.cs index 4d3bbcbb8e..3a556b4706 100644 --- a/Content.Shared/Emag/Systems/EmagSystem.cs +++ b/Content.Shared/Emag/Systems/EmagSystem.cs @@ -96,6 +96,13 @@ public sealed class EmagSystem : EntitySystem } } +/// +/// Shows a popup to emag user (client side only!) and adds to the entity when handled +/// +/// Emag user +/// Did the emagging succeed? Causes a user-only popup to show on client side +/// Can the entity be emagged more than once? Prevents adding of +/// Needs to be handled in shared/client, not just the server, to actually show the emagging popup [ByRefEvent] public record struct GotEmaggedEvent(EntityUid UserUid, bool Handled = false, bool Repeatable = false); diff --git a/Content.Shared/Singularity/Components/SingularityGeneratorComponent.cs b/Content.Shared/Singularity/Components/SingularityGeneratorComponent.cs index 3643ed31a6..715584b5bc 100644 --- a/Content.Shared/Singularity/Components/SingularityGeneratorComponent.cs +++ b/Content.Shared/Singularity/Components/SingularityGeneratorComponent.cs @@ -3,10 +3,11 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy using Content.Shared.Physics; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; +using Robust.Shared.GameStates; namespace Content.Shared.Singularity.Components; -[RegisterComponent, AutoGenerateComponentPause, AutoGenerateComponentState] +[RegisterComponent, AutoGenerateComponentPause, NetworkedComponent, AutoGenerateComponentState] public sealed partial class SingularityGeneratorComponent : Component { /// diff --git a/Content.Shared/Singularity/EntitySystems/SharedSingularityGeneratorSystem.cs b/Content.Shared/Singularity/EntitySystems/SharedSingularityGeneratorSystem.cs index 8830cb0624..ee6dc89bb8 100644 --- a/Content.Shared/Singularity/EntitySystems/SharedSingularityGeneratorSystem.cs +++ b/Content.Shared/Singularity/EntitySystems/SharedSingularityGeneratorSystem.cs @@ -22,7 +22,6 @@ public abstract class SharedSingularityGeneratorSystem : EntitySystem private void OnEmagged(EntityUid uid, SingularityGeneratorComponent component, ref GotEmaggedEvent args) { - PopupSystem.PopupEntity(Loc.GetString("comp-generator-failsafe-disabled", ("target", uid)), uid); component.FailsafeDisabled = true; args.Handled = true; }