]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Actually make the emagging popup work properly
authorSaphire <lattice@saphi.re>
Wed, 20 Nov 2024 03:32:50 +0000 (09:32 +0600)
committerSaphire <lattice@saphi.re>
Wed, 20 Nov 2024 03:32:50 +0000 (09:32 +0600)
Content.Client/Singularity/Systems/EventHorizonSystem.cs
Content.Client/Singularity/Systems/SingularityGeneratorSystem.cs [new file with mode: 0644]
Content.Client/Singularity/Systems/SingularitySystem.cs
Content.Shared/Emag/Systems/EmagSystem.cs
Content.Shared/Singularity/Components/SingularityGeneratorComponent.cs
Content.Shared/Singularity/EntitySystems/SharedSingularityGeneratorSystem.cs

index 3dd63a0c9c889eacfa131634a94da60fc0a8b3d7..606116fced45afb2915ebda216c18df1007f6b17 100644 (file)
@@ -1,7 +1,7 @@
 using Content.Shared.Singularity.EntitySystems;
 using Content.Shared.Singularity.Components;
 
-namespace Content.Client.Singularity.EntitySystems;
+namespace Content.Client.Singularity.Systems;
 
 /// <summary>
 /// The client-side version of <see cref="SharedEventHorizonSystem"/>.
diff --git a/Content.Client/Singularity/Systems/SingularityGeneratorSystem.cs b/Content.Client/Singularity/Systems/SingularityGeneratorSystem.cs
new file mode 100644 (file)
index 0000000..f5b85f8
--- /dev/null
@@ -0,0 +1,12 @@
+using Content.Shared.Singularity.EntitySystems;
+using Content.Shared.Singularity.Components;
+
+namespace Content.Client.Singularity.Systems;
+
+/// <summary>
+/// The client-side version of <see cref="SharedSingularityGeneratorSystem"/>.
+/// Manages <see cref="SingularityGeneratorComponent"/>s.
+/// Exists to make relevant signal handlers (ie: <see cref="SharedSingularityGeneratorSystem.OnEmagged"/>) work on the client.
+/// </summary>
+public sealed class SingularityGeneratorSystem : SharedSingularityGeneratorSystem
+{}
index 5293ad499d07b80e9377042ffe787b492b21bfc4..50a12466be1397859a8fdaddb342cfbaecb7ad50 100644 (file)
@@ -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;
 
 /// <summary>
 /// The client-side version of <see cref="SharedSingularitySystem"/>.
index 4d3bbcbb8e9d84586e7f934e7af9c5c5890d3419..3a556b47063b75b79a572d3b8a49d0f4f18632ae 100644 (file)
@@ -96,6 +96,13 @@ public sealed class EmagSystem : EntitySystem
     }
 }
 
+/// <summary>
+/// Shows a popup to emag user (client side only!) and adds <see cref="EmaggedComponent"/> to the entity when handled
+/// </summary>
+/// <param name="UserUid">Emag user</param>
+/// <param name="Handled">Did the emagging succeed? Causes a user-only popup to show on client side</param>
+/// <param name="Repeatable">Can the entity be emagged more than once? Prevents adding of <see cref="EmaggedComponent"/></param>
+/// <remarks>Needs to be handled in shared/client, not just the server, to actually show the emagging popup</remarks>
 [ByRefEvent]
 public record struct GotEmaggedEvent(EntityUid UserUid, bool Handled = false, bool Repeatable = false);
 
index 3643ed31a6f06858426d74be03574426758625ec..715584b5bc64d79970bebb0aa5b292c99588a5b7 100644 (file)
@@ -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
 {
     /// <summary>
index 8830cb0624cf77b6c2efa11c3f92990751522487..ee6dc89bb8478b5aedbe4d9348d81b928c53c104 100644 (file)
@@ -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;
     }