From 595ec5c0347173b2b704838d14fd587986f3830e Mon Sep 17 00:00:00 2001 From: Swept Date: Sat, 12 Sep 2020 12:14:58 +0000 Subject: [PATCH 1/5] Fixes "Large Bar Sign" not being abstract (#2033) --- Resources/Prototypes/Entities/Constructible/Walls/bar_sign.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/Resources/Prototypes/Entities/Constructible/Walls/bar_sign.yml b/Resources/Prototypes/Entities/Constructible/Walls/bar_sign.yml index a359afb625..85b1ad4e66 100644 --- a/Resources/Prototypes/Entities/Constructible/Walls/bar_sign.yml +++ b/Resources/Prototypes/Entities/Constructible/Walls/bar_sign.yml @@ -18,6 +18,7 @@ - type: entity id: LargeBarSign name: large bar sign + abstract: true components: - type: Clickable - type: InteractionOutline From b288975cb7dfb13c035f93323225f2e6db5062b8 Mon Sep 17 00:00:00 2001 From: py01 <60152240+collinlunn@users.noreply.github.com> Date: Sat, 12 Sep 2020 06:26:50 -0600 Subject: [PATCH 2/5] Siphon and Vent Visualizers (#2062) * scrubber sprites * vent sprites * Vent visualstate * scrubber visual state * Vent and siphon respect being disabled * Vent and Siphon Visualizer * Fix typo Co-authored-by: py01 Co-authored-by: DrSmugleaf --- .../Components/Atmos/SiphonVisualizer.cs | 68 ++++++++++++++++++ .../Components/Atmos/VentVisualizer.cs | 68 ++++++++++++++++++ .../Piping/Scrubbers/BaseSiphonComponent.cs | 26 +++++++ .../Atmos/Piping/Vents/BaseVentComponent.cs | 26 +++++++ .../Atmos/SharedSiphonComponent.cs | 22 ++++++ .../GameObjects/Atmos/SharedVentComponent.cs | 22 ++++++ .../Constructible/Ground/scrubbers.yml | 7 +- .../Entities/Constructible/Ground/vents.yml | 7 +- .../Atmos/scrubber.rsi/meta.json | 48 +++++++++++++ .../Atmos/scrubber.rsi/scrubOff.png | Bin 0 -> 767 bytes .../Atmos/scrubber.rsi/scrubOn.png | Bin 0 -> 4890 bytes .../Constructible/Atmos/vent.rsi/meta.json | 28 ++++++++ .../Constructible/Atmos/vent.rsi/ventOff.png | Bin 0 -> 612 bytes .../Constructible/Atmos/vent.rsi/ventOn.png | Bin 0 -> 1272 bytes 14 files changed, 320 insertions(+), 2 deletions(-) create mode 100644 Content.Client/GameObjects/Components/Atmos/SiphonVisualizer.cs create mode 100644 Content.Client/GameObjects/Components/Atmos/VentVisualizer.cs create mode 100644 Content.Shared/GameObjects/Atmos/SharedSiphonComponent.cs create mode 100644 Content.Shared/GameObjects/Atmos/SharedVentComponent.cs create mode 100644 Resources/Textures/Constructible/Atmos/scrubber.rsi/meta.json create mode 100644 Resources/Textures/Constructible/Atmos/scrubber.rsi/scrubOff.png create mode 100644 Resources/Textures/Constructible/Atmos/scrubber.rsi/scrubOn.png create mode 100644 Resources/Textures/Constructible/Atmos/vent.rsi/meta.json create mode 100644 Resources/Textures/Constructible/Atmos/vent.rsi/ventOff.png create mode 100644 Resources/Textures/Constructible/Atmos/vent.rsi/ventOn.png diff --git a/Content.Client/GameObjects/Components/Atmos/SiphonVisualizer.cs b/Content.Client/GameObjects/Components/Atmos/SiphonVisualizer.cs new file mode 100644 index 0000000000..07a8c04578 --- /dev/null +++ b/Content.Client/GameObjects/Components/Atmos/SiphonVisualizer.cs @@ -0,0 +1,68 @@ +using Content.Shared.GameObjects.Atmos; +using JetBrains.Annotations; +using Robust.Client.GameObjects; +using Robust.Client.Graphics; +using Robust.Client.Interfaces.GameObjects.Components; +using Robust.Client.Interfaces.ResourceManagement; +using Robust.Client.ResourceManagement; +using Robust.Shared.GameObjects.Components.Renderable; +using Robust.Shared.IoC; +using Robust.Shared.Log; +using Robust.Shared.Utility; +using System; +using YamlDotNet.RepresentationModel; + +namespace Content.Client.GameObjects.Components.Atmos +{ + [UsedImplicitly] + public class SiphonVisualizer : AppearanceVisualizer + { + private RSI _siphonRSI; + + public override void LoadData(YamlMappingNode node) + { + base.LoadData(node); + + var rsiString = node.GetNode("siphonRSI").ToString(); + var rsiPath = SharedSpriteComponent.TextureRoot / rsiString; + try + { + var resourceCache = IoCManager.Resolve(); + var resource = resourceCache.GetResource(rsiPath); + _siphonRSI = resource.RSI; + } + catch (Exception e) + { + Logger.ErrorS("go.siphonvisualizer", "Unable to load RSI '{0}'. Trace:\n{1}", rsiPath, e); + } + } + + public override void OnChangeData(AppearanceComponent component) + { + base.OnChangeData(component); + + if (!component.Owner.TryGetComponent(out ISpriteComponent sprite)) + { + return; + } + if (!component.TryGetData(SiphonVisuals.VisualState, out SiphonVisualState siphonVisualState)) + { + return; + } + + var siphonBaseState = "scrub"; + siphonBaseState += siphonVisualState.SiphonEnabled ? "On" : "Off"; + + sprite.LayerMapReserveBlank(Layer.SiphonBase); + var baseSiphonLayer = sprite.LayerMapGet(Layer.SiphonBase); + sprite.LayerSetRSI(baseSiphonLayer, _siphonRSI); + sprite.LayerSetState(baseSiphonLayer, siphonBaseState); + sprite.LayerSetVisible(baseSiphonLayer, true); + } + + private enum Layer + { + SiphonBase, + } + } +} diff --git a/Content.Client/GameObjects/Components/Atmos/VentVisualizer.cs b/Content.Client/GameObjects/Components/Atmos/VentVisualizer.cs new file mode 100644 index 0000000000..a30b2b9f9d --- /dev/null +++ b/Content.Client/GameObjects/Components/Atmos/VentVisualizer.cs @@ -0,0 +1,68 @@ +using Content.Shared.GameObjects.Atmos; +using JetBrains.Annotations; +using Robust.Client.GameObjects; +using Robust.Client.Graphics; +using Robust.Client.Interfaces.GameObjects.Components; +using Robust.Client.Interfaces.ResourceManagement; +using Robust.Client.ResourceManagement; +using Robust.Shared.GameObjects.Components.Renderable; +using Robust.Shared.IoC; +using Robust.Shared.Log; +using Robust.Shared.Utility; +using System; +using YamlDotNet.RepresentationModel; + +namespace Content.Client.GameObjects.Components.Atmos +{ + [UsedImplicitly] + public class VentVisualizer : AppearanceVisualizer + { + private RSI _ventRSI; + + public override void LoadData(YamlMappingNode node) + { + base.LoadData(node); + + var rsiString = node.GetNode("ventRSI").ToString(); + var rsiPath = SharedSpriteComponent.TextureRoot / rsiString; + try + { + var resourceCache = IoCManager.Resolve(); + var resource = resourceCache.GetResource(rsiPath); + _ventRSI = resource.RSI; + } + catch (Exception e) + { + Logger.ErrorS("go.ventvisualizer", "Unable to load RSI '{0}'. Trace:\n{1}", rsiPath, e); + } + } + + public override void OnChangeData(AppearanceComponent component) + { + base.OnChangeData(component); + + if (!component.Owner.TryGetComponent(out ISpriteComponent sprite)) + { + return; + } + if (!component.TryGetData(VentVisuals.VisualState, out VentVisualState ventVisualState)) + { + return; + } + + var ventBaseState = "vent"; + ventBaseState += ventVisualState.VentEnabled ? "On" : "Off"; + + sprite.LayerMapReserveBlank(Layer.VentBase); + var baseVentLayer = sprite.LayerMapGet(Layer.VentBase); + sprite.LayerSetRSI(baseVentLayer, _ventRSI); + sprite.LayerSetState(baseVentLayer, ventBaseState); + sprite.LayerSetVisible(baseVentLayer, true); + } + + private enum Layer + { + VentBase, + } + } +} diff --git a/Content.Server/GameObjects/Components/Atmos/Piping/Scrubbers/BaseSiphonComponent.cs b/Content.Server/GameObjects/Components/Atmos/Piping/Scrubbers/BaseSiphonComponent.cs index da90efdad2..921a7c92be 100644 --- a/Content.Server/GameObjects/Components/Atmos/Piping/Scrubbers/BaseSiphonComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/Piping/Scrubbers/BaseSiphonComponent.cs @@ -2,6 +2,8 @@ using Content.Server.GameObjects.Components.NodeContainer; using Content.Server.GameObjects.Components.NodeContainer.Nodes; using Content.Server.GameObjects.EntitySystems; +using Content.Shared.GameObjects.Atmos; +using Robust.Server.GameObjects; using Robust.Shared.GameObjects.Systems; using Robust.Shared.Log; using Robust.Shared.ViewVariables; @@ -23,6 +25,20 @@ namespace Content.Server.GameObjects.Components.Atmos.Piping private AtmosphereSystem _atmosSystem; + [ViewVariables(VVAccess.ReadWrite)] + public bool SiphonEnabled + { + get => _siphonEnabled; + set + { + _siphonEnabled = value; + UpdateAppearance(); + } + } + private bool _siphonEnabled = true; + + private AppearanceComponent _appearance; + public override void Initialize() { base.Initialize(); @@ -40,10 +56,15 @@ namespace Content.Server.GameObjects.Components.Atmos.Piping Logger.Error($"{typeof(BaseSiphonComponent)} on entity {Owner.Uid} could not find compatible {nameof(PipeNode)}s on its {nameof(NodeContainerComponent)}."); return; } + Owner.TryGetComponent(out _appearance); + UpdateAppearance(); } public override void Update() { + if (!SiphonEnabled) + return; + var tileAtmos = Owner.Transform.Coordinates.GetTileAtmosphere(_entityManager); if (tileAtmos == null) return; @@ -52,5 +73,10 @@ namespace Content.Server.GameObjects.Components.Atmos.Piping } protected abstract void ScrubGas(GasMixture inletGas, GasMixture outletGas); + + private void UpdateAppearance() + { + _appearance?.SetData(SiphonVisuals.VisualState, new SiphonVisualState(SiphonEnabled)); + } } } diff --git a/Content.Server/GameObjects/Components/Atmos/Piping/Vents/BaseVentComponent.cs b/Content.Server/GameObjects/Components/Atmos/Piping/Vents/BaseVentComponent.cs index a9240c3556..8176cdd315 100644 --- a/Content.Server/GameObjects/Components/Atmos/Piping/Vents/BaseVentComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/Piping/Vents/BaseVentComponent.cs @@ -2,6 +2,8 @@ using Content.Server.GameObjects.Components.NodeContainer; using Content.Server.GameObjects.Components.NodeContainer.Nodes; using Content.Server.GameObjects.EntitySystems; +using Content.Shared.GameObjects.Atmos; +using Robust.Server.GameObjects; using Robust.Shared.GameObjects.Systems; using Robust.Shared.Log; using Robust.Shared.ViewVariables; @@ -23,6 +25,20 @@ namespace Content.Server.GameObjects.Components.Atmos.Piping private AtmosphereSystem _atmosSystem; + [ViewVariables(VVAccess.ReadWrite)] + public bool VentEnabled + { + get => _ventEnabled; + set + { + _ventEnabled = value; + UpdateAppearance(); + } + } + private bool _ventEnabled = true; + + private AppearanceComponent _appearance; + public override void Initialize() { base.Initialize(); @@ -40,10 +56,15 @@ namespace Content.Server.GameObjects.Components.Atmos.Piping Logger.Error($"{typeof(BaseVentComponent)} on entity {Owner.Uid} could not find compatible {nameof(PipeNode)}s on its {nameof(NodeContainerComponent)}."); return; } + Owner.TryGetComponent(out _appearance); + UpdateAppearance(); } public override void Update() { + if (!VentEnabled) + return; + var tileAtmos = Owner.Transform.Coordinates.GetTileAtmosphere(_entityManager); if (tileAtmos == null) return; @@ -52,5 +73,10 @@ namespace Content.Server.GameObjects.Components.Atmos.Piping } protected abstract void VentGas(GasMixture inletGas, GasMixture outletGas); + + private void UpdateAppearance() + { + _appearance?.SetData(VentVisuals.VisualState, new VentVisualState(VentEnabled)); + } } } diff --git a/Content.Shared/GameObjects/Atmos/SharedSiphonComponent.cs b/Content.Shared/GameObjects/Atmos/SharedSiphonComponent.cs new file mode 100644 index 0000000000..39be0e6ca7 --- /dev/null +++ b/Content.Shared/GameObjects/Atmos/SharedSiphonComponent.cs @@ -0,0 +1,22 @@ +using Robust.Shared.Serialization; +using System; + +namespace Content.Shared.GameObjects.Atmos +{ + [Serializable, NetSerializable] + public enum SiphonVisuals + { + VisualState + } + + [Serializable, NetSerializable] + public class SiphonVisualState + { + public readonly bool SiphonEnabled; + + public SiphonVisualState(bool siphonEnabled) + { + SiphonEnabled = siphonEnabled; + } + } +} diff --git a/Content.Shared/GameObjects/Atmos/SharedVentComponent.cs b/Content.Shared/GameObjects/Atmos/SharedVentComponent.cs new file mode 100644 index 0000000000..03c7d9d320 --- /dev/null +++ b/Content.Shared/GameObjects/Atmos/SharedVentComponent.cs @@ -0,0 +1,22 @@ +using Robust.Shared.Serialization; +using System; + +namespace Content.Shared.GameObjects.Atmos +{ + [Serializable, NetSerializable] + public enum VentVisuals + { + VisualState + } + + [Serializable, NetSerializable] + public class VentVisualState + { + public readonly bool VentEnabled; + + public VentVisualState(bool ventEnabled) + { + VentEnabled = ventEnabled; + } + } +} diff --git a/Resources/Prototypes/Entities/Constructible/Ground/scrubbers.yml b/Resources/Prototypes/Entities/Constructible/Ground/scrubbers.yml index 2372c3e65d..2dc4f1f3e9 100644 --- a/Resources/Prototypes/Entities/Constructible/Ground/scrubbers.yml +++ b/Resources/Prototypes/Entities/Constructible/Ground/scrubbers.yml @@ -12,7 +12,12 @@ - type: Icon texture: Constructible/Power/eightdirwire.png - type: Sprite - texture: Constructible/Power/eightdirwire.png + - type: Appearance + visuals: + - type: PipeVisualizer + pipeRSI: Constructible/Atmos/pipe.rsi + - type: SiphonVisualizer + siphonRSI: Constructible/Atmos/scrubber.rsi - type: Destructible thresholdvalue: 100 diff --git a/Resources/Prototypes/Entities/Constructible/Ground/vents.yml b/Resources/Prototypes/Entities/Constructible/Ground/vents.yml index 2940ec1b08..4c02001688 100644 --- a/Resources/Prototypes/Entities/Constructible/Ground/vents.yml +++ b/Resources/Prototypes/Entities/Constructible/Ground/vents.yml @@ -12,7 +12,12 @@ - type: Icon texture: Constructible/Power/eightdirwire.png - type: Sprite - texture: Constructible/Power/eightdirwire.png + - type: Appearance + visuals: + - type: PipeVisualizer + pipeRSI: Constructible/Atmos/pipe.rsi + - type: VentVisualizer + ventRSI: Constructible/Atmos/vent.rsi - type: Destructible thresholdvalue: 100 diff --git a/Resources/Textures/Constructible/Atmos/scrubber.rsi/meta.json b/Resources/Textures/Constructible/Atmos/scrubber.rsi/meta.json new file mode 100644 index 0000000000..2feeef5cfa --- /dev/null +++ b/Resources/Textures/Constructible/Atmos/scrubber.rsi/meta.json @@ -0,0 +1,48 @@ +{ + "version":1, + "size":{ + "x":32, + "y":32 + }, + "license":"CC-BY-SA-3.0", + "copyright":"Taken from https://github.com/tgstation/tgstation at commit 57cd1d59ca019dd0e7811ac451f295f818e573da", + "states":[ + { + "name":"scrubOff", + "directions":1, + "delays":[ [ 1.0 ] ] + }, + { + "name":"scrubOn", + "directions":1, + "delays":[ + [ + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08, + 0.08 + ] + ] + } + ] +} diff --git a/Resources/Textures/Constructible/Atmos/scrubber.rsi/scrubOff.png b/Resources/Textures/Constructible/Atmos/scrubber.rsi/scrubOff.png new file mode 100644 index 0000000000000000000000000000000000000000..c4b16c7d0e64fdd1ceccbfb15f9f18e1db900feb GIT binary patch literal 767 zcmVR6!QBm`Qb3|ehdpt+nh z+(3Z?heK{F)WOviE@1r#T4adcM&9w>g*bnkN-vBgC$NM8psK$fcB? zynd`$Ej3Ch7PSFjQ5%#}td^Skv7#(Xf*?Rj>GSf{0-B~F%Q8>Cs11|p9BVD((GY;~ zXo$6z$#l-5HeN)QWzT|ow17O%H))#UoFfcF;`kq{KhHkVPZZ>Zmsp?+cIo30dPKuky0Kc;KdR|QACowV!aLl z`1zM#vDW$w^b_UDS4)jChU=SKKD@s`YfTu2^m?x_Ci*%70A*RClmg)4{?1zr&`%T( z_jmLYg)xRjZCKR5d6$F`lx4Zsffq|q6vbIpRRlpm+qM{E{Mz-+t*`lNseLd3j4`xr zOArK9Rkim@-swOTMgCIRB93E(5Z;Z+bk2wO7mPxR8v@91uLaNpj} x18JJRI1f}+#s4x7{96e8cN5VGC!Fxj@fX&mfot!0*Ny-H002ovPDHLkV1m4Lc^&`& literal 0 HcmV?d00001 diff --git a/Resources/Textures/Constructible/Atmos/scrubber.rsi/scrubOn.png b/Resources/Textures/Constructible/Atmos/scrubber.rsi/scrubOn.png new file mode 100644 index 0000000000000000000000000000000000000000..06a975cc5ad5b3306ef406fef654051f477c3fbf GIT binary patch literal 4890 zcmbW5cT^Kk*T+MV0E%=$K#C}e4e1CWK@o4X~gR!1R_DSIDghE?D^&#$@#{^`Cf|tQH}{RHdaB3eO5ikb4wMa zReQfaIDeY+ta6&+MWsyTPd0=vwJL^h-V0y)T6Z_IuGG_WOe!4~uRv5jHZ6Ybdb3|~ zug}+S2CHp`MU%#Zj~=ZZRqjPW%&trQPua2mdSF|0w*8?t6q0#J9rtMq23eqP&OkY= zK5hu>BQ)x;MRdP=bT={bi?>yTM)sw%V*J4&A>YFaZNJAVbHkXdN4@#_{wtPhl7@zc z>6czB4{9w^3?v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12=m0-}(tH|Q8W`b@yu|L30-SP*-6N)RF$(RWWe}M1@IIHL1 i2nh)Z2?+`Hu>J+*FN#YoJmHoA0000~Syv literal 0 HcmV?d00001 From 1d4700493bc855c08006d4c7a38bb6c9e4422be5 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Sat, 12 Sep 2020 15:47:37 +0200 Subject: [PATCH 3/5] Ignore client unknown components (#2069) --- Content.Client/IgnoredComponents.cs | 2 ++ SpaceStation14.sln.DotSettings | 1 + 2 files changed, 3 insertions(+) diff --git a/Content.Client/IgnoredComponents.cs b/Content.Client/IgnoredComponents.cs index 7dea6c8738..49f804ca64 100644 --- a/Content.Client/IgnoredComponents.cs +++ b/Content.Client/IgnoredComponents.cs @@ -176,6 +176,8 @@ "ExtinguisherCabinet", "ExtinguisherCabinetFilled", "FireExtinguisher", + "AtmosPlaque", + "Spillable", }; } } diff --git a/SpaceStation14.sln.DotSettings b/SpaceStation14.sln.DotSettings index 70e73486b8..f0a586f719 100644 --- a/SpaceStation14.sln.DotSettings +++ b/SpaceStation14.sln.DotSettings @@ -101,6 +101,7 @@ True True True + True True True True From ca8018f9f9e9b742e3da82bd57fb6ae74b7f7330 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Sat, 12 Sep 2020 15:47:57 +0200 Subject: [PATCH 4/5] Make PostMapInitTest ignore test maps instead of those in an array (#2066) --- Content.IntegrationTests/Tests/PostMapInitTest.cs | 11 +++++------ Resources/Maps/{ => Test}/Pathfinding/simple.yml | 0 2 files changed, 5 insertions(+), 6 deletions(-) rename Resources/Maps/{ => Test}/Pathfinding/simple.yml (100%) diff --git a/Content.IntegrationTests/Tests/PostMapInitTest.cs b/Content.IntegrationTests/Tests/PostMapInitTest.cs index e29926951e..feddf591e5 100644 --- a/Content.IntegrationTests/Tests/PostMapInitTest.cs +++ b/Content.IntegrationTests/Tests/PostMapInitTest.cs @@ -11,10 +11,8 @@ namespace Content.IntegrationTests.Tests [TestFixture] public class PostMapInitTest : ContentIntegrationTest { - public readonly string[] SkippedMaps = - { - "/Maps/Pathfinding/simple.yml" - }; + public const bool SkipTestMaps = true; + public const string TestMapsPath = "/Maps/Test/"; [Test] public async Task NoSavedPostMapInitTest() @@ -34,7 +32,8 @@ namespace Content.IntegrationTests.Tests { var rootedPath = map.ToRootedPath(); - if (SkippedMaps.Contains(rootedPath.ToString())) + // ReSharper disable once RedundantLogicalConditionalExpressionOperand + if (SkipTestMaps && rootedPath.ToString().StartsWith(TestMapsPath)) { continue; } @@ -53,7 +52,7 @@ namespace Content.IntegrationTests.Tests var meta = root["meta"]; var postMapInit = meta["postmapinit"].AsBool(); - Assert.False(postMapInit); + Assert.False(postMapInit, $"Map {map.Filename} was saved postmapinit"); } } } diff --git a/Resources/Maps/Pathfinding/simple.yml b/Resources/Maps/Test/Pathfinding/simple.yml similarity index 100% rename from Resources/Maps/Pathfinding/simple.yml rename to Resources/Maps/Test/Pathfinding/simple.yml From 7cd98a4bceedb25b43969c35d19909a3c64f674f Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Sat, 12 Sep 2020 15:48:22 +0200 Subject: [PATCH 5/5] Add extension method to popup a message for the source and everyone else around it (#2063) * Add extension method to popup a message for the source and everyone around * Add IPlayerManager as a parameter --- Content.Server/Utility/NotifyExtensions.cs | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Content.Server/Utility/NotifyExtensions.cs b/Content.Server/Utility/NotifyExtensions.cs index d4ae473f31..ef076ce1aa 100644 --- a/Content.Server/Utility/NotifyExtensions.cs +++ b/Content.Server/Utility/NotifyExtensions.cs @@ -13,12 +13,17 @@ namespace Content.Server.Utility /// /// The entity on which to popup the message. /// The message to show. + /// + /// The instance of player manager to use, will be resolved automatically + /// if null. + /// /// /// The range in which to search for players, defaulting to one screen. /// - public static void PopupMessageOtherClients(this IEntity source, string message, int range = 15) + public static void PopupMessageOtherClients(this IEntity source, string message, IPlayerManager playerManager = null, int range = 15) { - var playerManager = IoCManager.Resolve(); + playerManager ??= IoCManager.Resolve(); + var viewers = playerManager.GetPlayersInRange(source.Transform.Coordinates, range); foreach (var viewer in viewers) @@ -33,5 +38,24 @@ namespace Content.Server.Utility source.PopupMessage(viewer.AttachedEntity, message); } } + + /// + /// Pops up a message at the given entity's location for everyone, + /// including itself, to see. + /// + /// The entity above which to show the message. + /// The message to be seen. + /// + /// The instance of player manager to use, will be resolved automatically + /// if null. + /// + /// + /// The range in which to search for players, defaulting to one screen. + /// + public static void PopupMessageEveryone(this IEntity source, string message, IPlayerManager playerManager = null, int range = 15) + { + source.PopupMessage(message); + source.PopupMessageOtherClients(message, playerManager, range); + } } }