From 881a2b2ece58345bccf8609def7549abda261396 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Mon, 19 Dec 2022 10:41:47 +1300 Subject: [PATCH] PopupSystem public methods rejig (#12830) --- Content.Client/Popups/PopupSystem.cs | 106 ++++++++++-------- .../Weapons/Melee/MeleeWeaponSystem.cs | 4 +- .../Weapons/Ranged/Systems/GunSystem.cs | 2 +- Content.Server/AME/AntimatterEngineSystem.cs | 12 +- .../Abilities/Mime/MimePowersSystem.cs | 10 +- .../Access/Systems/AgentIDCardSystem.cs | 6 +- Content.Server/Access/Systems/IdCardSystem.cs | 8 +- .../Systems/AdminVerbSystem.Smites.cs | 35 +++--- .../AirlockPainter/AirlockPainterSystem.cs | 2 +- .../Animals/Systems/EggLayerSystem.cs | 8 +- Content.Server/Animals/Systems/UdderSystem.cs | 6 +- .../Atmos/EntitySystems/GasAnalyzerSystem.cs | 6 +- .../Atmos/Monitor/Systems/AirAlarmSystem.cs | 2 +- .../AtmosUnsafeUnanchorSystem.cs | 2 +- .../Trinary/EntitySystems/GasFilterSystem.cs | 2 +- .../Unary/EntitySystems/GasCanisterSystem.cs | 2 +- Content.Server/Bed/Sleep/SleepingSystem.cs | 4 +- Content.Server/Bible/BibleSystem.cs | 19 ++-- .../Body/Systems/BloodstreamSystem.cs | 2 +- .../Body/Systems/InternalsSystem.cs | 4 +- .../Body/Systems/RespiratorSystem.cs | 2 +- .../Botany/Systems/BotanySwabSystem.cs | 4 +- .../Botany/Systems/BotanySystem.Seed.cs | 6 +- .../Botany/Systems/PlantHolderSystem.cs | 32 +++--- .../Botany/Systems/SeedExtractorSystem.cs | 4 +- .../Buckle/Systems/BuckleSystem.Buckle.cs | 10 +- .../Cargo/Systems/CargoSystem.Orders.cs | 5 +- .../Cargo/Systems/CargoSystem.Shuttle.cs | 6 +- .../Cargo/Systems/PriceGunSystem.cs | 4 +- .../Cartridges/NetProbeCartridgeSystem.cs | 4 +- .../Chat/Systems/ChatSystem.Radio.cs | 4 +- .../EntitySystems/ChemMasterSystem.cs | 7 +- .../EntitySystems/ChemistrySystem.Injector.cs | 24 ++-- .../EntitySystems/ChemistrySystemHypospray.cs | 10 +- .../EntitySystems/SolutionSpikableSystem.cs | 4 +- .../Chemistry/ReagentEffects/PopupMessage.cs | 6 +- Content.Server/Climbing/ClimbSystem.cs | 4 +- Content.Server/Clothing/MaskSystem.cs | 4 +- .../CommunicationsConsoleSystem.cs | 8 +- .../Construction/AnchorableSystem.cs | 8 +- .../Construction/Completions/PopupEveryone.cs | 2 +- .../Construction/Completions/PopupUser.cs | 6 +- .../Construction/ConstructionSystem.Guided.cs | 4 +- .../ConstructionSystem.Initial.cs | 8 +- .../Construction/PartExchangerSystem.cs | 4 +- Content.Server/Crayon/CrayonSystem.cs | 6 +- Content.Server/Cuffs/CuffableSystem.cs | 20 ++-- .../Damage/Systems/DamagePopupSystem.cs | 4 +- .../Systems/NetworkConfiguratorSystem.cs | 12 +- .../Disease/DiseaseDiagnosisSystem.cs | 14 +-- Content.Server/Disease/DiseaseSystem.cs | 6 +- .../Disease/Effects/DiseasePolymorph.cs | 2 +- .../Disease/Effects/DiseasePopUp.cs | 4 +- .../Unit/EntitySystems/DisposalUnitSystem.cs | 4 +- .../Doors/Systems/FirelockSystem.cs | 4 +- Content.Server/Dragon/DragonSystem.cs | 18 +-- Content.Server/Drone/DroneSystem.cs | 5 +- .../Electrocution/ElectrocutionSystem.cs | 10 +- Content.Server/Emag/EmagSystem.cs | 4 +- .../Ensnaring/EnsnareableSystem.Ensnaring.cs | 4 +- Content.Server/Ensnaring/EnsnareableSystem.cs | 4 +- .../EntitySystems/TriggerSystem.Mobstate.cs | 2 +- .../EntitySystems/TriggerSystem.OnUse.cs | 10 +- .../EntitySystems/TriggerSystem.Voice.cs | 6 +- .../Extinguisher/FireExtinguisherSystem.cs | 6 +- .../ActivatableUIRequiresVisionSystem.cs | 2 +- Content.Server/Fax/FaxSystem.cs | 42 +++---- .../Fluids/EntitySystems/SpraySystem.cs | 2 +- .../Forensics/Systems/ForensicPadSystem.cs | 8 +- .../Systems/ForensicScannerSystem.cs | 8 +- .../GameTicking/Rules/ZombieRuleSystem.cs | 2 +- Content.Server/Guardian/GuardianSystem.cs | 26 ++--- Content.Server/Hands/Systems/HandsSystem.cs | 4 +- .../ImmovableRod/ImmovableRodSystem.cs | 6 +- Content.Server/Implants/ImplanterSystem.cs | 8 +- .../Instruments/SwappableInstrumentSystem.cs | 2 +- .../Interaction/InteractionPopupSystem.cs | 6 +- .../EntitySystems/KitchenSpikeSystem.cs | 22 ++-- .../Kitchen/EntitySystems/MicrowaveSystem.cs | 10 +- .../EntitySystems/ReagentGrinderSystem.cs | 2 +- .../Kitchen/EntitySystems/SharpSystem.cs | 2 +- .../Labels/Label/HandLabelerSystem.cs | 6 +- Content.Server/LandMines/LandMineSystem.cs | 2 +- .../EntitySystems/HandheldLightSystem.cs | 4 +- .../EntitySystems/LightReplacerSystem.cs | 8 +- .../Light/EntitySystems/PoweredLightSystem.cs | 2 +- Content.Server/Lock/LockSystem.cs | 2 +- .../System/SignalLinkerSystem.cs | 33 +++--- .../Materials/MaterialStorageSystem.cs | 2 +- .../Mech/Systems/MechEquipmentSystem.cs | 4 +- .../BiomassReclaimerSystem.cs | 2 +- .../Medical/HealthAnalyzerSystem.cs | 4 +- .../Medical/Stethoscope/StethoscopeSystem.cs | 4 +- .../Medical/SuitSensors/SuitSensorSystem.cs | 2 +- Content.Server/Medical/VomitSystem.cs | 2 +- Content.Server/Morgue/CrematoriumSystem.cs | 4 +- Content.Server/Mousetrap/MousetrapSystem.cs | 2 +- .../Specific/MedibotInjectOperator.cs | 4 +- Content.Server/Nuke/NukeSystem.cs | 4 +- .../Nutrition/EntitySystems/DrinkSystem.cs | 20 ++-- .../Nutrition/EntitySystems/FoodSystem.cs | 18 +-- .../Nutrition/EntitySystems/UtensilSystem.cs | 2 +- Content.Server/PAI/PAISystem.cs | 10 +- Content.Server/Paper/PaperSystem.cs | 4 +- .../Plants/Systems/PottedPlantHideSystem.cs | 2 +- .../Pointing/EntitySystems/PointingSystem.cs | 2 +- .../Systems/PolymorphedEntitySystem.cs | 3 +- Content.Server/Popups/PopupSystem.cs | 69 ++++++++++-- .../Power/EntitySystems/ApcSystem.cs | 2 +- Content.Server/Prayer/PrayerSystem.cs | 8 +- Content.Server/RCD/Systems/RCDSystem.cs | 18 +-- .../Radio/EntitySystems/RadioDeviceSystem.cs | 6 +- Content.Server/RatKing/RatKingSystem.cs | 6 +- Content.Server/Recycling/RecyclerSystem.cs | 4 +- Content.Server/Remotes/DoorRemoteSystem.cs | 2 +- .../Research/Disk/ResearchDiskSystem.cs | 2 +- .../Resist/EscapeInventorySystem.cs | 4 +- Content.Server/Resist/ResistLockerSystem.cs | 4 +- .../EntitySystems/RevenantSystem.Abilities.cs | 14 +-- .../Revenant/EntitySystems/RevenantSystem.cs | 4 +- Content.Server/Salvage/SalvageSystem.cs | 2 +- .../Shuttles/Systems/ShuttleConsoleSystem.cs | 8 +- .../Systems/ShuttleSystem.EmergencyConsole.cs | 8 +- .../ContainmentFieldGeneratorSystem.cs | 14 +-- .../EntitySystems/ContainmentFieldSystem.cs | 2 +- .../EntitySystems/EmitterSystem.cs | 8 +- .../EntitySystems/RadiationCollectorSystem.cs | 2 +- Content.Server/Sound/EmitSoundSystem.cs | 2 +- Content.Server/Stack/StackSystem.cs | 4 +- Content.Server/Sticky/Systems/StickySystem.cs | 8 +- .../EntitySystems/EntityStorageSystem.cs | 6 +- .../EntitySystems/SecretStashSystem.cs | 8 +- .../Storage/EntitySystems/StorageSystem.cs | 2 +- Content.Server/Store/Systems/StoreSystem.cs | 2 +- Content.Server/Strip/StrippableSystem.cs | 10 +- Content.Server/Toilet/ToiletSystem.cs | 8 +- Content.Server/Tools/ToolSystem.Welder.cs | 14 +-- .../TraitorDeathMatchRedemptionSystem.cs | 14 +-- .../VendingMachines/VendingMachineSystem.cs | 6 +- Content.Server/Verbs/VerbSystem.cs | 2 +- Content.Server/VoiceMask/VoiceMaskSystem.cs | 4 +- .../Weapons/Melee/MeleeWeaponSystem.cs | 13 ++- .../Weapons/Ranged/Systems/GunSystem.cs | 2 +- Content.Server/Wieldable/WieldableSystem.cs | 14 +-- Content.Server/Wires/WiresSystem.cs | 28 ++--- .../Systems/ArtifactAnalyzerSystem.cs | 4 +- .../Systems/TraversalDistorterSystem.cs | 2 +- .../Systems/RandomTeleportArtifactSystem.cs | 2 +- .../Systems/TelepathicArtifactSystem.cs | 2 +- .../Zombies/ZombifyOnDeathSystem.cs | 2 +- Content.Shared/Actions/SharedActionsSystem.cs | 4 +- Content.Shared/Blocking/BlockingSystem.cs | 12 +- .../EntitySystems/ToggleableClothingSystem.cs | 2 +- .../Containers/ItemSlot/ItemSlotsSystem.cs | 2 +- .../Damage/Systems/StaminaSystem.cs | 6 +- .../Implants/SharedImplanterSystem.cs | 2 +- .../Interaction/SharedInteractionSystem.cs | 4 +- .../Inventory/InventorySystem.Equip.cs | 16 +-- .../Mech/EntitySystems/SharedMechSystem.cs | 3 +- .../Movement/Systems/SharedJetpackSystem.cs | 6 +- .../Popups/SharedPopupExtensions.cs | 4 +- Content.Shared/Popups/SharedPopupSystem.cs | 66 +++++++++-- Content.Shared/Speech/Muting/MutingSystem.cs | 2 +- Content.Shared/Stacks/SharedStackSystem.cs | 6 +- 164 files changed, 721 insertions(+), 631 deletions(-) diff --git a/Content.Client/Popups/PopupSystem.cs b/Content.Client/Popups/PopupSystem.cs index da57acef85..5ecdd8cc4a 100644 --- a/Content.Client/Popups/PopupSystem.cs +++ b/Content.Client/Popups/PopupSystem.cs @@ -9,6 +9,7 @@ using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Shared.Map; using Robust.Shared.Player; +using Robust.Shared.Players; using Robust.Shared.Timing; using Robust.Shared.Utility; @@ -35,38 +36,6 @@ namespace Content.Client.Popups SubscribeNetworkEvent(OnRoundRestart); } - #region Actual Implementation - - public void PopupCursor(string message, PopupType type=PopupType.Small) - { - var label = new CursorPopupLabel(_inputManager.MouseScreenPosition) - { - Text = message, - StyleClasses = { GetStyleClass(type) }, - }; - _userInterfaceManager.PopupRoot.AddChild(label); - _aliveCursorLabels.Add(label); - } - - public void PopupCoordinates(string message, EntityCoordinates coordinates, PopupType type=PopupType.Small) - { - if (_eyeManager.CurrentMap != Transform(coordinates.EntityId).MapID) - return; - PopupMessage(message, type, coordinates, null); - } - - public void PopupEntity(string message, EntityUid uid, PopupType type=PopupType.Small) - { - if (!EntityManager.EntityExists(uid)) - return; - - var transform = EntityManager.GetComponent(uid); - if (_eyeManager.CurrentMap != transform.MapID) - return; // TODO: entity may be outside of PVS, but enter PVS at a later time. So the pop-up should still get tracked? - - PopupMessage(message, type, transform.Coordinates, uid); - } - private void PopupMessage(string message, PopupType type, EntityCoordinates coordinates, EntityUid? entity = null) { var label = new WorldPopupLabel(_eyeManager, EntityManager) @@ -83,32 +52,77 @@ namespace Content.Client.Popups _aliveWorldLabels.Add(label); } - #endregion - #region Abstract Method Implementations - - public override void PopupCursor(string message, Filter filter, PopupType type=PopupType.Small) + public override void PopupCoordinates(string message, EntityCoordinates coordinates, PopupType type = PopupType.Small) { - if (!filter.CheckPrediction) - return; - - PopupCursor(message, type); + PopupMessage(message, type, coordinates, null); } - public override void PopupCoordinates(string message, EntityCoordinates coordinates, Filter filter, PopupType type=PopupType.Small) + public override void PopupCoordinates(string message, EntityCoordinates coordinates, ICommonSession recipient, PopupType type = PopupType.Small) { - if (!filter.CheckPrediction) - return; + if (_playerManager.LocalPlayer?.Session == recipient) + PopupMessage(message, type, coordinates, null); + } + public override void PopupCoordinates(string message, EntityCoordinates coordinates, EntityUid recipient, PopupType type = PopupType.Small) + { + if (_playerManager.LocalPlayer?.ControlledEntity == recipient) + PopupMessage(message, type, coordinates, null); + } + + public override void PopupCursor(string message, PopupType type = PopupType.Small) + { + var label = new CursorPopupLabel(_inputManager.MouseScreenPosition) + { + Text = message, + StyleClasses = { GetStyleClass(type) }, + }; + _userInterfaceManager.PopupRoot.AddChild(label); + _aliveCursorLabels.Add(label); + } + + public override void PopupCursor(string message, ICommonSession recipient, PopupType type = PopupType.Small) + { + if (_playerManager.LocalPlayer?.Session == recipient) + PopupCursor(message, type); + } + + public override void PopupCursor(string message, EntityUid recipient, PopupType type = PopupType.Small) + { + if (_playerManager.LocalPlayer?.ControlledEntity == recipient) + PopupCursor(message, type); + } + + public override void PopupCoordinates(string message, EntityCoordinates coordinates, Filter filter, bool replayRecord, PopupType type = PopupType.Small) + { PopupCoordinates(message, coordinates, type); } - public override void PopupEntity(string message, EntityUid uid, Filter filter, PopupType type=PopupType.Small) + public override void PopupEntity(string message, EntityUid uid, EntityUid recipient, PopupType type = PopupType.Small) { - if (!filter.CheckPrediction) + if (_playerManager.LocalPlayer?.ControlledEntity == recipient) + PopupCursor(message, type); + } + + public override void PopupEntity(string message, EntityUid uid, ICommonSession recipient, PopupType type = PopupType.Small) + { + if (_playerManager.LocalPlayer?.Session == recipient) + PopupCursor(message, type); + } + + public override void PopupEntity(string message, EntityUid uid, Filter filter, bool recordReplay, PopupType type=PopupType.Small) + { + PopupEntity(message, uid, type); + } + + public override void PopupEntity(string message, EntityUid uid, PopupType type = PopupType.Small) + { + if (!EntityManager.EntityExists(uid)) return; - PopupEntity(message, uid, type); + var transform = EntityManager.GetComponent(uid); + + PopupMessage(message, type, transform.Coordinates, uid); } #endregion diff --git a/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs b/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs index 90946d293c..f3ba6edaa2 100644 --- a/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs +++ b/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs @@ -239,7 +239,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem return true; if (Timing.IsFirstTimePredicted && HasComp(ev.Target.Value)) - PopupSystem.PopupEntity(Loc.GetString("disarm-action-disarmable", ("targetName", ev.Target.Value)), ev.Target.Value, Filter.Local()); + PopupSystem.PopupEntity(Loc.GetString("disarm-action-disarmable", ("targetName", ev.Target.Value)), ev.Target.Value); return false; } @@ -252,7 +252,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem if (!Timing.IsFirstTimePredicted || uid == null) return; - PopupSystem.PopupEntity(message, uid.Value, Filter.Local()); + PopupSystem.PopupEntity(message, uid.Value); } private void OnMeleeLunge(MeleeLungeEvent ev) diff --git a/Content.Client/Weapons/Ranged/Systems/GunSystem.cs b/Content.Client/Weapons/Ranged/Systems/GunSystem.cs index e413565c89..2c52865cd6 100644 --- a/Content.Client/Weapons/Ranged/Systems/GunSystem.cs +++ b/Content.Client/Weapons/Ranged/Systems/GunSystem.cs @@ -227,7 +227,7 @@ public sealed partial class GunSystem : SharedGunSystem protected override void Popup(string message, EntityUid? uid, EntityUid? user) { if (uid == null || user == null || !Timing.IsFirstTimePredicted) return; - PopupSystem.PopupEntity(message, uid.Value, Filter.Entities(user.Value)); + PopupSystem.PopupEntity(message, uid.Value, user.Value); } protected override void CreateEffect(EntityUid uid, MuzzleFlashEvent message, EntityUid? user = null) diff --git a/Content.Server/AME/AntimatterEngineSystem.cs b/Content.Server/AME/AntimatterEngineSystem.cs index bb7413c59a..5b11a10f81 100644 --- a/Content.Server/AME/AntimatterEngineSystem.cs +++ b/Content.Server/AME/AntimatterEngineSystem.cs @@ -56,7 +56,7 @@ namespace Content.Server.AME { if (!TryComp(args.User, out HandsComponent? hands)) { - _popupSystem.PopupEntity(Loc.GetString("ame-controller-component-interact-using-no-hands-text"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("ame-controller-component-interact-using-no-hands-text"), uid, args.User); return; } @@ -64,20 +64,20 @@ namespace Content.Server.AME { if (component.HasJar) { - _popupSystem.PopupEntity(Loc.GetString("ame-controller-component-interact-using-already-has-jar"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("ame-controller-component-interact-using-already-has-jar"), uid, args.User); } else { component.JarSlot.Insert(args.Used); _popupSystem.PopupEntity(Loc.GetString("ame-controller-component-interact-using-success"), uid, - Filter.Entities(args.User), PopupType.Medium); + args.User, PopupType.Medium); component.UpdateUserInterface(); } } else { - _popupSystem.PopupEntity(Loc.GetString("ame-controller-component-interact-using-fail"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("ame-controller-component-interact-using-fail"), uid, args.User); } } @@ -85,7 +85,7 @@ namespace Content.Server.AME { if (!HasComp(args.User)) { - _popupSystem.PopupEntity(Loc.GetString("ame-part-component-interact-using-no-hands"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("ame-part-component-interact-using-no-hands"), uid, args.User); return; } @@ -98,7 +98,7 @@ namespace Content.Server.AME var snapPos = mapGrid.TileIndicesFor(args.ClickLocation); if (mapGrid.GetAnchoredEntities(snapPos).Any(sc => HasComp(sc))) { - _popupSystem.PopupEntity(Loc.GetString("ame-part-component-shielding-already-present"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("ame-part-component-shielding-already-present"), uid, args.User); return; } diff --git a/Content.Server/Abilities/Mime/MimePowersSystem.cs b/Content.Server/Abilities/Mime/MimePowersSystem.cs index 22db7e5321..b7a0c2cc98 100644 --- a/Content.Server/Abilities/Mime/MimePowersSystem.cs +++ b/Content.Server/Abilities/Mime/MimePowersSystem.cs @@ -41,7 +41,7 @@ namespace Content.Server.Abilities.Mime continue; mime.ReadyToRepent = true; - _popupSystem.PopupEntity(Loc.GetString("mime-ready-to-repent"), mime.Owner, Filter.Entities(mime.Owner)); + _popupSystem.PopupEntity(Loc.GetString("mime-ready-to-repent"), mime.Owner, mime.Owner); } } @@ -55,7 +55,7 @@ namespace Content.Server.Abilities.Mime if (!component.Enabled) return; - _popupSystem.PopupEntity(Loc.GetString("mime-cant-speak"), uid, Filter.Entities(uid)); + _popupSystem.PopupEntity(Loc.GetString("mime-cant-speak"), uid, uid); args.Cancel(); } @@ -79,11 +79,11 @@ namespace Content.Server.Abilities.Mime ((Resolve(entity, ref physics, false) && (physics.CollisionLayer & (int) CollisionGroup.Impassable) != 0) // Is it impassable? && !(TryComp(entity, out var door) && door.State != DoorState.Closed))) // Is it a door that's open and so not actually impassable? { - _popupSystem.PopupEntity(Loc.GetString("mime-invisible-wall-failed"), uid, Filter.Entities(uid)); + _popupSystem.PopupEntity(Loc.GetString("mime-invisible-wall-failed"), uid, uid); return; } } - _popupSystem.PopupEntity(Loc.GetString("mime-invisible-wall-popup", ("mime", uid)), uid, Filter.Pvs(uid)); + _popupSystem.PopupEntity(Loc.GetString("mime-invisible-wall-popup", ("mime", uid)), uid); // Make sure we set the invisible wall to despawn properly Spawn(component.WallPrototype, coords); // Handle args so cooldown works @@ -119,7 +119,7 @@ namespace Content.Server.Abilities.Mime if (!mimePowers.ReadyToRepent) { - _popupSystem.PopupEntity(Loc.GetString("mime-not-ready-repent"), uid, Filter.Entities(uid)); + _popupSystem.PopupEntity(Loc.GetString("mime-not-ready-repent"), uid, uid); return; } diff --git a/Content.Server/Access/Systems/AgentIDCardSystem.cs b/Content.Server/Access/Systems/AgentIDCardSystem.cs index 697bb9db89..bf70cd75cc 100644 --- a/Content.Server/Access/Systems/AgentIDCardSystem.cs +++ b/Content.Server/Access/Systems/AgentIDCardSystem.cs @@ -39,15 +39,15 @@ namespace Content.Server.Access.Systems if (addedLength == 0) { - _popupSystem.PopupEntity(Loc.GetString("agent-id-no-new", ("card", args.Target)), args.Target.Value, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("agent-id-no-new", ("card", args.Target)), args.Target.Value, args.User); return; } else if (addedLength == 1) { - _popupSystem.PopupEntity(Loc.GetString("agent-id-new-1", ("card", args.Target)), args.Target.Value, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("agent-id-new-1", ("card", args.Target)), args.Target.Value, args.User); return; } - _popupSystem.PopupEntity(Loc.GetString("agent-id-new", ("number", addedLength), ("card", args.Target)), args.Target.Value, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("agent-id-new", ("number", addedLength), ("card", args.Target)), args.Target.Value, args.User); } private void AfterUIOpen(EntityUid uid, AgentIDCardComponent component, AfterActivatableUIOpenEvent args) diff --git a/Content.Server/Access/Systems/IdCardSystem.cs b/Content.Server/Access/Systems/IdCardSystem.cs index 716f16c3dd..ce69b4f912 100644 --- a/Content.Server/Access/Systems/IdCardSystem.cs +++ b/Content.Server/Access/Systems/IdCardSystem.cs @@ -44,7 +44,7 @@ namespace Content.Server.Access.Systems if (transformComponent != null) { _popupSystem.PopupCoordinates(Loc.GetString("id-card-component-microwave-burnt", ("id", uid)), - transformComponent.Coordinates, Filter.Pvs(uid), PopupType.Medium); + transformComponent.Coordinates, PopupType.Medium); EntityManager.SpawnEntity("FoodBadRecipe", transformComponent.Coordinates); } @@ -54,14 +54,12 @@ namespace Content.Server.Access.Systems // If they're unlucky, brick their ID if (randomPick <= 0.25f) { - _popupSystem.PopupEntity(Loc.GetString("id-card-component-microwave-bricked", ("id", uid)), - uid, Filter.Pvs(uid)); + _popupSystem.PopupEntity(Loc.GetString("id-card-component-microwave-bricked", ("id", uid)), uid); access.Tags.Clear(); } else { - _popupSystem.PopupEntity(Loc.GetString("id-card-component-microwave-safe", ("id", uid)), - uid, Filter.Pvs(uid), PopupType.Medium); + _popupSystem.PopupEntity(Loc.GetString("id-card-component-microwave-safe", ("id", uid)), uid, PopupType.Medium); } // Give them a wonderful new access to compensate for everything diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs index 970764591f..c5456b9e45 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs @@ -123,10 +123,10 @@ public sealed partial class AdminVerbSystem RemComp(args.Target); // So they can be dragged around. var xform = Transform(args.Target); _popupSystem.PopupEntity(Loc.GetString("admin-smite-chess-self"), args.Target, - Filter.Entities(args.Target), PopupType.LargeCaution); + args.Target, PopupType.LargeCaution); _popupSystem.PopupCoordinates( Loc.GetString("admin-smite-chess-others", ("name", args.Target)), xform.Coordinates, - Filter.PvsExcept(args.Target), PopupType.MediumCaution); + Filter.PvsExcept(args.Target), true, PopupType.MediumCaution); var board = Spawn("ChessBoard", xform.Coordinates); var session = _tabletopSystem.EnsureSession(Comp(board)); xform.Coordinates = EntityCoordinates.FromMap(_mapManager, session.Position); @@ -151,9 +151,9 @@ public sealed partial class AdminVerbSystem _flammableSystem.Ignite(args.Target); var xform = Transform(args.Target); _popupSystem.PopupEntity(Loc.GetString("admin-smite-set-alight-self"), args.Target, - Filter.Entities(args.Target), PopupType.LargeCaution); + args.Target, PopupType.LargeCaution); _popupSystem.PopupCoordinates(Loc.GetString("admin-smite-set-alight-others", ("name", args.Target)), xform.Coordinates, - Filter.PvsExcept(args.Target), PopupType.MediumCaution); + Filter.PvsExcept(args.Target), true, PopupType.MediumCaution); }, Impact = LogImpact.Extreme, Message = Loc.GetString("admin-smite-set-alight-description") @@ -285,9 +285,9 @@ public sealed partial class AdminVerbSystem _bloodstreamSystem.SpillAllSolutions(args.Target, bloodstream); var xform = Transform(args.Target); _popupSystem.PopupEntity(Loc.GetString("admin-smite-remove-blood-self"), args.Target, - Filter.Entities(args.Target), PopupType.LargeCaution); + args.Target, PopupType.LargeCaution); _popupSystem.PopupCoordinates(Loc.GetString("admin-smite-remove-blood-others", ("name", args.Target)), xform.Coordinates, - Filter.PvsExcept(args.Target), PopupType.MediumCaution); + Filter.PvsExcept(args.Target), true, PopupType.MediumCaution); }, Impact = LogImpact.Extreme, Message = Loc.GetString("admin-smite-remove-blood-description") @@ -318,9 +318,9 @@ public sealed partial class AdminVerbSystem } _popupSystem.PopupEntity(Loc.GetString("admin-smite-vomit-organs-self"), args.Target, - Filter.Entities(args.Target), PopupType.LargeCaution); + args.Target, PopupType.LargeCaution); _popupSystem.PopupCoordinates(Loc.GetString("admin-smite-vomit-organs-others", ("name", args.Target)), baseXform.Coordinates, - Filter.PvsExcept(args.Target), PopupType.MediumCaution); + Filter.PvsExcept(args.Target), true, PopupType.MediumCaution); }, Impact = LogImpact.Extreme, Message = Loc.GetString("admin-smite-vomit-organs-description") @@ -340,9 +340,9 @@ public sealed partial class AdminVerbSystem _bodySystem.DropPartAt(part.Id, baseXform.Coordinates, part.Component); } _popupSystem.PopupEntity(Loc.GetString("admin-smite-remove-hands-self"), args.Target, - Filter.Entities(args.Target), PopupType.LargeCaution); + args.Target, PopupType.LargeCaution); _popupSystem.PopupCoordinates(Loc.GetString("admin-smite-remove-hands-others", ("name", args.Target)), baseXform.Coordinates, - Filter.PvsExcept(args.Target), PopupType.Medium); + Filter.PvsExcept(args.Target), true, PopupType.Medium); }, Impact = LogImpact.Extreme, Message = Loc.GetString("admin-smite-remove-hands-description") @@ -363,9 +363,9 @@ public sealed partial class AdminVerbSystem break; } _popupSystem.PopupEntity(Loc.GetString("admin-smite-remove-hands-self"), args.Target, - Filter.Entities(args.Target), PopupType.LargeCaution); + args.Target, PopupType.LargeCaution); _popupSystem.PopupCoordinates(Loc.GetString("admin-smite-remove-hands-others", ("name", args.Target)), baseXform.Coordinates, - Filter.PvsExcept(args.Target), PopupType.Medium); + Filter.PvsExcept(args.Target), true, PopupType.Medium); }, Impact = LogImpact.Extreme, Message = Loc.GetString("admin-smite-remove-hand-description") @@ -385,7 +385,7 @@ public sealed partial class AdminVerbSystem } _popupSystem.PopupEntity(Loc.GetString("admin-smite-stomach-removal-self"), args.Target, - Filter.Entities(args.Target), PopupType.LargeCaution); + args.Target, PopupType.LargeCaution); }, Impact = LogImpact.Extreme, Message = Loc.GetString("admin-smite-stomach-removal-description"), @@ -405,7 +405,7 @@ public sealed partial class AdminVerbSystem } _popupSystem.PopupEntity(Loc.GetString("admin-smite-lung-removal-self"), args.Target, - Filter.Entities(args.Target), PopupType.LargeCaution); + args.Target, PopupType.LargeCaution); }, Impact = LogImpact.Extreme, Message = Loc.GetString("admin-smite-lung-removal-description"), @@ -616,8 +616,7 @@ public sealed partial class AdminVerbSystem { EntityManager.QueueDeleteEntity(args.Target); Spawn("Ash", Transform(args.Target).Coordinates); - _popupSystem.PopupEntity(Loc.GetString("admin-smite-turned-ash-other", ("name", args.Target)), args.Target, - Filter.Pvs(args.Target), PopupType.LargeCaution); + _popupSystem.PopupEntity(Loc.GetString("admin-smite-turned-ash-other", ("name", args.Target)), args.Target, PopupType.LargeCaution); }, Impact = LogImpact.Extreme, Message = Loc.GetString("admin-smite-dust-description"), @@ -768,7 +767,7 @@ public sealed partial class AdminVerbSystem Dirty(movementSpeed); _popupSystem.PopupEntity(Loc.GetString("admin-smite-run-walk-swap-prompt"), args.Target, - Filter.Entities(args.Target), PopupType.LargeCaution); + args.Target, PopupType.LargeCaution); }, Impact = LogImpact.Extreme, Message = Loc.GetString("admin-smite-run-walk-swap-description"), @@ -814,7 +813,7 @@ public sealed partial class AdminVerbSystem _movementSpeedModifierSystem?.ChangeBaseSpeed(args.Target, 400, 8000, 40, movementSpeed); _popupSystem.PopupEntity(Loc.GetString("admin-smite-super-speed-prompt"), args.Target, - Filter.Entities(args.Target), PopupType.LargeCaution); + args.Target, PopupType.LargeCaution); }, Impact = LogImpact.Extreme, Message = Loc.GetString("admin-smite-super-speed-description"), diff --git a/Content.Server/AirlockPainter/AirlockPainterSystem.cs b/Content.Server/AirlockPainter/AirlockPainterSystem.cs index 8924e54c58..f43f0080e8 100644 --- a/Content.Server/AirlockPainter/AirlockPainterSystem.cs +++ b/Content.Server/AirlockPainter/AirlockPainterSystem.cs @@ -76,7 +76,7 @@ namespace Content.Server.AirlockPainter if (!grp.StylePaths.TryGetValue(style, out var sprite)) { string msg = Loc.GetString("airlock-painter-style-not-available"); - _popupSystem.PopupEntity(msg, args.User, Filter.Entities(args.User)); + _popupSystem.PopupEntity(msg, args.User, args.User); return; } component.IsSpraying = true; diff --git a/Content.Server/Animals/Systems/EggLayerSystem.cs b/Content.Server/Animals/Systems/EggLayerSystem.cs index 32fdb0bc24..d8fde67497 100644 --- a/Content.Server/Animals/Systems/EggLayerSystem.cs +++ b/Content.Server/Animals/Systems/EggLayerSystem.cs @@ -1,4 +1,4 @@ -using Content.Server.Actions; +using Content.Server.Actions; using Content.Server.Animals.Components; using Content.Server.Nutrition.Components; using Content.Server.Popups; @@ -73,7 +73,7 @@ public sealed class EggLayerSystem : EntitySystem { if (hunger.CurrentHunger < component.HungerUsage) { - _popup.PopupEntity(Loc.GetString("action-popup-lay-egg-too-hungry"), uid, Filter.Entities(uid)); + _popup.PopupEntity(Loc.GetString("action-popup-lay-egg-too-hungry"), uid, uid); return false; } @@ -87,8 +87,8 @@ public sealed class EggLayerSystem : EntitySystem // Sound + popups SoundSystem.Play(component.EggLaySound.GetSound(), Filter.Pvs(uid), uid, component.EggLaySound.Params); - _popup.PopupEntity(Loc.GetString("action-popup-lay-egg-user"), uid, Filter.Entities(uid)); - _popup.PopupEntity(Loc.GetString("action-popup-lay-egg-others", ("entity", uid)), uid, Filter.PvsExcept(uid)); + _popup.PopupEntity(Loc.GetString("action-popup-lay-egg-user"), uid, uid); + _popup.PopupEntity(Loc.GetString("action-popup-lay-egg-others", ("entity", uid)), uid, Filter.PvsExcept(uid), true); return true; } diff --git a/Content.Server/Animals/Systems/UdderSystem.cs b/Content.Server/Animals/Systems/UdderSystem.cs index c0e5cbf469..d24cdd7cb7 100644 --- a/Content.Server/Animals/Systems/UdderSystem.cs +++ b/Content.Server/Animals/Systems/UdderSystem.cs @@ -68,7 +68,7 @@ namespace Content.Server.Animals.Systems if (udder.BeingMilked) { - _popupSystem.PopupEntity(Loc.GetString("udder-system-already-milking"), uid, Filter.Entities(userUid)); + _popupSystem.PopupEntity(Loc.GetString("udder-system-already-milking"), uid, userUid); return; } @@ -101,7 +101,7 @@ namespace Content.Server.Animals.Systems var quantity = solution.TotalVolume; if(quantity == 0) { - _popupSystem.PopupEntity(Loc.GetString("udder-system-dry"), uid, Filter.Entities(ev.UserUid)); + _popupSystem.PopupEntity(Loc.GetString("udder-system-dry"), uid, ev.UserUid); return; } @@ -112,7 +112,7 @@ namespace Content.Server.Animals.Systems _solutionContainerSystem.TryAddSolution(ev.ContainerUid, targetSolution, split); _popupSystem.PopupEntity(Loc.GetString("udder-system-success", ("amount", quantity), ("target", Identity.Entity(ev.ContainerUid, EntityManager))), uid, - Filter.Entities(ev.UserUid), PopupType.Medium); + ev.UserUid, PopupType.Medium); } private void OnMilkingFailed(EntityUid uid, UdderComponent component, MilkingFailEvent ev) diff --git a/Content.Server/Atmos/EntitySystems/GasAnalyzerSystem.cs b/Content.Server/Atmos/EntitySystems/GasAnalyzerSystem.cs index 6e9461e66e..3f3ca8d447 100644 --- a/Content.Server/Atmos/EntitySystems/GasAnalyzerSystem.cs +++ b/Content.Server/Atmos/EntitySystems/GasAnalyzerSystem.cs @@ -57,7 +57,7 @@ namespace Content.Server.Atmos.EntitySystems { if (!args.CanReach) { - _popup.PopupEntity(Loc.GetString("gas-analyzer-component-player-cannot-reach-message"), args.User, Filter.Entities(args.User)); + _popup.PopupEntity(Loc.GetString("gas-analyzer-component-player-cannot-reach-message"), args.User, args.User); return; } ActivateAnalyzer(uid, component, args.User, args.Target); @@ -99,7 +99,7 @@ namespace Content.Server.Atmos.EntitySystems private void OnDropped(EntityUid uid, GasAnalyzerComponent component, DroppedEvent args) { if(args.User is { } userId && component.Enabled) - _popup.PopupEntity(Loc.GetString("gas-analyzer-shutoff"), userId, Filter.Entities(userId)); + _popup.PopupEntity(Loc.GetString("gas-analyzer-shutoff"), userId, userId); DisableAnalyzer(uid, component, args.User); } @@ -160,7 +160,7 @@ namespace Content.Server.Atmos.EntitySystems if (!component.LastPosition.Value.InRange(EntityManager, userPos, SharedInteractionSystem.InteractionRange)) { if(component.User is { } userId && component.Enabled) - _popup.PopupEntity(Loc.GetString("gas-analyzer-shutoff"), userId, Filter.Entities(userId)); + _popup.PopupEntity(Loc.GetString("gas-analyzer-shutoff"), userId, userId); DisableAnalyzer(uid, component, component.User); return false; } diff --git a/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs b/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs index 8f15dc90e5..94ff71ba77 100644 --- a/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs +++ b/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs @@ -297,7 +297,7 @@ public sealed class AirAlarmSystem : EntitySystem if (!_accessSystem.IsAllowed(user.Value, reader)) { - _popup.PopupEntity(Loc.GetString("air-alarm-ui-access-denied"), user.Value, Filter.Entities(user.Value)); + _popup.PopupEntity(Loc.GetString("air-alarm-ui-access-denied"), user.Value, user.Value); return false; } diff --git a/Content.Server/Atmos/Piping/EntitySystems/AtmosUnsafeUnanchorSystem.cs b/Content.Server/Atmos/Piping/EntitySystems/AtmosUnsafeUnanchorSystem.cs index 296cebf6ac..84ac05a503 100644 --- a/Content.Server/Atmos/Piping/EntitySystems/AtmosUnsafeUnanchorSystem.cs +++ b/Content.Server/Atmos/Piping/EntitySystems/AtmosUnsafeUnanchorSystem.cs @@ -40,7 +40,7 @@ namespace Content.Server.Atmos.Piping.EntitySystems { args.Delay += 2f; _popup.PopupEntity(Loc.GetString("comp-atmos-unsafe-unanchor-warning"), pipe.Owner, - Filter.Entities(args.User), PopupType.MediumCaution); + args.User, PopupType.MediumCaution); return; // Show the warning only once. } } diff --git a/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs b/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs index 1d83bbb389..b1efbda7cd 100644 --- a/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs +++ b/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs @@ -113,7 +113,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems } else { - _popupSystem.PopupCursor(Loc.GetString("comp-gas-filter-ui-needs-anchor"), Filter.Entities(args.User)); + _popupSystem.PopupCursor(Loc.GetString("comp-gas-filter-ui-needs-anchor"), args.User); } args.Handled = true; diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs index ebcd4605f2..53735a53f0 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs @@ -228,7 +228,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems return; if (TryComp(uid, out var lockComponent) && lockComponent.Locked) { - _popupSystem.PopupEntity(Loc.GetString("gas-canister-popup-denied"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("gas-canister-popup-denied"), uid, args.User); if (component.AccessDeniedSound != null) _audioSys.PlayPvs(component.AccessDeniedSound, uid); return; diff --git a/Content.Server/Bed/Sleep/SleepingSystem.cs b/Content.Server/Bed/Sleep/SleepingSystem.cs index 1a774db397..b3f3efcb92 100644 --- a/Content.Server/Bed/Sleep/SleepingSystem.cs +++ b/Content.Server/Bed/Sleep/SleepingSystem.cs @@ -199,7 +199,7 @@ namespace Content.Server.Bed.Sleep if (user != null) { SoundSystem.Play("/Audio/Effects/thudswoosh.ogg", Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.05f, _robustRandom)); - _popupSystem.PopupEntity(Loc.GetString("wake-other-failure", ("target", Identity.Entity(uid, EntityManager))), uid, Filter.Entities(user.Value), Shared.Popups.PopupType.SmallCaution); + _popupSystem.PopupEntity(Loc.GetString("wake-other-failure", ("target", Identity.Entity(uid, EntityManager))), uid, user.Value, Shared.Popups.PopupType.SmallCaution); } return false; } @@ -207,7 +207,7 @@ namespace Content.Server.Bed.Sleep if (user != null) { SoundSystem.Play("/Audio/Effects/thudswoosh.ogg", Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.05f, _robustRandom)); - _popupSystem.PopupEntity(Loc.GetString("wake-other-success", ("target", Identity.Entity(uid, EntityManager))), uid, Filter.Entities(user.Value)); + _popupSystem.PopupEntity(Loc.GetString("wake-other-success", ("target", Identity.Entity(uid, EntityManager))), uid, user.Value); } RemComp(uid); return true; diff --git a/Content.Server/Bible/BibleSystem.cs b/Content.Server/Bible/BibleSystem.cs index 88dc339a79..4d58761fec 100644 --- a/Content.Server/Bible/BibleSystem.cs +++ b/Content.Server/Bible/BibleSystem.cs @@ -78,8 +78,7 @@ namespace Content.Server.Bible summonableComp.Summon = null; } summonableComp.AlreadySummoned = false; - _popupSystem.PopupEntity(Loc.GetString("bible-summon-respawn-ready", ("book", summonableComp.Owner)), summonableComp.Owner, - Filter.Pvs(summonableComp.Owner), PopupType.Medium); + _popupSystem.PopupEntity(Loc.GetString("bible-summon-respawn-ready", ("book", summonableComp.Owner)), summonableComp.Owner, PopupType.Medium); SoundSystem.Play("/Audio/Effects/radpulse9.ogg", Filter.Pvs(summonableComp.Owner), summonableComp.Owner, AudioParams.Default.WithVolume(-4f)); // Clean up the accumulator and respawn tracking component summonableComp.Accumulator = 0; @@ -104,7 +103,7 @@ namespace Content.Server.Bible if (!HasComp(args.User)) { - _popupSystem.PopupEntity(Loc.GetString("bible-sizzle"), args.User, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("bible-sizzle"), args.User, args.User); SoundSystem.Play(component.SizzleSoundPath.GetSound(), Filter.Pvs(args.User), args.User); _damageableSystem.TryChangeDamage(args.User, component.DamageOnUntrainedUse, true, origin: uid); @@ -119,10 +118,10 @@ namespace Content.Server.Bible if (_random.Prob(component.FailChance)) { var othersFailMessage = Loc.GetString(component.LocPrefix + "-heal-fail-others", ("user", Identity.Entity(args.User, EntityManager)),("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid)); - _popupSystem.PopupEntity(othersFailMessage, args.User, Filter.PvsExcept(args.User), PopupType.SmallCaution); + _popupSystem.PopupEntity(othersFailMessage, args.User, Filter.PvsExcept(args.User), true, PopupType.SmallCaution); var selfFailMessage = Loc.GetString(component.LocPrefix + "-heal-fail-self", ("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid)); - _popupSystem.PopupEntity(selfFailMessage, args.User, Filter.Entities(args.User), PopupType.MediumCaution); + _popupSystem.PopupEntity(selfFailMessage, args.User, args.User, PopupType.MediumCaution); SoundSystem.Play("/Audio/Effects/hit_kick.ogg", Filter.Pvs(args.Target.Value), args.User); _damageableSystem.TryChangeDamage(args.Target.Value, component.DamageOnFail, true, origin: uid); @@ -136,18 +135,18 @@ namespace Content.Server.Bible if (damage == null || damage.Total == 0) { var othersMessage = Loc.GetString(component.LocPrefix + "-heal-success-none-others", ("user", Identity.Entity(args.User, EntityManager)),("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid)); - _popupSystem.PopupEntity(othersMessage, args.User, Filter.PvsExcept(args.User), PopupType.Medium); + _popupSystem.PopupEntity(othersMessage, args.User, Filter.PvsExcept(args.User), true, PopupType.Medium); var selfMessage = Loc.GetString(component.LocPrefix + "-heal-success-none-self", ("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid)); - _popupSystem.PopupEntity(selfMessage, args.User, Filter.Entities(args.User), PopupType.Large); + _popupSystem.PopupEntity(selfMessage, args.User, args.User, PopupType.Large); } else { var othersMessage = Loc.GetString(component.LocPrefix + "-heal-success-others", ("user", Identity.Entity(args.User, EntityManager)),("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid)); - _popupSystem.PopupEntity(othersMessage, args.User, Filter.PvsExcept(args.User), PopupType.Medium); + _popupSystem.PopupEntity(othersMessage, args.User, Filter.PvsExcept(args.User), true, PopupType.Medium); var selfMessage = Loc.GetString(component.LocPrefix + "-heal-success-self", ("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid)); - _popupSystem.PopupEntity(selfMessage, args.User, Filter.Entities(args.User), PopupType.Large); + _popupSystem.PopupEntity(selfMessage, args.User, args.User, PopupType.Large); SoundSystem.Play(component.HealSoundPath.GetSound(), Filter.Pvs(args.Target.Value), args.User); _delay.BeginDelay(uid, delay); } @@ -235,7 +234,7 @@ namespace Content.Server.Bible // If this is going to use a ghost role mob spawner, attach it to the bible. if (HasComp(familiar)) { - _popupSystem.PopupEntity(Loc.GetString("bible-summon-requested"), user, Filter.Pvs(user), PopupType.Medium); + _popupSystem.PopupEntity(Loc.GetString("bible-summon-requested"), user, PopupType.Medium); Transform(familiar).AttachParent(component.Owner); } component.AlreadySummoned = true; diff --git a/Content.Server/Body/Systems/BloodstreamSystem.cs b/Content.Server/Body/Systems/BloodstreamSystem.cs index ed5671e35e..293b70fb6b 100644 --- a/Content.Server/Body/Systems/BloodstreamSystem.cs +++ b/Content.Server/Body/Systems/BloodstreamSystem.cs @@ -176,7 +176,7 @@ public sealed class BloodstreamSystem : EntitySystem // We'll play a special sound and popup for feedback. SoundSystem.Play(component.BloodHealedSound.GetSound(), Filter.Pvs(uid), uid, AudioParams.Default); _popupSystem.PopupEntity(Loc.GetString("bloodstream-component-wounds-cauterized"), uid, - Filter.Entities(uid), PopupType.Medium); + uid, PopupType.Medium); ; } } diff --git a/Content.Server/Body/Systems/InternalsSystem.cs b/Content.Server/Body/Systems/InternalsSystem.cs index 015b7ce4fe..a375f8e6f0 100644 --- a/Content.Server/Body/Systems/InternalsSystem.cs +++ b/Content.Server/Body/Systems/InternalsSystem.cs @@ -74,7 +74,7 @@ public sealed class InternalsSystem : EntitySystem // If they're not on then check if we have a mask to use if (internals.BreathToolEntity == null) { - _popupSystem.PopupEntity(Loc.GetString("internals-no-breath-tool"), uid, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString("internals-no-breath-tool"), uid, user); return; } @@ -82,7 +82,7 @@ public sealed class InternalsSystem : EntitySystem if (tank == null) { - _popupSystem.PopupEntity(Loc.GetString("internals-no-tank"), uid, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString("internals-no-tank"), uid, user); return; } diff --git a/Content.Server/Body/Systems/RespiratorSystem.cs b/Content.Server/Body/Systems/RespiratorSystem.cs index dd4232dab4..b9899145fb 100644 --- a/Content.Server/Body/Systems/RespiratorSystem.cs +++ b/Content.Server/Body/Systems/RespiratorSystem.cs @@ -77,7 +77,7 @@ namespace Content.Server.Body.Systems if (_gameTiming.CurTime >= respirator.LastGaspPopupTime + respirator.GaspPopupCooldown) { respirator.LastGaspPopupTime = _gameTiming.CurTime; - _popupSystem.PopupEntity(Loc.GetString("lung-behavior-gasp"), uid, Filter.Pvs(uid)); + _popupSystem.PopupEntity(Loc.GetString("lung-behavior-gasp"), uid); } TakeSuffocationDamage(uid, respirator); diff --git a/Content.Server/Botany/Systems/BotanySwabSystem.cs b/Content.Server/Botany/Systems/BotanySwabSystem.cs index 75caf351c7..f4417ed622 100644 --- a/Content.Server/Botany/Systems/BotanySwabSystem.cs +++ b/Content.Server/Botany/Systems/BotanySwabSystem.cs @@ -88,7 +88,7 @@ namespace Content.Server.Botany.Systems { // Pick up pollen args.Swab.SeedData = args.Plant.Seed; - _popupSystem.PopupEntity(Loc.GetString("botany-swab-from"), args.Target.Value, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("botany-swab-from"), args.Target.Value, args.User); } else { @@ -97,7 +97,7 @@ namespace Content.Server.Botany.Systems return; args.Plant.Seed = _mutationSystem.Cross(args.Swab.SeedData, old); // Cross-pollenate args.Swab.SeedData = old; // Transfer old plant pollen to swab - _popupSystem.PopupEntity(Loc.GetString("botany-swab-to"), args.Target.Value, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("botany-swab-to"), args.Target.Value, args.User); } if (args.Swab.CancelToken != null) diff --git a/Content.Server/Botany/Systems/BotanySystem.Seed.cs b/Content.Server/Botany/Systems/BotanySystem.Seed.cs index 47ebb97d4d..4818d00485 100644 --- a/Content.Server/Botany/Systems/BotanySystem.Seed.cs +++ b/Content.Server/Botany/Systems/BotanySystem.Seed.cs @@ -119,13 +119,11 @@ public sealed partial class BotanySystem : EntitySystem { if (proto.ProductPrototypes.Count == 0 || proto.Yield <= 0) { - _popupSystem.PopupCursor(Loc.GetString("botany-harvest-fail-message"), - Filter.Entities(user), PopupType.Medium); + _popupSystem.PopupCursor(Loc.GetString("botany-harvest-fail-message"), user, PopupType.Medium); return Enumerable.Empty(); } - _popupSystem.PopupCursor(Loc.GetString("botany-harvest-success-message", ("name", proto.DisplayName)), - Filter.Entities(user), PopupType.Medium); + _popupSystem.PopupCursor(Loc.GetString("botany-harvest-success-message", ("name", proto.DisplayName)), user, PopupType.Medium); return GenerateProduct(proto, Transform(user).Coordinates, yieldMod); } diff --git a/Content.Server/Botany/Systems/PlantHolderSystem.cs b/Content.Server/Botany/Systems/PlantHolderSystem.cs index 29a45fc0e3..db02ea77d2 100644 --- a/Content.Server/Botany/Systems/PlantHolderSystem.cs +++ b/Content.Server/Botany/Systems/PlantHolderSystem.cs @@ -136,7 +136,7 @@ namespace Content.Server.Botany.Systems _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-plant-success-message", ("seedName", seed.Name), - ("seedNoun", seed.Noun)), Filter.Entities(args.User), PopupType.Medium); + ("seedNoun", seed.Noun)), args.User, PopupType.Medium); component.Seed = seed; component.Dead = false; @@ -153,7 +153,7 @@ namespace Content.Server.Botany.Systems } _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-already-seeded-message", - ("name", Comp(uid).EntityName)), Filter.Entities(args.User), PopupType.Medium); + ("name", Comp(uid).EntityName)), args.User, PopupType.Medium); return; } @@ -162,15 +162,15 @@ namespace Content.Server.Botany.Systems if (component.WeedLevel > 0) { _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-remove-weeds-message", - ("name", Comp(uid).EntityName)), Filter.Entities(args.User), PopupType.Medium); + ("name", Comp(uid).EntityName)), args.User, PopupType.Medium); _popupSystem.PopupEntity(Loc.GetString("plant-holder-component-remove-weeds-others-message", - ("otherName", Comp(args.User).EntityName)), uid, Filter.PvsExcept(args.User)); + ("otherName", Comp(args.User).EntityName)), uid, Filter.PvsExcept(args.User), true); component.WeedLevel = 0; UpdateSprite(uid, component); } else { - _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-no-weeds-message"), Filter.Entities(args.User)); + _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-no-weeds-message"), args.User); } return; @@ -181,15 +181,15 @@ namespace Content.Server.Botany.Systems if (component.Seed != null) { _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-remove-plant-message", - ("name", Comp(uid).EntityName)), Filter.Entities(args.User), PopupType.Medium); + ("name", Comp(uid).EntityName)), args.User, PopupType.Medium); _popupSystem.PopupEntity(Loc.GetString("plant-holder-component-remove-plant-others-message", - ("name", Comp(args.User).EntityName)), uid, Filter.PvsExcept(args.User)); + ("name", Comp(args.User).EntityName)), uid, Filter.PvsExcept(args.User), true); RemovePlant(uid, component); } else { _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-no-plant-message", - ("name", Comp(uid).EntityName)), Filter.Entities(args.User)); + ("name", Comp(uid).EntityName)), args.User); } return; @@ -211,13 +211,13 @@ namespace Content.Server.Botany.Systems if (split.TotalVolume == 0) { _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-no-plant-message", - ("owner", args.Used)), Filter.Entities(args.User)); + ("owner", args.Used)), args.User); return; } _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-spray-message", ("owner", uid), - ("amount", split.TotalVolume)), Filter.Entities(args.User), PopupType.Medium); + ("amount", split.TotalVolume)), args.User, PopupType.Medium); _solutionSystem.TryAddSolution(targetEntity, targetSolution, split); @@ -230,19 +230,19 @@ namespace Content.Server.Botany.Systems { if (component.Seed == null) { - _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-nothing-to-sample-message"), Filter.Entities(args.User)); + _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-nothing-to-sample-message"), args.User); return; } if (component.Sampled) { - _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-already-sampled-message"), Filter.Entities(args.User)); + _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-already-sampled-message"), args.User); return; } if (component.Dead) { - _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-dead-plant-message"), Filter.Entities(args.User)); + _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-dead-plant-message"), args.User); return; } @@ -250,7 +250,7 @@ namespace Content.Server.Botany.Systems var seed = _botanySystem.SpawnSeedPacket(component.Seed, Transform(args.User).Coordinates); seed.RandomOffset(0.25f); _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-take-sample-message", - ("seedName", component.Seed.DisplayName)), Filter.Entities(args.User)); + ("seedName", component.Seed.DisplayName)), args.User); component.Health -= (_random.Next(3, 5) * 10); if (_random.Prob(0.3f)) @@ -270,11 +270,11 @@ namespace Content.Server.Botany.Systems { _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-compost-message", ("owner", uid), - ("usingItem", args.Used)), Filter.Entities(args.User), PopupType.Medium); + ("usingItem", args.Used)), args.User, PopupType.Medium); _popupSystem.PopupEntity(Loc.GetString("plant-holder-component-compost-others-message", ("user", Identity.Entity(args.User, EntityManager)), ("usingItem", args.Used), - ("owner", uid)), uid, Filter.PvsExcept(args.User)); + ("owner", uid)), uid, Filter.PvsExcept(args.User), true); if (_solutionSystem.TryGetSolution(args.Used, produce.SolutionName, out var solution2)) { diff --git a/Content.Server/Botany/Systems/SeedExtractorSystem.cs b/Content.Server/Botany/Systems/SeedExtractorSystem.cs index ada0603864..d7047fdce6 100644 --- a/Content.Server/Botany/Systems/SeedExtractorSystem.cs +++ b/Content.Server/Botany/Systems/SeedExtractorSystem.cs @@ -33,12 +33,12 @@ public sealed class SeedExtractorSystem : EntitySystem if (!_botanySystem.TryGetSeed(produce, out var seed) || seed.Seedless) { _popupSystem.PopupCursor(Loc.GetString("seed-extractor-component-no-seeds",("name", args.Used)), - Filter.Entities(args.User), PopupType.MediumCaution); + args.User, PopupType.MediumCaution); return; } _popupSystem.PopupCursor(Loc.GetString("seed-extractor-component-interact-message",("name", args.Used)), - Filter.Entities(args.User), PopupType.Medium); + args.User, PopupType.Medium); QueueDel(args.Used); diff --git a/Content.Server/Buckle/Systems/BuckleSystem.Buckle.cs b/Content.Server/Buckle/Systems/BuckleSystem.Buckle.cs index 62cd0a7d9f..b63ca679bb 100644 --- a/Content.Server/Buckle/Systems/BuckleSystem.Buckle.cs +++ b/Content.Server/Buckle/Systems/BuckleSystem.Buckle.cs @@ -187,7 +187,7 @@ public sealed partial class BuckleSystem if (!HasComp(user)) { - _popups.PopupEntity(Loc.GetString("buckle-component-no-hands-message"), user, Filter.Entities(user)); + _popups.PopupEntity(Loc.GetString("buckle-component-no-hands-message"), user, user); return false; } @@ -197,7 +197,7 @@ public sealed partial class BuckleSystem ? "buckle-component-already-buckled-message" : "buckle-component-other-already-buckled-message", ("owner", Identity.Entity(buckleId, EntityManager))); - _popups.PopupEntity(message, user, Filter.Entities(user)); + _popups.PopupEntity(message, user, user); return false; } @@ -210,7 +210,7 @@ public sealed partial class BuckleSystem var message = Loc.GetString(buckleId == user ? "buckle-component-cannot-buckle-message" : "buckle-component-other-cannot-buckle-message", ("owner", Identity.Entity(buckleId, EntityManager))); - _popups.PopupEntity(message, user, Filter.Entities(user)); + _popups.PopupEntity(message, user, user); return false; } @@ -223,7 +223,7 @@ public sealed partial class BuckleSystem var message = Loc.GetString(buckleId == user ? "buckle-component-cannot-fit-message" : "buckle-component-other-cannot-fit-message", ("owner", Identity.Entity(buckleId, EntityManager))); - _popups.PopupEntity(message, user, Filter.Entities(user)); + _popups.PopupEntity(message, user, user); return false; } @@ -246,7 +246,7 @@ public sealed partial class BuckleSystem var message = Loc.GetString(buckleId == user ? "buckle-component-cannot-buckle-message" : "buckle-component-other-cannot-buckle-message", ("owner", Identity.Entity(buckleId, EntityManager))); - _popups.PopupEntity(message, user, Filter.Entities(user)); + _popups.PopupEntity(message, user, user); return false; } diff --git a/Content.Server/Cargo/Systems/CargoSystem.Orders.cs b/Content.Server/Cargo/Systems/CargoSystem.Orders.cs index 0ae1c6765d..60763a2e97 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.Orders.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.Orders.cs @@ -229,10 +229,7 @@ namespace Content.Server.Cargo.Systems _uiSystem.GetUiOrNull(component.Owner, CargoConsoleUiKey.Orders)?.SetState(state); } - private void ConsolePopup(ICommonSession session, string text) - { - _popup.PopupCursor(text, Filter.SinglePlayer(session)); - } + private void ConsolePopup(ICommonSession session, string text) => _popup.PopupCursor(text, session); private void PlayDenySound(EntityUid uid, CargoOrderConsoleComponent component) { diff --git a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs index 9dc76e424e..0887fc56c8 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs @@ -499,19 +499,19 @@ public sealed partial class CargoSystem if (!TryComp(orderDatabase.Shuttle, out var shuttle)) { - _popup.PopupEntity(Loc.GetString("cargo-no-shuttle"), args.Entity, Filter.Entities(args.Entity)); + _popup.PopupEntity(Loc.GetString("cargo-no-shuttle"), args.Entity, args.Entity); return; } if (!_shuttle.CanFTL(shuttle.Owner, out var reason)) { - _popup.PopupEntity(reason, args.Entity, Filter.Entities(args.Entity)); + _popup.PopupEntity(reason, args.Entity, args.Entity); return; } if (IsBlocked(shuttle)) { - _popup.PopupEntity(Loc.GetString("cargo-shuttle-console-organics"), player.Value, Filter.Entities(player.Value)); + _popup.PopupEntity(Loc.GetString("cargo-shuttle-console-organics"), player.Value, player.Value); SoundSystem.Play(component.DenySound.GetSound(), Filter.Pvs(uid, entityManager: EntityManager), uid); return; }; diff --git a/Content.Server/Cargo/Systems/PriceGunSystem.cs b/Content.Server/Cargo/Systems/PriceGunSystem.cs index 6e3b5dd214..39d836b791 100644 --- a/Content.Server/Cargo/Systems/PriceGunSystem.cs +++ b/Content.Server/Cargo/Systems/PriceGunSystem.cs @@ -39,7 +39,7 @@ public sealed class PriceGunSystem : EntitySystem { Act = () => { - _popupSystem.PopupEntity(Loc.GetString("price-gun-pricing-result", ("object", Identity.Entity(args.Target, EntityManager)), ("price", $"{price:F2}")), args.User, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("price-gun-pricing-result", ("object", Identity.Entity(args.Target, EntityManager)), ("price", $"{price:F2}")), args.User, args.User); _useDelay.BeginDelay(uid, useDelay); }, Text = Loc.GetString("price-gun-verb-text"), @@ -58,7 +58,7 @@ public sealed class PriceGunSystem : EntitySystem var price = _pricingSystem.GetPrice(args.Target.Value); - _popupSystem.PopupEntity(Loc.GetString("price-gun-pricing-result", ("object", Identity.Entity(args.Target.Value, EntityManager)), ("price", $"{price:F2}")), args.User, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("price-gun-pricing-result", ("object", Identity.Entity(args.Target.Value, EntityManager)), ("price", $"{price:F2}")), args.User, args.User); _useDelay.BeginDelay(uid, useDelay); } } diff --git a/Content.Server/CartridgeLoader/Cartridges/NetProbeCartridgeSystem.cs b/Content.Server/CartridgeLoader/Cartridges/NetProbeCartridgeSystem.cs index 753baade28..b115e658bb 100644 --- a/Content.Server/CartridgeLoader/Cartridges/NetProbeCartridgeSystem.cs +++ b/Content.Server/CartridgeLoader/Cartridges/NetProbeCartridgeSystem.cs @@ -1,4 +1,4 @@ -using Content.Server.DeviceNetwork; +using Content.Server.DeviceNetwork; using Content.Server.DeviceNetwork.Components; using Content.Shared.CartridgeLoader; using Content.Shared.CartridgeLoader.Cartridges; @@ -51,7 +51,7 @@ public sealed class NetProbeCartridgeSystem : EntitySystem //Why is there no NextFloat(float min, float max)??? var audioParams = AudioParams.Default.WithVolume(-2f).WithPitchScale((float)_random.Next(12, 21) / 10); _audioSystem.PlayEntity(component.SoundScan, args.InteractEvent.User, target, audioParams); - _popupSystem.PopupCursor(Loc.GetString("net-probe-scan", ("device", target)), Filter.Entities(args.InteractEvent.User)); + _popupSystem.PopupCursor(Loc.GetString("net-probe-scan", ("device", target)), args.InteractEvent.User); //Limit the amount of saved probe results to 9 diff --git a/Content.Server/Chat/Systems/ChatSystem.Radio.cs b/Content.Server/Chat/Systems/ChatSystem.Radio.cs index e6f56a3229..f09e6ae2c8 100644 --- a/Content.Server/Chat/Systems/ChatSystem.Radio.cs +++ b/Content.Server/Chat/Systems/ChatSystem.Radio.cs @@ -72,7 +72,7 @@ public sealed partial class ChatSystem if (channel == null) { - _popup.PopupEntity(Loc.GetString("chat-manager-no-such-channel"), source, Filter.Entities(source)); + _popup.PopupEntity(Loc.GetString("chat-manager-no-such-channel"), source, source); channel = null; } @@ -83,7 +83,7 @@ public sealed partial class ChatSystem if (!hasHeadset && !HasComp(source)) { - _popup.PopupEntity(Loc.GetString("chat-manager-no-headset-on-message"), source, Filter.Entities(source)); + _popup.PopupEntity(Loc.GetString("chat-manager-no-headset-on-message"), source, source); } return (message, channel); diff --git a/Content.Server/Chemistry/EntitySystems/ChemMasterSystem.cs b/Content.Server/Chemistry/EntitySystems/ChemMasterSystem.cs index ed09346183..966cf8b6e9 100644 --- a/Content.Server/Chemistry/EntitySystems/ChemMasterSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/ChemMasterSystem.cs @@ -288,17 +288,18 @@ namespace Content.Server.Chemistry.EntitySystems return false; } - var filter = user.HasValue ? Filter.Entities(user.Value) : Filter.Empty(); if (solution.TotalVolume == 0) { - _popupSystem.PopupCursor(Loc.GetString("chem-master-window-buffer-empty-text"), filter); + if (user.HasValue) + _popupSystem.PopupCursor(Loc.GetString("chem-master-window-buffer-empty-text"), user.Value); return false; } // ReSharper disable once InvertIf if (neededVolume > solution.CurrentVolume) { - _popupSystem.PopupCursor(Loc.GetString("chem-master-window-buffer-low-text"), filter); + if (user.HasValue) + _popupSystem.PopupCursor(Loc.GetString("chem-master-window-buffer-low-text"), user.Value); return false; } diff --git a/Content.Server/Chemistry/EntitySystems/ChemistrySystem.Injector.cs b/Content.Server/Chemistry/EntitySystems/ChemistrySystem.Injector.cs index 9899356e2f..0d4606d4ee 100644 --- a/Content.Server/Chemistry/EntitySystems/ChemistrySystem.Injector.cs +++ b/Content.Server/Chemistry/EntitySystems/ChemistrySystem.Injector.cs @@ -105,7 +105,7 @@ public sealed partial class ChemistrySystem else { _popup.PopupEntity(Loc.GetString("injector-component-cannot-transfer-message", - ("target", Identity.Entity(target, EntityManager))), component.Owner, Filter.Entities(user)); + ("target", Identity.Entity(target, EntityManager))), component.Owner, user); } } else if (component.ToggleState == SharedInjectorComponent.InjectorToggleMode.Draw) @@ -125,7 +125,7 @@ public sealed partial class ChemistrySystem else { _popup.PopupEntity(Loc.GetString("injector-component-cannot-draw-message", - ("target", Identity.Entity(target, EntityManager))), component.Owner, Filter.Entities(user)); + ("target", Identity.Entity(target, EntityManager))), component.Owner, user); } } } @@ -226,7 +226,7 @@ public sealed partial class ChemistrySystem throw new ArgumentOutOfRangeException(); } - _popup.PopupEntity(Loc.GetString(msg), component.Owner, Filter.Entities(user)); + _popup.PopupEntity(Loc.GetString(msg), component.Owner, user); } /// @@ -235,7 +235,7 @@ public sealed partial class ChemistrySystem private void InjectDoAfter(InjectorComponent component, EntityUid user, EntityUid target) { // Create a pop-up for the user - _popup.PopupEntity(Loc.GetString("injector-component-injecting-user"), target, Filter.Entities(user)); + _popup.PopupEntity(Loc.GetString("injector-component-injecting-user"), target, user); if (!_solutions.TryGetSolution(component.Owner, InjectorComponent.SolutionName, out var solution)) return; @@ -250,7 +250,7 @@ public sealed partial class ChemistrySystem // Create a pop-up for the target var userName = Identity.Entity(user, EntityManager); _popup.PopupEntity(Loc.GetString("injector-component-injecting-target", - ("user", userName)), user, Filter.Entities(target)); + ("user", userName)), user, target); // Check if the target is incapacitated or in combat mode and modify time accordingly. if (_mobState.IsIncapacitated(target)) @@ -311,7 +311,7 @@ public sealed partial class ChemistrySystem if (realTransferAmount <= 0) { _popup.PopupEntity(Loc.GetString("injector-component-cannot-inject-message", ("target", Identity.Entity(targetBloodstream.Owner, EntityManager))), - component.Owner, Filter.Entities(user)); + component.Owner, user); return; } @@ -324,7 +324,7 @@ public sealed partial class ChemistrySystem _popup.PopupEntity(Loc.GetString("injector-component-inject-success-message", ("amount", removedSolution.TotalVolume), - ("target", Identity.Entity(targetBloodstream.Owner, EntityManager))), component.Owner, Filter.Entities(user)); + ("target", Identity.Entity(targetBloodstream.Owner, EntityManager))), component.Owner, user); Dirty(component); AfterInject(component); @@ -344,7 +344,7 @@ public sealed partial class ChemistrySystem if (realTransferAmount <= 0) { _popup.PopupEntity(Loc.GetString("injector-component-target-already-full-message", ("target", Identity.Entity(targetEntity, EntityManager))), - component.Owner, Filter.Entities(user)); + component.Owner, user); return; } @@ -364,7 +364,7 @@ public sealed partial class ChemistrySystem _popup.PopupEntity(Loc.GetString("injector-component-transfer-success-message", ("amount", removedSolution.TotalVolume), - ("target", Identity.Entity(targetEntity, EntityManager))), component.Owner, Filter.Entities(user)); + ("target", Identity.Entity(targetEntity, EntityManager))), component.Owner, user); Dirty(component); AfterInject(component); @@ -404,7 +404,7 @@ public sealed partial class ChemistrySystem if (realTransferAmount <= 0) { _popup.PopupEntity(Loc.GetString("injector-component-target-is-empty-message", ("target", Identity.Entity(targetEntity, EntityManager))), - component.Owner, Filter.Entities(user)); + component.Owner, user); return; } @@ -425,7 +425,7 @@ public sealed partial class ChemistrySystem _popup.PopupEntity(Loc.GetString("injector-component-draw-success-message", ("amount", removedSolution.TotalVolume), - ("target", Identity.Entity(targetEntity, EntityManager))), component.Owner, Filter.Entities(user)); + ("target", Identity.Entity(targetEntity, EntityManager))), component.Owner, user); Dirty(component); AfterDraw(component); @@ -450,7 +450,7 @@ public sealed partial class ChemistrySystem _popup.PopupEntity(Loc.GetString("injector-component-draw-success-message", ("amount", transferAmount), - ("target", Identity.Entity(target, EntityManager))), component.Owner, Filter.Entities(user)); + ("target", Identity.Entity(target, EntityManager))), component.Owner, user); Dirty(component); AfterDraw(component); diff --git a/Content.Server/Chemistry/EntitySystems/ChemistrySystemHypospray.cs b/Content.Server/Chemistry/EntitySystems/ChemistrySystemHypospray.cs index c4ba91d79a..9a040bf652 100644 --- a/Content.Server/Chemistry/EntitySystems/ChemistrySystemHypospray.cs +++ b/Content.Server/Chemistry/EntitySystems/ChemistrySystemHypospray.cs @@ -79,21 +79,21 @@ namespace Content.Server.Chemistry.EntitySystems if (hypoSpraySolution == null || hypoSpraySolution.CurrentVolume == 0) { - _popup.PopupCursor(Loc.GetString("hypospray-component-empty-message"), Filter.Entities(user)); + _popup.PopupCursor(Loc.GetString("hypospray-component-empty-message"), user); return true; } if (!_solutions.TryGetInjectableSolution(target.Value, out var targetSolution)) { - _popup.PopupCursor(Loc.GetString("hypospray-cant-inject", ("target", Identity.Entity(target.Value, _entMan))), Filter.Entities(user)); + _popup.PopupCursor(Loc.GetString("hypospray-cant-inject", ("target", Identity.Entity(target.Value, _entMan))), user); return false; } - _popup.PopupCursor(Loc.GetString(msgFormat ?? "hypospray-component-inject-other-message", ("other", target)), Filter.Entities(user)); + _popup.PopupCursor(Loc.GetString(msgFormat ?? "hypospray-component-inject-other-message", ("other", target)), user); if (target != user) { - _popup.PopupCursor(Loc.GetString("hypospray-component-feel-prick-message"), Filter.Entities(target.Value)); + _popup.PopupCursor(Loc.GetString("hypospray-component-feel-prick-message"), target.Value); var meleeSys = EntitySystem.Get(); var angle = Angle.FromWorldVec(_entMan.GetComponent(target.Value).WorldPosition - _entMan.GetComponent(user).WorldPosition); // TODO: This should just be using melee attacks... @@ -107,7 +107,7 @@ namespace Content.Server.Chemistry.EntitySystems if (realTransferAmount <= 0) { - _popup.PopupCursor(Loc.GetString("hypospray-component-transfer-already-full-message",("owner", target)), Filter.Entities(user)); + _popup.PopupCursor(Loc.GetString("hypospray-component-transfer-already-full-message",("owner", target)), user); return true; } diff --git a/Content.Server/Chemistry/EntitySystems/SolutionSpikableSystem.cs b/Content.Server/Chemistry/EntitySystems/SolutionSpikableSystem.cs index b36a5bb336..1db956e30a 100644 --- a/Content.Server/Chemistry/EntitySystems/SolutionSpikableSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/SolutionSpikableSystem.cs @@ -56,7 +56,7 @@ public sealed class SolutionSpikableSystem : EntitySystem if (targetSolution.CurrentVolume == 0 && !spikableSource.IgnoreEmpty) { - _popupSystem.PopupEntity(Loc.GetString(spikableSource.PopupEmpty, ("spiked-entity", target), ("spike-entity", source)), user, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString(spikableSource.PopupEmpty, ("spiked-entity", target), ("spike-entity", source)), user, user); return; } @@ -71,7 +71,7 @@ public sealed class SolutionSpikableSystem : EntitySystem RaiseLocalEvent(target, new SolutionSpikeOverflowEvent(overflow)); } - _popupSystem.PopupEntity(Loc.GetString(spikableSource.Popup, ("spiked-entity", target), ("spike-entity", source)), user, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString(spikableSource.Popup, ("spiked-entity", target), ("spike-entity", source)), user, user); sourceSolution.RemoveAllSolution(); diff --git a/Content.Server/Chemistry/ReagentEffects/PopupMessage.cs b/Content.Server/Chemistry/ReagentEffects/PopupMessage.cs index e13985a22f..15e12046e2 100644 --- a/Content.Server/Chemistry/ReagentEffects/PopupMessage.cs +++ b/Content.Server/Chemistry/ReagentEffects/PopupMessage.cs @@ -1,4 +1,4 @@ -using Content.Shared.Chemistry.Reagent; +using Content.Shared.Chemistry.Reagent; using Content.Shared.Popups; using Robust.Shared.Player; using Robust.Shared.Random; @@ -27,9 +27,9 @@ namespace Content.Server.Chemistry.ReagentEffects ("organ", args.OrganEntity.GetValueOrDefault()), }; if (Type == PopupRecipients.Local) - popupSys.PopupEntity(Loc.GetString(msg, msgArgs), args.SolutionEntity, Filter.Entities(args.SolutionEntity), VisualType); + popupSys.PopupEntity(Loc.GetString(msg, msgArgs), args.SolutionEntity, args.SolutionEntity, VisualType); else if (Type == PopupRecipients.Pvs) - popupSys.PopupEntity(Loc.GetString(msg, msgArgs), args.SolutionEntity, Filter.Pvs(args.SolutionEntity), VisualType); + popupSys.PopupEntity(Loc.GetString(msg, msgArgs), args.SolutionEntity, VisualType); } } diff --git a/Content.Server/Climbing/ClimbSystem.cs b/Content.Server/Climbing/ClimbSystem.cs index 015cd28eee..c952f0526d 100644 --- a/Content.Server/Climbing/ClimbSystem.cs +++ b/Content.Server/Climbing/ClimbSystem.cs @@ -79,7 +79,7 @@ public sealed class ClimbSystem : SharedClimbSystem : CanVault(component, args.User, args.Dragged, args.Target, out reason); if (!canVault) - _popupSystem.PopupEntity(reason, args.User, Filter.Entities(args.User)); + _popupSystem.PopupEntity(reason, args.User, args.User); args.CanDrop = canVault; args.Handled = true; @@ -368,7 +368,7 @@ public sealed class ClimbSystem : SharedClimbSystem // Not shown to the user, since they already get a 'you climb on the glass table' popup _popupSystem.PopupEntity( Loc.GetString("glass-table-shattered-others", ("table", uid), ("climber", Identity.Entity(args.Climber, EntityManager))), args.Climber, - Filter.Pvs(uid).RemoveWhereAttachedEntity(puid => puid == args.Climber)); + Filter.PvsExcept(args.Climber), true); } /// diff --git a/Content.Server/Clothing/MaskSystem.cs b/Content.Server/Clothing/MaskSystem.cs index d01344368e..917418c694 100644 --- a/Content.Server/Clothing/MaskSystem.cs +++ b/Content.Server/Clothing/MaskSystem.cs @@ -59,9 +59,9 @@ namespace Content.Server.Clothing _identity.QueueIdentityUpdate(args.Performer); if (mask.IsToggled) - _popupSystem.PopupEntity(Loc.GetString("action-mask-pull-down-popup-message", ("mask", mask.Owner)), args.Performer, Filter.Entities(args.Performer)); + _popupSystem.PopupEntity(Loc.GetString("action-mask-pull-down-popup-message", ("mask", mask.Owner)), args.Performer, args.Performer); else - _popupSystem.PopupEntity(Loc.GetString("action-mask-pull-up-popup-message", ("mask", mask.Owner)), args.Performer, Filter.Entities(args.Performer)); + _popupSystem.PopupEntity(Loc.GetString("action-mask-pull-up-popup-message", ("mask", mask.Owner)), args.Performer, args.Performer); ToggleMaskComponents(uid, mask, args.Performer); } diff --git a/Content.Server/Communications/CommunicationsConsoleSystem.cs b/Content.Server/Communications/CommunicationsConsoleSystem.cs index 11e49c5f4f..23dc79b648 100644 --- a/Content.Server/Communications/CommunicationsConsoleSystem.cs +++ b/Content.Server/Communications/CommunicationsConsoleSystem.cs @@ -208,7 +208,7 @@ namespace Content.Server.Communications if (message.Session.AttachedEntity is not {Valid: true} mob) return; if (!CanUse(mob, uid)) { - _popupSystem.PopupCursor(Loc.GetString("comms-console-permission-denied"), Filter.Entities(mob), PopupType.Medium); + _popupSystem.PopupCursor(Loc.GetString("comms-console-permission-denied"), message.Session, PopupType.Medium); return; } @@ -233,7 +233,7 @@ namespace Content.Server.Communications if (!CanUse(mob, uid)) { - _popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, Filter.Entities(mob)); + _popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, message.Session); return; } @@ -272,7 +272,7 @@ namespace Content.Server.Communications if (message.Session.AttachedEntity is not {Valid: true} mob) return; if (!CanUse(mob, uid)) { - _popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, Filter.Entities(mob)); + _popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, message.Session); return; } _roundEndSystem.RequestRoundEnd(uid); @@ -285,7 +285,7 @@ namespace Content.Server.Communications if (message.Session.AttachedEntity is not {Valid: true} mob) return; if (!CanUse(mob, uid)) { - _popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, Filter.Entities(mob)); + _popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, message.Session); return; } diff --git a/Content.Server/Construction/AnchorableSystem.cs b/Content.Server/Construction/AnchorableSystem.cs index cfe8e5ea81..138e73261a 100644 --- a/Content.Server/Construction/AnchorableSystem.cs +++ b/Content.Server/Construction/AnchorableSystem.cs @@ -56,7 +56,7 @@ namespace Content.Server.Construction xform.Anchored = false; RaiseLocalEvent(uid, new UserUnanchoredEvent(args.User, args.Using)); - _popup.PopupEntity(Loc.GetString("anchorable-unanchored"), uid, Filter.Pvs(uid, entityManager: EntityManager)); + _popup.PopupEntity(Loc.GetString("anchorable-unanchored"), uid); _adminLogger.Add( LogType.Unanchor, @@ -77,7 +77,7 @@ namespace Content.Server.Construction if (TryComp(uid, out var anchorBody) && !TileFree(xform.Coordinates, anchorBody)) { - _popup.PopupEntity(Loc.GetString("anchorable-occupied"), uid, Filter.Entities(args.User)); + _popup.PopupEntity(Loc.GetString("anchorable-occupied"), uid, args.User); return; } @@ -98,7 +98,7 @@ namespace Content.Server.Construction xform.Anchored = true; RaiseLocalEvent(uid, new UserAnchoredEvent(args.User, args.Using)); - _popup.PopupEntity(Loc.GetString("anchorable-anchored"), uid, Filter.Pvs(uid, entityManager: EntityManager)); + _popup.PopupEntity(Loc.GetString("anchorable-anchored"), uid); _adminLogger.Add( LogType.Anchor, @@ -190,7 +190,7 @@ namespace Content.Server.Construction if (TryComp(uid, out var anchorBody) && !TileFree(transform.Coordinates, anchorBody)) { - _popup.PopupEntity(Loc.GetString("anchorable-occupied"), uid, Filter.Entities(userUid)); + _popup.PopupEntity(Loc.GetString("anchorable-occupied"), uid, userUid); return; } diff --git a/Content.Server/Construction/Completions/PopupEveryone.cs b/Content.Server/Construction/Completions/PopupEveryone.cs index 97837b575d..08424c1c0d 100644 --- a/Content.Server/Construction/Completions/PopupEveryone.cs +++ b/Content.Server/Construction/Completions/PopupEveryone.cs @@ -12,7 +12,7 @@ namespace Content.Server.Construction.Completions public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) { entityManager.EntitySysManager.GetEntitySystem() - .PopupEntity(Loc.GetString(Text), uid, Filter.Pvs(uid, entityManager:entityManager)); + .PopupEntity(Loc.GetString(Text), uid); } } } diff --git a/Content.Server/Construction/Completions/PopupUser.cs b/Content.Server/Construction/Completions/PopupUser.cs index f975fec3a6..0f598d263f 100644 --- a/Content.Server/Construction/Completions/PopupUser.cs +++ b/Content.Server/Construction/Completions/PopupUser.cs @@ -1,4 +1,4 @@ -using Content.Server.Popups; +using Content.Server.Popups; using Content.Shared.Construction; using JetBrains.Annotations; using Robust.Shared.Player; @@ -20,9 +20,9 @@ namespace Content.Server.Construction.Completions var popupSystem = entityManager.EntitySysManager.GetEntitySystem(); if(Cursor) - popupSystem.PopupCursor(Loc.GetString(Text), Filter.Entities(userUid.Value)); + popupSystem.PopupCursor(Loc.GetString(Text), userUid.Value); else - popupSystem.PopupEntity(Loc.GetString(Text), uid, Filter.Entities(userUid.Value)); + popupSystem.PopupEntity(Loc.GetString(Text), uid, userUid.Value); } } } diff --git a/Content.Server/Construction/ConstructionSystem.Guided.cs b/Content.Server/Construction/ConstructionSystem.Guided.cs index 7e28110755..8c59706d0f 100644 --- a/Content.Server/Construction/ConstructionSystem.Guided.cs +++ b/Content.Server/Construction/ConstructionSystem.Guided.cs @@ -52,11 +52,11 @@ namespace Content.Server.Construction if (component.TargetNode == null) { // Maybe check, but on the flip-side a better solution might be to not make it undeconstructible in the first place, no? - _popup.PopupEntity(Loc.GetString("deconstructible-verb-activate-no-target-text"), uid, Filter.Entities(uid)); + _popup.PopupEntity(Loc.GetString("deconstructible-verb-activate-no-target-text"), uid, uid); } else { - _popup.PopupEntity(Loc.GetString("deconstructible-verb-activate-text"), args.User, Filter.Entities(args.User)); + _popup.PopupEntity(Loc.GetString("deconstructible-verb-activate-text"), args.User, args.User); } }; diff --git a/Content.Server/Construction/ConstructionSystem.Initial.cs b/Content.Server/Construction/ConstructionSystem.Initial.cs index 0b2d200c87..56db9efc52 100644 --- a/Content.Server/Construction/ConstructionSystem.Initial.cs +++ b/Content.Server/Construction/ConstructionSystem.Initial.cs @@ -96,7 +96,7 @@ namespace Content.Server.Construction if (existed) { - _popup.PopupCursor(Loc.GetString("construction-system-construct-cannot-start-another-construction"), Filter.Entities(user)); + _popup.PopupCursor(Loc.GetString("construction-system-construct-cannot-start-another-construction"), user); return null; } @@ -221,7 +221,7 @@ namespace Content.Server.Construction if (failed) { - _popup.PopupCursor(Loc.GetString("construction-system-construct-no-materials"), Filter.Entities(user)); + _popup.PopupCursor(Loc.GetString("construction-system-construct-no-materials"), user); FailCleanup(); return null; } @@ -379,7 +379,7 @@ namespace Content.Server.Construction if (_container.IsEntityInContainer(user)) { - _popup.PopupCursor(Loc.GetString("construction-system-inside-container"), Filter.Entities(user)); + _popup.PopupCursor(Loc.GetString("construction-system-inside-container"), user); return; } @@ -392,7 +392,7 @@ namespace Content.Server.Construction { if (!set.Add(ev.Ack)) { - _popup.PopupCursor(Loc.GetString("construction-system-already-building"), Filter.Entities(user)); + _popup.PopupCursor(Loc.GetString("construction-system-already-building"), user); return; } } diff --git a/Content.Server/Construction/PartExchangerSystem.cs b/Content.Server/Construction/PartExchangerSystem.cs index e84a24c5a5..e92db4e67e 100644 --- a/Content.Server/Construction/PartExchangerSystem.cs +++ b/Content.Server/Construction/PartExchangerSystem.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using System.Threading; using Content.Server.Construction.Components; using Content.Server.DoAfter; @@ -109,7 +109,7 @@ public sealed class PartExchangerSystem : EntitySystem if (TryComp(args.Target, out var wires) && !wires.IsPanelOpen) { _popup.PopupEntity(Loc.GetString("construction-step-condition-wire-panel-open"), - args.Target.Value, Filter.Pvs(args.Target.Value, entityManager: EntityManager)); + args.Target.Value); return; } diff --git a/Content.Server/Crayon/CrayonSystem.cs b/Content.Server/Crayon/CrayonSystem.cs index 2863de209e..82fb9c157f 100644 --- a/Content.Server/Crayon/CrayonSystem.cs +++ b/Content.Server/Crayon/CrayonSystem.cs @@ -51,7 +51,7 @@ public sealed class CrayonSystem : SharedCrayonSystem if (component.DeleteEmpty) UseUpCrayon(uid, args.User); else - _popup.PopupEntity(Loc.GetString("crayon-interact-not-enough-left-text"), uid, Filter.Entities(args.User)); + _popup.PopupEntity(Loc.GetString("crayon-interact-not-enough-left-text"), uid, args.User); args.Handled = true; return; @@ -59,7 +59,7 @@ public sealed class CrayonSystem : SharedCrayonSystem if (!args.ClickLocation.IsValid(EntityManager)) { - _popup.PopupEntity(Loc.GetString("crayon-interact-invalid-location"), uid, Filter.Entities(args.User)); + _popup.PopupEntity(Loc.GetString("crayon-interact-invalid-location"), uid, args.User); args.Handled = true; return; } @@ -139,7 +139,7 @@ public sealed class CrayonSystem : SharedCrayonSystem private void UseUpCrayon(EntityUid uid, EntityUid user) { - _popup.PopupEntity(Loc.GetString("crayon-interact-used-up-text", ("owner", uid)), user, Filter.Entities(user)); + _popup.PopupEntity(Loc.GetString("crayon-interact-used-up-text", ("owner", uid)), user, user); EntityManager.QueueDeleteEntity(uid); } } diff --git a/Content.Server/Cuffs/CuffableSystem.cs b/Content.Server/Cuffs/CuffableSystem.cs index 07bbece33e..6142ce769f 100644 --- a/Content.Server/Cuffs/CuffableSystem.cs +++ b/Content.Server/Cuffs/CuffableSystem.cs @@ -70,10 +70,10 @@ namespace Content.Server.Cuffs { if (args.Target is not {Valid: true} target) return; - + if (!args.CanReach) { - _popup.PopupEntity(Loc.GetString("handcuff-component-too-far-away-error"), args.User, Filter.Entities(args.User)); + _popup.PopupEntity(Loc.GetString("handcuff-component-too-far-away-error"), args.User, args.User); return; } @@ -88,31 +88,31 @@ namespace Content.Server.Cuffs if (component.Broken) { - _popup.PopupEntity(Loc.GetString("handcuff-component-cuffs-broken-error"), user, Filter.Entities(user)); + _popup.PopupEntity(Loc.GetString("handcuff-component-cuffs-broken-error"), user, user); return; } if (!EntityManager.TryGetComponent(target, out var hands)) { - _popup.PopupEntity(Loc.GetString("handcuff-component-target-has-no-hands-error",("targetName", target)), user, Filter.Entities(user)); + _popup.PopupEntity(Loc.GetString("handcuff-component-target-has-no-hands-error",("targetName", target)), user, user); return; } if (cuffed.CuffedHandCount >= hands.Count) { - _popup.PopupEntity(Loc.GetString("handcuff-component-target-has-no-free-hands-error",("targetName", target)), user, Filter.Entities(user)); + _popup.PopupEntity(Loc.GetString("handcuff-component-target-has-no-free-hands-error",("targetName", target)), user, user); return; } // TODO these messages really need third-party variants. I.e., "{$user} starts cuffing {$target}!" if (target == user) { - _popup.PopupEntity(Loc.GetString("handcuff-component-target-self"), user, Filter.Entities(user)); + _popup.PopupEntity(Loc.GetString("handcuff-component-target-self"), user, user); } else { - _popup.PopupEntity(Loc.GetString("handcuff-component-start-cuffing-target-message",("targetName", target)), user, Filter.Entities(user)); - _popup.PopupEntity(Loc.GetString("handcuff-component-start-cuffing-by-other-message",("otherName", user)), target, Filter.Entities(target)); + _popup.PopupEntity(Loc.GetString("handcuff-component-start-cuffing-target-message",("targetName", target)), user, user); + _popup.PopupEntity(Loc.GetString("handcuff-component-start-cuffing-by-other-message",("otherName", user)), target, target); } _audio.PlayPvs(component.StartCuffSound, handcuff); @@ -121,7 +121,7 @@ namespace Content.Server.Cuffs } private void OnCuffMeleeHit(EntityUid uid, HandcuffComponent component, MeleeHitEvent args) - { + { if (!args.HitEntities.Any()) return; @@ -166,7 +166,7 @@ namespace Content.Server.Cuffs } if (args.Cancelled) { - _popup.PopupEntity(Loc.GetString("cuffable-component-cannot-interact-message"), args.Target, Filter.Entities(args.User)); + _popup.PopupEntity(Loc.GetString("cuffable-component-cannot-interact-message"), args.Target, args.User); } } diff --git a/Content.Server/Damage/Systems/DamagePopupSystem.cs b/Content.Server/Damage/Systems/DamagePopupSystem.cs index ba405e6393..4cd8bf4626 100644 --- a/Content.Server/Damage/Systems/DamagePopupSystem.cs +++ b/Content.Server/Damage/Systems/DamagePopupSystem.cs @@ -1,4 +1,4 @@ -using Content.Server.Damage.Components; +using Content.Server.Damage.Components; using Content.Server.Popups; using Content.Shared.Damage; using Robust.Shared.Player; @@ -30,7 +30,7 @@ public sealed class DamagePopupSystem : EntitySystem DamagePopupType.Hit => "!", _ => "Invalid type", }; - _popupSystem.PopupEntity(msg, uid, Filter.Pvs(uid, 2F, EntityManager)); + _popupSystem.PopupEntity(msg, uid); } } } diff --git a/Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs b/Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs index b52ab99668..f7d67ae2e9 100644 --- a/Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs +++ b/Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Content.Server.DeviceNetwork.Components; using Content.Server.UserInterface; using Content.Shared.Access.Components; @@ -102,7 +102,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem if (MetaData(targetUid.Value).EntityLifeStage == EntityLifeStage.MapInitialized) { _popupSystem.PopupCursor(Loc.GetString("network-configurator-device-failed", ("device", targetUid)), - Filter.Entities(userUid)); + userUid); return; } @@ -111,13 +111,13 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem if (configurator.Devices.ContainsValue(targetUid.Value)) { - _popupSystem.PopupCursor(Loc.GetString("network-configurator-device-already-saved", ("device", targetUid)), Filter.Entities(userUid)); + _popupSystem.PopupCursor(Loc.GetString("network-configurator-device-already-saved", ("device", targetUid)), userUid); return; } configurator.Devices.Add(address, targetUid.Value); _popupSystem.PopupCursor(Loc.GetString("network-configurator-device-saved", ("address", device.Address), ("device", targetUid)), - Filter.Entities(userUid), PopupType.Medium); + userUid, PopupType.Medium); UpdateUiState(configurator.Owner, configurator); } @@ -131,7 +131,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem return true; SoundSystem.Play(component.SoundNoAccess.GetSound(), Filter.Pvs(user.Value), target, AudioParams.Default.WithVolume(-2f).WithPitchScale(1.2f)); - _popupSystem.PopupEntity(Loc.GetString("network-configurator-device-access-denied"), target, Filter.Entities(user.Value)); + _popupSystem.PopupEntity(Loc.GetString("network-configurator-device-access-denied"), target, user.Value); return false; } @@ -321,7 +321,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem _ => "error" }; - _popupSystem.PopupCursor(Loc.GetString(resultText), Filter.SinglePlayer(args.Session), PopupType.Medium); + _popupSystem.PopupCursor(Loc.GetString(resultText), args.Session, PopupType.Medium); _uiSystem.TrySetUiState( component.Owner, NetworkConfiguratorUiKey.Configure, diff --git a/Content.Server/Disease/DiseaseDiagnosisSystem.cs b/Content.Server/Disease/DiseaseDiagnosisSystem.cs index 06f056cc10..91e86aafb7 100644 --- a/Content.Server/Disease/DiseaseDiagnosisSystem.cs +++ b/Content.Server/Disease/DiseaseDiagnosisSystem.cs @@ -113,7 +113,7 @@ namespace Content.Server.Disease if (swab.Used) { - _popupSystem.PopupEntity(Loc.GetString("swab-already-used"), args.User, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("swab-already-used"), args.User, args.User); return; } @@ -121,7 +121,7 @@ namespace Content.Server.Disease EntityManager.TryGetComponent(maskUid, out var blocker) && blocker.Enabled) { - _popupSystem.PopupEntity(Loc.GetString("swab-mask-blocked", ("target", Identity.Entity(args.Target.Value, EntityManager)), ("mask", maskUid)), args.User, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("swab-mask-blocked", ("target", Identity.Entity(args.Target.Value, EntityManager)), ("mask", maskUid)), args.User, args.User); return; } @@ -156,10 +156,10 @@ namespace Content.Server.Disease if (!TryComp(args.Used, out var swab)) { - _popupSystem.PopupEntity(Loc.GetString("diagnoser-cant-use-swab", ("machine", uid), ("swab", args.Used)), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("diagnoser-cant-use-swab", ("machine", uid), ("swab", args.Used)), uid, args.User); return; } - _popupSystem.PopupEntity(Loc.GetString("machine-insert-item", ("machine", uid), ("item", args.Used), ("user", args.User)), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("machine-insert-item", ("machine", uid), ("item", args.Used), ("user", args.User)), uid, args.User); machine.Disease = swab.Disease; @@ -188,10 +188,10 @@ namespace Content.Server.Disease if (!TryComp(args.Used, out var swab) || swab.Disease == null || !swab.Disease.Infectious) { - _popupSystem.PopupEntity(Loc.GetString("diagnoser-cant-use-swab", ("machine", uid), ("swab", args.Used)), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("diagnoser-cant-use-swab", ("machine", uid), ("swab", args.Used)), uid, args.User); return; } - _popupSystem.PopupEntity(Loc.GetString("machine-insert-item", ("machine", uid), ("item", args.Used), ("user", args.User)), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("machine-insert-item", ("machine", uid), ("item", args.Used), ("user", args.User)), uid, args.User); var machine = Comp(uid); machine.Disease = swab.Disease; EntityManager.DeleteEntity(args.Used); @@ -321,7 +321,7 @@ namespace Content.Server.Disease return; args.Swab.Used = true; - _popupSystem.PopupEntity(Loc.GetString("swab-swabbed", ("target", Identity.Entity(args.Target.Value, EntityManager))), args.Target.Value, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("swab-swabbed", ("target", Identity.Entity(args.Target.Value, EntityManager))), args.Target.Value, args.User); if (args.Swab.Disease != null || args.Carrier.Diseases.Count == 0) return; diff --git a/Content.Server/Disease/DiseaseSystem.cs b/Content.Server/Disease/DiseaseSystem.cs index c9ba3e75f6..702219fec4 100644 --- a/Content.Server/Disease/DiseaseSystem.cs +++ b/Content.Server/Disease/DiseaseSystem.cs @@ -242,7 +242,7 @@ namespace Content.Server.Disease { var CureTuple = (carrier, disease); CureQueue.Enqueue(CureTuple); - _popupSystem.PopupEntity(Loc.GetString("disease-cured"), carrier.Owner, Filter.Entities(carrier.Owner)); + _popupSystem.PopupEntity(Loc.GetString("disease-cured"), carrier.Owner, carrier.Owner); } public void CureAllDiseases(EntityUid uid, DiseaseCarrierComponent? carrier = null) @@ -298,7 +298,7 @@ namespace Content.Server.Disease if (vaxx.Used) { - _popupSystem.PopupEntity(Loc.GetString("vaxx-already-used"), args.User, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("vaxx-already-used"), args.User, args.User); return; } @@ -450,7 +450,7 @@ namespace Content.Server.Disease if (attemptSneezeCoughEvent.Cancelled) return false; if (!string.IsNullOrEmpty(snoughMessage)) - _popupSystem.PopupEntity(Loc.GetString(snoughMessage, ("person", Identity.Entity(uid, EntityManager))), uid, Filter.Pvs(uid)); + _popupSystem.PopupEntity(Loc.GetString(snoughMessage, ("person", Identity.Entity(uid, EntityManager))), uid); if (snoughSound != null) _audioSystem.PlayPvs(snoughSound, uid); diff --git a/Content.Server/Disease/Effects/DiseasePolymorph.cs b/Content.Server/Disease/Effects/DiseasePolymorph.cs index daf8f04bd5..2b7be91bd0 100644 --- a/Content.Server/Disease/Effects/DiseasePolymorph.cs +++ b/Content.Server/Disease/Effects/DiseasePolymorph.cs @@ -33,7 +33,7 @@ namespace Content.Server.Disease.Effects SoundSystem.Play(PolymorphSound.GetSound(), Filter.Pvs(polyUid.Value), polyUid.Value, AudioHelpers.WithVariation(0.2f)); if (PolymorphMessage != null && polyUid != null) - EntitySystem.Get().PopupEntity(Loc.GetString(PolymorphMessage), polyUid.Value, Filter.Entities(polyUid.Value), Shared.Popups.PopupType.Large); + EntitySystem.Get().PopupEntity(Loc.GetString(PolymorphMessage), polyUid.Value, polyUid.Value, Shared.Popups.PopupType.Large); } } } diff --git a/Content.Server/Disease/Effects/DiseasePopUp.cs b/Content.Server/Disease/Effects/DiseasePopUp.cs index fac7f4454d..9ddb0a4f43 100644 --- a/Content.Server/Disease/Effects/DiseasePopUp.cs +++ b/Content.Server/Disease/Effects/DiseasePopUp.cs @@ -28,9 +28,9 @@ namespace Content.Server.Disease.Effects var popupSys = args.EntityManager.EntitySysManager.GetEntitySystem(); if (Type == PopupRecipients.Local) - popupSys.PopupEntity(Loc.GetString(Message), args.DiseasedEntity, Filter.Entities(args.DiseasedEntity), VisualType); + popupSys.PopupEntity(Loc.GetString(Message), args.DiseasedEntity, args.DiseasedEntity, VisualType); else if (Type == PopupRecipients.Pvs) - popupSys.PopupEntity(Loc.GetString(Message, ("person", Identity.Entity(args.DiseasedEntity, args.EntityManager))), args.DiseasedEntity, Filter.Pvs(args.DiseasedEntity), VisualType); + popupSys.PopupEntity(Loc.GetString(Message, ("person", Identity.Entity(args.DiseasedEntity, args.EntityManager))), args.DiseasedEntity, VisualType); } } diff --git a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs index 13ee10d512..2cc8bfe05d 100644 --- a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs +++ b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs @@ -287,7 +287,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems _robustRandom.NextDouble() > 0.75 || !component.Container.Insert(args.Thrown)) { - _popupSystem.PopupEntity(Loc.GetString("disposal-unit-thrown-missed"), uid, Filter.Pvs(uid)); + _popupSystem.PopupEntity(Loc.GetString("disposal-unit-thrown-missed"), uid); return; } @@ -461,7 +461,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems if (userId.HasValue && !HasComp(userId) && toInsertId != userId) // Mobs like mouse can Jump inside even with no hands { - _popupSystem.PopupEntity(Loc.GetString("disposal-unit-no-hands"), userId.Value, Filter.Entities(userId.Value), PopupType.SmallCaution); + _popupSystem.PopupEntity(Loc.GetString("disposal-unit-no-hands"), userId.Value, userId.Value, PopupType.SmallCaution); return false; } diff --git a/Content.Server/Doors/Systems/FirelockSystem.cs b/Content.Server/Doors/Systems/FirelockSystem.cs index f695fdd5da..11029857b1 100644 --- a/Content.Server/Doors/Systems/FirelockSystem.cs +++ b/Content.Server/Doors/Systems/FirelockSystem.cs @@ -144,12 +144,12 @@ namespace Content.Server.Doors.Systems if (state.Fire) { _popupSystem.PopupEntity(Loc.GetString("firelock-component-is-holding-fire-message"), - uid, Filter.Pvs(uid, entityManager: EntityManager)); + uid); } else if (state.Pressure) { _popupSystem.PopupEntity(Loc.GetString("firelock-component-is-holding-pressure-message"), - uid, Filter.Pvs(uid, entityManager: EntityManager)); + uid); } if (state.Fire || state.Pressure) diff --git a/Content.Server/Dragon/DragonSystem.cs b/Content.Server/Dragon/DragonSystem.cs index 7ecf239c27..c5099571a5 100644 --- a/Content.Server/Dragon/DragonSystem.cs +++ b/Content.Server/Dragon/DragonSystem.cs @@ -188,7 +188,7 @@ namespace Content.Server.Dragon // We can't predict the rift being destroyed anyway so no point adding weakened to shared. dragon.WeakenedAccumulator = dragon.WeakenedDuration; _movement.RefreshMovementSpeedModifiers(component.Dragon); - _popupSystem.PopupEntity(Loc.GetString("carp-rift-destroyed"), component.Dragon, Filter.Entities(component.Dragon)); + _popupSystem.PopupEntity(Loc.GetString("carp-rift-destroyed"), component.Dragon, component.Dragon); } } @@ -212,19 +212,19 @@ namespace Content.Server.Dragon { if (component.Weakened) { - _popupSystem.PopupEntity(Loc.GetString("carp-rift-weakened"), uid, Filter.Entities(uid)); + _popupSystem.PopupEntity(Loc.GetString("carp-rift-weakened"), uid, uid); return; } if (component.Rifts.Count >= RiftsAllowed) { - _popupSystem.PopupEntity(Loc.GetString("carp-rift-max"), uid, Filter.Entities(uid)); + _popupSystem.PopupEntity(Loc.GetString("carp-rift-max"), uid, uid); return; } if (component.Rifts.Count > 0 && TryComp(component.Rifts[^1], out var rift) && rift.State != DragonRiftState.Finished) { - _popupSystem.PopupEntity(Loc.GetString("carp-rift-duplicate"), uid, Filter.Entities(uid)); + _popupSystem.PopupEntity(Loc.GetString("carp-rift-duplicate"), uid, uid); return; } @@ -233,7 +233,7 @@ namespace Content.Server.Dragon // Have to be on a grid fam if (!_mapManager.TryGetGrid(xform.GridUid, out var grid)) { - _popupSystem.PopupEntity(Loc.GetString("carp-rift-anchor"), uid, Filter.Entities(uid)); + _popupSystem.PopupEntity(Loc.GetString("carp-rift-anchor"), uid, uid); return; } @@ -241,7 +241,7 @@ namespace Content.Server.Dragon { if (riftXform.Coordinates.InRange(EntityManager, xform.Coordinates, RiftRange)) { - _popupSystem.PopupEntity(Loc.GetString("carp-rift-proximity", ("proximity", RiftRange)), uid, Filter.Entities(uid)); + _popupSystem.PopupEntity(Loc.GetString("carp-rift-proximity", ("proximity", RiftRange)), uid, uid); return; } } @@ -251,7 +251,7 @@ namespace Content.Server.Dragon if (!tile.IsSpace(_tileDef)) continue; - _popupSystem.PopupEntity(Loc.GetString("carp-rift-space-proximity", ("proximity", RiftTileRadius)), uid, Filter.Entities(uid)); + _popupSystem.PopupEntity(Loc.GetString("carp-rift-space-proximity", ("proximity", RiftTileRadius)), uid, uid); return; } @@ -379,14 +379,14 @@ namespace Content.Server.Dragon }); break; default: - _popupSystem.PopupEntity(Loc.GetString("devour-action-popup-message-fail-target-alive"), uid, Filter.Entities(uid)); + _popupSystem.PopupEntity(Loc.GetString("devour-action-popup-message-fail-target-alive"), uid, uid); break; } return; } - _popupSystem.PopupEntity(Loc.GetString("devour-action-popup-message-structure"), uid, Filter.Entities(uid)); + _popupSystem.PopupEntity(Loc.GetString("devour-action-popup-message-structure"), uid, uid); if (component.SoundStructureDevour != null) _audioSystem.PlayPvs(component.SoundStructureDevour, uid, component.SoundStructureDevour.Params); diff --git a/Content.Server/Drone/DroneSystem.cs b/Content.Server/Drone/DroneSystem.cs index 505febfca6..97b0b5bfad 100644 --- a/Content.Server/Drone/DroneSystem.cs +++ b/Content.Server/Drone/DroneSystem.cs @@ -94,8 +94,7 @@ namespace Content.Server.Drone private void OnMindAdded(EntityUid uid, DroneComponent drone, MindAddedMessage args) { UpdateDroneAppearance(uid, DroneStatus.On); - _popupSystem.PopupEntity(Loc.GetString("drone-activated"), uid, - Filter.Pvs(uid), PopupType.Large); + _popupSystem.PopupEntity(Loc.GetString("drone-activated"), uid, PopupType.Large); } private void OnMindRemoved(EntityUid uid, DroneComponent drone, MindRemovedMessage args) @@ -135,7 +134,7 @@ namespace Content.Server.Drone if ((TryComp(entity, out var entityMobState) && HasComp(entity) && entityMobState.IsDead())) continue; if (_gameTiming.IsFirstTimePredicted) - _popupSystem.PopupEntity(Loc.GetString("drone-too-close", ("being", Identity.Entity(entity, EntityManager))), uid, Filter.Entities(uid)); + _popupSystem.PopupEntity(Loc.GetString("drone-too-close", ("being", Identity.Entity(entity, EntityManager))), uid, uid); return true; } } diff --git a/Content.Server/Electrocution/ElectrocutionSystem.cs b/Content.Server/Electrocution/ElectrocutionSystem.cs index d6b175f471..b62f2739c1 100644 --- a/Content.Server/Electrocution/ElectrocutionSystem.cs +++ b/Content.Server/Electrocution/ElectrocutionSystem.cs @@ -383,23 +383,21 @@ namespace Content.Server.Electrocution _jitteringSystem.DoJitter(uid, time * JitterTimeMultiplier, refresh, JitterAmplitude, JitterFrequency, true, statusEffects); - _popupSystem.PopupEntity(Loc.GetString("electrocuted-component-mob-shocked-popup-player"), uid, - Filter.Entities(uid).Unpredicted()); + _popupSystem.PopupEntity(Loc.GetString("electrocuted-component-mob-shocked-popup-player"), uid, uid); - var filter = Filter.Pvs(uid, 2f, EntityManager).RemoveWhereAttachedEntity(puid => puid == uid) - .Unpredicted(); + var filter = Filter.PvsExcept(uid, entityManager: EntityManager); // TODO: Allow being able to pass EntityUid to Loc... if (sourceUid != null) { _popupSystem.PopupEntity(Loc.GetString("electrocuted-component-mob-shocked-by-source-popup-others", - ("mob", uid), ("source", (sourceUid.Value))), uid, filter); + ("mob", uid), ("source", (sourceUid.Value))), uid, filter, true); PlayElectrocutionSound(uid, sourceUid.Value); } else { _popupSystem.PopupEntity(Loc.GetString("electrocuted-component-mob-shocked-popup-others", - ("mob", uid)), uid, filter); + ("mob", uid)), uid, filter, true); } return true; diff --git a/Content.Server/Emag/EmagSystem.cs b/Content.Server/Emag/EmagSystem.cs index e13d40b587..aef8966240 100644 --- a/Content.Server/Emag/EmagSystem.cs +++ b/Content.Server/Emag/EmagSystem.cs @@ -58,7 +58,7 @@ namespace Content.Server.Emag if (component.Charges <= 0) { - _popupSystem.PopupEntity(Loc.GetString("emag-no-charges"), args.User, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("emag-no-charges"), args.User, args.User); return; } @@ -66,7 +66,7 @@ namespace Content.Server.Emag if (handled) { _popupSystem.PopupEntity(Loc.GetString("emag-success", ("target", Identity.Entity(args.Target.Value, EntityManager))), args.User, - Filter.Entities(args.User), PopupType.Medium); + args.User, PopupType.Medium); _adminLogger.Add(LogType.Emag, LogImpact.High, $"{ToPrettyString(args.User):player} emagged {ToPrettyString(args.Target.Value):target}"); component.Charges--; return; diff --git a/Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs b/Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs index 618b67a46c..3722324292 100644 --- a/Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs +++ b/Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs @@ -110,11 +110,11 @@ public sealed partial class EnsnareableSystem _doAfter.DoAfter(doAfterEventArgs); if (isOwner) - _popup.PopupEntity(Loc.GetString("ensnare-component-try-free", ("ensnare", component.Owner)), target, Filter.Entities(target)); + _popup.PopupEntity(Loc.GetString("ensnare-component-try-free", ("ensnare", component.Owner)), target, target); if (!isOwner && user != null) { - _popup.PopupEntity(Loc.GetString("ensnare-component-try-free-other", ("ensnare", component.Owner), ("user", Identity.Entity(target, EntityManager))), user.Value, Filter.Entities(user.Value)); + _popup.PopupEntity(Loc.GetString("ensnare-component-try-free-other", ("ensnare", component.Owner), ("user", Identity.Entity(target, EntityManager))), user.Value, user.Value); } } diff --git a/Content.Server/Ensnaring/EnsnareableSystem.cs b/Content.Server/Ensnaring/EnsnareableSystem.cs index 9c216ce47d..b10dca6709 100644 --- a/Content.Server/Ensnaring/EnsnareableSystem.cs +++ b/Content.Server/Ensnaring/EnsnareableSystem.cs @@ -41,7 +41,7 @@ public sealed partial class EnsnareableSystem : SharedEnsnareableSystem ensnaring.Ensnared = null; _popup.PopupEntity(Loc.GetString("ensnare-component-try-free-complete", ("ensnare", args.EnsnaringEntity)), - uid, Filter.Entities(uid), PopupType.Large); + uid, uid, PopupType.Large); UpdateAlert(component); var ev = new EnsnareRemoveEvent(); @@ -58,6 +58,6 @@ public sealed partial class EnsnareableSystem : SharedEnsnareableSystem ensnaring.CancelToken = null; _popup.PopupEntity(Loc.GetString("ensnare-component-try-free-fail", ("ensnare", args.EnsnaringEntity)), - uid, Filter.Entities(uid), PopupType.Large); + uid, uid, PopupType.Large); } } diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.Mobstate.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.Mobstate.cs index 8dbe52a512..824cdca8b3 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.Mobstate.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.Mobstate.cs @@ -43,7 +43,7 @@ public sealed partial class TriggerSystem if (component.PreventSuicide) { - _popupSystem.PopupEntity(Loc.GetString("suicide-prevented"), args.Victim, Filter.Entities(args.Victim)); + _popupSystem.PopupEntity(Loc.GetString("suicide-prevented"), args.Victim, args.Victim); args.BlockSuicideAttempt(component.PreventSuicide); } } diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs index 05c8ec68aa..4e4ea2cd11 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs @@ -83,7 +83,7 @@ public sealed partial class TriggerSystem Act = () => { component.Delay = option; - _popupSystem.PopupEntity(Loc.GetString("popup-trigger-timer-set", ("time", option)), args.User, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("popup-trigger-timer-set", ("time", option)), args.User, args.User); }, }); } @@ -110,7 +110,7 @@ public sealed partial class TriggerSystem if (component.DelayOptions[^1] <= component.Delay) { component.Delay = component.DelayOptions[0]; - _popupSystem.PopupEntity(Loc.GetString("popup-trigger-timer-set", ("time", component.Delay)), user, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString("popup-trigger-timer-set", ("time", component.Delay)), user, user); return; } @@ -119,7 +119,7 @@ public sealed partial class TriggerSystem if (option > component.Delay) { component.Delay = option; - _popupSystem.PopupEntity(Loc.GetString("popup-trigger-timer-set", ("time", option)), user, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString("popup-trigger-timer-set", ("time", option)), user, user); return; } } @@ -130,12 +130,12 @@ public sealed partial class TriggerSystem if (comp.StartOnStick) { comp.StartOnStick = false; - _popupSystem.PopupEntity(Loc.GetString("popup-start-on-stick-off"), grenade, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString("popup-start-on-stick-off"), grenade, user); } else { comp.StartOnStick = true; - _popupSystem.PopupEntity(Loc.GetString("popup-start-on-stick-on"), grenade, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString("popup-start-on-stick-on"), grenade, user); } } diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.Voice.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.Voice.cs index 023283b36c..3da6c98cab 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.Voice.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.Voice.cs @@ -86,7 +86,7 @@ namespace Content.Server.Explosion.EntitySystems _adminLogger.Add(LogType.Trigger, LogImpact.Low, $"A voice-trigger on {ToPrettyString(component.Owner):entity} has started recording. User: {ToPrettyString(user):user}"); - _popupSystem.PopupEntity(Loc.GetString("popup-trigger-voice-start-recording"), component.Owner, Filter.Pvs(component.Owner)); + _popupSystem.PopupEntity(Loc.GetString("popup-trigger-voice-start-recording"), component.Owner); } public void StopRecording(TriggerOnVoiceComponent component) @@ -95,7 +95,7 @@ namespace Content.Server.Explosion.EntitySystems if (string.IsNullOrWhiteSpace(component.KeyPhrase)) RemComp(component.Owner); - _popupSystem.PopupEntity(Loc.GetString("popup-trigger-voice-stop-recording"), component.Owner, Filter.Pvs(component.Owner)); + _popupSystem.PopupEntity(Loc.GetString("popup-trigger-voice-stop-recording"), component.Owner); } public void FinishRecording(TriggerOnVoiceComponent component, EntityUid source, string message) @@ -106,7 +106,7 @@ namespace Content.Server.Explosion.EntitySystems _adminLogger.Add(LogType.Trigger, LogImpact.Low, $"A voice-trigger on {ToPrettyString(component.Owner):entity} has recorded a new keyphrase: '{component.KeyPhrase}'. Recorded from {ToPrettyString(source):speaker}"); - _popupSystem.PopupEntity(Loc.GetString("popup-trigger-voice-recorded", ("keyphrase", component.KeyPhrase!)), component.Owner, Filter.Pvs(component.Owner)); + _popupSystem.PopupEntity(Loc.GetString("popup-trigger-voice-recorded", ("keyphrase", component.KeyPhrase!)), component.Owner); } private void OnVoiceExamine(EntityUid uid, TriggerOnVoiceComponent component, ExaminedEvent args) diff --git a/Content.Server/Extinguisher/FireExtinguisherSystem.cs b/Content.Server/Extinguisher/FireExtinguisherSystem.cs index 6b5b2fb12a..cca8df10d5 100644 --- a/Content.Server/Extinguisher/FireExtinguisherSystem.cs +++ b/Content.Server/Extinguisher/FireExtinguisherSystem.cs @@ -62,7 +62,7 @@ public sealed class FireExtinguisherSystem : EntitySystem if (component.HasSafety && component.Safety) { _popupSystem.PopupEntity(Loc.GetString("fire-extinguisher-component-safety-on-message"), uid, - Filter.Entities(args.User)); + args.User); return; } @@ -87,7 +87,7 @@ public sealed class FireExtinguisherSystem : EntitySystem SoundSystem.Play(component.RefillSound.GetSound(), Filter.Pvs(uid), uid); _popupSystem.PopupEntity(Loc.GetString("fire-extinguisher-component-after-interact-refilled-message", ("owner", uid)), - uid, Filter.Entities(args.Target.Value)); + uid, args.Target.Value); } } @@ -110,7 +110,7 @@ public sealed class FireExtinguisherSystem : EntitySystem if (component.HasSafety && component.Safety) { _popupSystem.PopupEntity(Loc.GetString("fire-extinguisher-component-safety-on-message"), uid, - Filter.Entities(args.User)); + args.User); args.Cancel(); } } diff --git a/Content.Server/Eye/Blinding/ActivatableUIRequiresVisionSystem.cs b/Content.Server/Eye/Blinding/ActivatableUIRequiresVisionSystem.cs index 5a6156aaa8..a1401f1745 100644 --- a/Content.Server/Eye/Blinding/ActivatableUIRequiresVisionSystem.cs +++ b/Content.Server/Eye/Blinding/ActivatableUIRequiresVisionSystem.cs @@ -26,7 +26,7 @@ namespace Content.Server.Eye.Blinding if (TryComp(args.User, out var blindable) && blindable.Sources > 0) { - _popupSystem.PopupCursor(Loc.GetString("blindness-fail-attempt"), Filter.Entities(args.User), Shared.Popups.PopupType.MediumCaution); + _popupSystem.PopupCursor(Loc.GetString("blindness-fail-attempt"), args.User, Shared.Popups.PopupType.MediumCaution); args.Cancel(); } } diff --git a/Content.Server/Fax/FaxSystem.cs b/Content.Server/Fax/FaxSystem.cs index c8832ab839..044fba0001 100644 --- a/Content.Server/Fax/FaxSystem.cs +++ b/Content.Server/Fax/FaxSystem.cs @@ -42,21 +42,21 @@ public sealed class FaxSystem : EntitySystem public override void Initialize() { base.Initialize(); - + // Hooks SubscribeLocalEvent(OnComponentInit); SubscribeLocalEvent(OnMapInit); SubscribeLocalEvent(OnComponentRemove); - + SubscribeLocalEvent(OnItemSlotChanged); SubscribeLocalEvent(OnItemSlotChanged); SubscribeLocalEvent(OnPowerChanged); SubscribeLocalEvent(OnPacketReceived); - + // Interaction SubscribeLocalEvent(OnInteractUsing); SubscribeLocalEvent(OnEmagged); - + // UI SubscribeLocalEvent(OnToggleInterface); SubscribeLocalEvent(OnSendButtonPressed); @@ -92,7 +92,7 @@ public sealed class FaxSystem : EntitySystem SpawnPaperFromQueue(comp.Owner, comp); UpdateUserInterface(comp.Owner, comp); } - + return; } @@ -182,13 +182,13 @@ public sealed class FaxSystem : EntitySystem { component.PrintingTimeRemaining = 0f; // Reset animation } - + if (isInsertInterrupted || isPrintInterrupted) UpdateAppearance(component.Owner, component); _itemSlotsSystem.SetLock(uid, component.PaperSlot, !args.Powered); // Lock slot when power is off } - + private void OnInteractUsing(EntityUid uid, FaxMachineComponent component, InteractUsingEvent args) { if (args.Handled || @@ -206,26 +206,26 @@ public sealed class FaxSystem : EntitySystem if (newName.Length > 20) { - _popupSystem.PopupEntity(Loc.GetString("fax-machine-popup-name-long"), uid, Filter.Pvs(uid)); + _popupSystem.PopupEntity(Loc.GetString("fax-machine-popup-name-long"), uid); return; } if (component.KnownFaxes.ContainsValue(newName) && !component.Emagged) // Allow exist names if emagged for fun { - _popupSystem.PopupEntity(Loc.GetString("fax-machine-popup-name-exist"), uid, Filter.Pvs(uid)); + _popupSystem.PopupEntity(Loc.GetString("fax-machine-popup-name-exist"), uid); return; } _adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(args.User):user} renamed {ToPrettyString(uid)} from \"{component.FaxName}\" to \"{newName}\""); component.FaxName = newName; - _popupSystem.PopupEntity(Loc.GetString("fax-machine-popup-name-set"), uid, Filter.Pvs(uid)); + _popupSystem.PopupEntity(Loc.GetString("fax-machine-popup-name-set"), uid); UpdateUserInterface(uid, component); }); - + args.Handled = true; } - + private void OnEmagged(EntityUid uid, FaxMachineComponent component, GotEmaggedEvent args) { if (component.Emagged) @@ -280,22 +280,22 @@ public sealed class FaxSystem : EntitySystem } } } - + private void OnToggleInterface(EntityUid uid, FaxMachineComponent component, AfterActivatableUIOpenEvent args) { UpdateUserInterface(uid, component); } - + private void OnSendButtonPressed(EntityUid uid, FaxMachineComponent component, FaxSendMessage args) { Send(uid, component, args.Session.AttachedEntity); } - + private void OnRefreshButtonPressed(EntityUid uid, FaxMachineComponent component, FaxRefreshMessage args) { Refresh(uid, component); } - + private void OnDestinationSelected(EntityUid uid, FaxMachineComponent component, FaxDestinationMessage args) { SetDestination(uid, args.Address, component); @@ -352,7 +352,7 @@ public sealed class FaxSystem : EntitySystem component.DestinationFaxAddress = null; component.KnownFaxes.Clear(); - + var payload = new NetworkPayload() { { DeviceNetworkConstants.Command, FaxConstants.FaxPingCommand } @@ -379,7 +379,7 @@ public sealed class FaxSystem : EntitySystem if (component.DestinationFaxAddress == null) return; - + if (!component.KnownFaxes.TryGetValue(component.DestinationFaxAddress, out var faxName)) return; @@ -398,9 +398,9 @@ public sealed class FaxSystem : EntitySystem _adminLogger.Add(LogType.Action, LogImpact.Low, $"{(sender != null ? ToPrettyString(sender.Value) : "Unknown"):user} sent fax from \"{component.FaxName}\" {ToPrettyString(uid)} to {faxName} ({component.DestinationFaxAddress}): {paper.Content}"); component.SendTimeoutRemaining += component.SendTimeout; - + _audioSystem.PlayPvs(component.SendSound, uid); - + UpdateUserInterface(uid, component); } @@ -417,7 +417,7 @@ public sealed class FaxSystem : EntitySystem if (fromAddress != null && component.KnownFaxes.ContainsKey(fromAddress)) // If message received from unknown for fax address faxName = component.KnownFaxes[fromAddress]; - _popupSystem.PopupEntity(Loc.GetString("fax-machine-popup-received", ("from", faxName)), uid, Filter.Pvs(uid)); + _popupSystem.PopupEntity(Loc.GetString("fax-machine-popup-received", ("from", faxName)), uid); _appearanceSystem.SetData(uid, FaxMachineVisuals.VisualState, FaxMachineVisualState.Printing); if (component.NotifyAdmins) diff --git a/Content.Server/Fluids/EntitySystems/SpraySystem.cs b/Content.Server/Fluids/EntitySystems/SpraySystem.cs index c674222a1a..e6b8a0eeec 100644 --- a/Content.Server/Fluids/EntitySystems/SpraySystem.cs +++ b/Content.Server/Fluids/EntitySystems/SpraySystem.cs @@ -53,7 +53,7 @@ public sealed class SpraySystem : EntitySystem if (solution.CurrentVolume <= 0) { _popupSystem.PopupEntity(Loc.GetString("spray-component-is-empty-message"), uid, - Filter.Entities(args.User)); + args.User); return; } diff --git a/Content.Server/Forensics/Systems/ForensicPadSystem.cs b/Content.Server/Forensics/Systems/ForensicPadSystem.cs index 4fe3c97c94..1ac262c05f 100644 --- a/Content.Server/Forensics/Systems/ForensicPadSystem.cs +++ b/Content.Server/Forensics/Systems/ForensicPadSystem.cs @@ -54,13 +54,13 @@ namespace Content.Server.Forensics if (component.Used) { - _popupSystem.PopupEntity(Loc.GetString("forensic-pad-already-used"), args.Target.Value, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("forensic-pad-already-used"), args.Target.Value, args.User); return; } if (_inventory.TryGetSlotEntity(args.Target.Value, "gloves", out var gloves)) { - _popupSystem.PopupEntity(Loc.GetString("forensic-pad-gloves", ("target", Identity.Entity(args.Target.Value, EntityManager))), args.Target.Value, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("forensic-pad-gloves", ("target", Identity.Entity(args.Target.Value, EntityManager))), args.Target.Value, args.User); return; } @@ -68,8 +68,8 @@ namespace Content.Server.Forensics { if (args.User != args.Target) { - _popupSystem.PopupEntity(Loc.GetString("forensic-pad-start-scan-user", ("target", Identity.Entity(args.Target.Value, EntityManager))), args.Target.Value, Filter.Entities(args.User)); - _popupSystem.PopupEntity(Loc.GetString("forensic-pad-start-scan-target", ("user", Identity.Entity(args.User, EntityManager))), args.Target.Value, Filter.Entities(args.Target.Value)); + _popupSystem.PopupEntity(Loc.GetString("forensic-pad-start-scan-user", ("target", Identity.Entity(args.Target.Value, EntityManager))), args.Target.Value, args.User); + _popupSystem.PopupEntity(Loc.GetString("forensic-pad-start-scan-target", ("user", Identity.Entity(args.User, EntityManager))), args.Target.Value, args.Target.Value); } StartScan(args.User, args.Target.Value, component, fingerprint.Fingerprint); return; diff --git a/Content.Server/Forensics/Systems/ForensicScannerSystem.cs b/Content.Server/Forensics/Systems/ForensicScannerSystem.cs index 3defd4da7b..0d089fc76f 100644 --- a/Content.Server/Forensics/Systems/ForensicScannerSystem.cs +++ b/Content.Server/Forensics/Systems/ForensicScannerSystem.cs @@ -145,7 +145,7 @@ namespace Content.Server.Forensics if (fiber == pad.Sample) { _audioSystem.PlayPvs(component.SoundMatch, uid); - _popupSystem.PopupEntity(Loc.GetString("forensic-scanner-match-fiber"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("forensic-scanner-match-fiber"), uid, args.User); return; } } @@ -155,13 +155,13 @@ namespace Content.Server.Forensics if (fingerprint == pad.Sample) { _audioSystem.PlayPvs(component.SoundMatch, uid); - _popupSystem.PopupEntity(Loc.GetString("forensic-scanner-match-fingerprint"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("forensic-scanner-match-fingerprint"), uid, args.User); return; } } _audioSystem.PlayPvs(component.SoundNoMatch, uid); - _popupSystem.PopupEntity(Loc.GetString("forensic-scanner-match-none"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("forensic-scanner-match-none"), uid, args.User); } private void OnBeforeActivatableUIOpen(EntityUid uid, ForensicScannerComponent component, BeforeActivatableUIOpenEvent args) @@ -193,7 +193,7 @@ namespace Content.Server.Forensics { // This shouldn't occur due to the UI guarding against it, but // if it does, tell the user why nothing happened. - _popupSystem.PopupEntity(Loc.GetString("forensic-scanner-printer-not-ready"), uid, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString("forensic-scanner-printer-not-ready"), uid, user); return; } diff --git a/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs b/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs index fc45058211..0f48f7658f 100644 --- a/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs @@ -152,7 +152,7 @@ public sealed class ZombieRuleSystem : GameRuleSystem var percent = GetInfectedPercentage(out var num); if (num.Count == 1) //only one human left. spooky - _popup.PopupEntity(Loc.GetString("zombie-alone"), num[0], Filter.Entities(num[0])); + _popup.PopupEntity(Loc.GetString("zombie-alone"), num[0], num[0]); if (percent >= 1) //oops, all zombies _roundEndSystem.EndRound(); } diff --git a/Content.Server/Guardian/GuardianSystem.cs b/Content.Server/Guardian/GuardianSystem.cs index 5ae876ff80..72678c488f 100644 --- a/Content.Server/Guardian/GuardianSystem.cs +++ b/Content.Server/Guardian/GuardianSystem.cs @@ -81,7 +81,7 @@ namespace Content.Server.Guardian if (!HasComp(host)) return; - _popupSystem.PopupEntity(Loc.GetString("guardian-available"), host, Filter.Entities(host)); + _popupSystem.PopupEntity(Loc.GetString("guardian-available"), host, host); } private void OnHostInit(EntityUid uid, GuardianHostComponent component, ComponentInit args) @@ -102,7 +102,8 @@ namespace Content.Server.Guardian if (args.Cancelled || args.Target != component.Host) return; - _popupSystem.PopupCursor(Loc.GetString("guardian-attack-host"), Filter.Entities(uid), PopupType.LargeCaution); + // why is this server side code? This should be in shared + _popupSystem.PopupCursor(Loc.GetString("guardian-attack-host"), uid, PopupType.LargeCaution); args.Cancel(); } @@ -147,22 +148,21 @@ namespace Content.Server.Guardian { if (component.Used) { - _popupSystem.PopupEntity(Loc.GetString("guardian-activator-empty-invalid-creation"), user, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString("guardian-activator-empty-invalid-creation"), user, user); return; } // Can only inject things with the component... if (!HasComp(target)) { - _popupSystem.PopupEntity(Loc.GetString("guardian-activator-invalid-target"), user, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString("guardian-activator-invalid-target"), user, user); return; } - // If user is already a host don't duplicate. if (HasComp(target)) { - _popupSystem.PopupEntity(Loc.GetString("guardian-already-present-invalid-creation"), user, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString("guardian-already-present-invalid-creation"), user, user); return; } @@ -204,9 +204,9 @@ namespace Content.Server.Guardian { guardianComponent.Host = ev.Target; - SoundSystem.Play("/Audio/Effects/guardian_inject.ogg", Filter.Entities(ev.Target), ev.Target); + SoundSystem.Play("/Audio/Effects/guardian_inject.ogg", Filter.Pvs(ev.Target), ev.Target); - _popupSystem.PopupEntity(Loc.GetString("guardian-created"), ev.Target, Filter.Entities(ev.Target)); + _popupSystem.PopupEntity(Loc.GetString("guardian-created"), ev.Target, ev.Target); // Exhaust the activator comp.Used = true; } @@ -226,8 +226,8 @@ namespace Content.Server.Guardian if (args.CurrentMobState.IsCritical()) { - _popupSystem.PopupEntity(Loc.GetString("guardian-critical-warn"), component.HostedGuardian.Value, Filter.Entities(component.HostedGuardian.Value)); - SoundSystem.Play("/Audio/Effects/guardian_warn.ogg", Filter.Entities(component.HostedGuardian.Value), component.HostedGuardian.Value); + _popupSystem.PopupEntity(Loc.GetString("guardian-critical-warn"), component.HostedGuardian.Value, component.HostedGuardian.Value); + SoundSystem.Play("/Audio/Effects/guardian_warn.ogg", Filter.Pvs(component.HostedGuardian.Value), component.HostedGuardian.Value); } else if (args.CurrentMobState.IsDead()) { @@ -244,7 +244,7 @@ namespace Content.Server.Guardian if (args.DamageDelta == null) return; _damageSystem.TryChangeDamage(component.Host, args.DamageDelta * component.DamageShare, origin: args.Origin); - _popupSystem.PopupEntity(Loc.GetString("guardian-entity-taking-damage"), component.Host, Filter.Entities(component.Host)); + _popupSystem.PopupEntity(Loc.GetString("guardian-entity-taking-damage"), component.Host, component.Host); } @@ -321,7 +321,7 @@ namespace Content.Server.Guardian if (!CanRelease(hostComponent, guardianComponent)) { - _popupSystem.PopupEntity(Loc.GetString("guardian-no-soul"), hostComponent.Owner, Filter.Entities(hostComponent.Owner)); + _popupSystem.PopupEntity(Loc.GetString("guardian-no-soul"), hostComponent.Owner, hostComponent.Owner); return; } @@ -342,7 +342,7 @@ namespace Content.Server.Guardian hostComponent.GuardianContainer.Insert(guardianComponent.Owner); DebugTools.Assert(hostComponent.GuardianContainer.Contains(guardianComponent.Owner)); - _popupSystem.PopupEntity(Loc.GetString("guardian-entity-recall"), hostComponent.Owner, Filter.Pvs(hostComponent.Owner)); + _popupSystem.PopupEntity(Loc.GetString("guardian-entity-recall"), hostComponent.Owner); guardianComponent.GuardianLoose = false; } diff --git a/Content.Server/Hands/Systems/HandsSystem.cs b/Content.Server/Hands/Systems/HandsSystem.cs index afa6192b27..25e3fa7c6c 100644 --- a/Content.Server/Hands/Systems/HandsSystem.cs +++ b/Content.Server/Hands/Systems/HandsSystem.cs @@ -250,7 +250,7 @@ namespace Content.Server.Hands.Systems if (!_inventorySystem.TryGetSlotEntity(plyEnt, equipmentSlot, out var slotEntity) || !TryComp(slotEntity, out ServerStorageComponent? storageComponent)) { - _popupSystem.PopupEntity(Loc.GetString("hands-system-missing-equipment-slot", ("slotName", equipmentSlot)), plyEnt, Filter.SinglePlayer(session)); + _popupSystem.PopupEntity(Loc.GetString("hands-system-missing-equipment-slot", ("slotName", equipmentSlot)), plyEnt, session); return; } @@ -262,7 +262,7 @@ namespace Content.Server.Hands.Systems { if (storageComponent.StoredEntities.Count == 0) { - _popupSystem.PopupEntity(Loc.GetString("hands-system-empty-equipment-slot", ("slotName", equipmentSlot)), plyEnt, Filter.SinglePlayer(session)); + _popupSystem.PopupEntity(Loc.GetString("hands-system-empty-equipment-slot", ("slotName", equipmentSlot)), plyEnt, session); } else { diff --git a/Content.Server/ImmovableRod/ImmovableRodSystem.cs b/Content.Server/ImmovableRod/ImmovableRodSystem.cs index 988748b0d4..e684139682 100644 --- a/Content.Server/ImmovableRod/ImmovableRodSystem.cs +++ b/Content.Server/ImmovableRod/ImmovableRodSystem.cs @@ -81,8 +81,7 @@ public sealed class ImmovableRodSystem : EntitySystem { // oh god. var coords = Transform(uid).Coordinates; - _popup.PopupCoordinates(Loc.GetString("immovable-rod-collided-rod-not-good"), coords, - Filter.Pvs(uid), PopupType.LargeCaution); + _popup.PopupCoordinates(Loc.GetString("immovable-rod-collided-rod-not-good"), coords, PopupType.LargeCaution); Del(uid); Del(ent); @@ -96,8 +95,7 @@ public sealed class ImmovableRodSystem : EntitySystem { component.MobCount++; - _popup.PopupEntity(Loc.GetString("immovable-rod-penetrated-mob", ("rod", uid), ("mob", ent)), uid, - Filter.Pvs(uid), PopupType.LargeCaution); + _popup.PopupEntity(Loc.GetString("immovable-rod-penetrated-mob", ("rod", uid), ("mob", ent)), uid, PopupType.LargeCaution); _bodySystem.GibBody(ent, body: body); } diff --git a/Content.Server/Implants/ImplanterSystem.cs b/Content.Server/Implants/ImplanterSystem.cs index f5902db56c..be0fb789ca 100644 --- a/Content.Server/Implants/ImplanterSystem.cs +++ b/Content.Server/Implants/ImplanterSystem.cs @@ -1,4 +1,4 @@ -using System.Threading; +using System.Threading; using Content.Server.DoAfter; using Content.Server.Guardian; using Content.Server.Popups; @@ -84,10 +84,10 @@ public sealed partial class ImplanterSystem : SharedImplanterSystem /// The implanter being used public void TryImplant(ImplanterComponent component, EntityUid user, EntityUid target, EntityUid implanter) { - _popup.PopupEntity(Loc.GetString("injector-component-injecting-user"), target, Filter.Entities(user)); + _popup.PopupEntity(Loc.GetString("injector-component-injecting-user"), target, user); var userName = Identity.Entity(user, EntityManager); - _popup.PopupEntity(Loc.GetString("implanter-component-implanting-target", ("user", userName)), user, Filter.Entities(target), PopupType.LargeCaution); + _popup.PopupEntity(Loc.GetString("implanter-component-implanting-target", ("user", userName)), user, target, PopupType.LargeCaution); component.CancelToken?.Cancel(); component.CancelToken = new CancellationTokenSource(); @@ -113,7 +113,7 @@ public sealed partial class ImplanterSystem : SharedImplanterSystem //TODO: Remove when surgery is in public void TryDraw(ImplanterComponent component, EntityUid user, EntityUid target, EntityUid implanter) { - _popup.PopupEntity(Loc.GetString("injector-component-injecting-user"), target, Filter.Entities(user)); + _popup.PopupEntity(Loc.GetString("injector-component-injecting-user"), target, user); component.CancelToken?.Cancel(); component.CancelToken = new CancellationTokenSource(); diff --git a/Content.Server/Instruments/SwappableInstrumentSystem.cs b/Content.Server/Instruments/SwappableInstrumentSystem.cs index 30cdf7de21..465cdb7fdf 100644 --- a/Content.Server/Instruments/SwappableInstrumentSystem.cs +++ b/Content.Server/Instruments/SwappableInstrumentSystem.cs @@ -37,7 +37,7 @@ public sealed class SwappableInstrumentSystem : EntitySystem { _sharedInstrument.SetInstrumentProgram(instrument, entry.Value.Item1, entry.Value.Item2); _popup.PopupEntity(Loc.GetString("swappable-instrument-component-style-set", ("style", entry.Key)), - args.User, Filter.Entities(args.User)); + args.User, args.User); } }; diff --git a/Content.Server/Interaction/InteractionPopupSystem.cs b/Content.Server/Interaction/InteractionPopupSystem.cs index ff66be5cc1..3820baeba1 100644 --- a/Content.Server/Interaction/InteractionPopupSystem.cs +++ b/Content.Server/Interaction/InteractionPopupSystem.cs @@ -68,11 +68,11 @@ public sealed class InteractionPopupSystem : EntitySystem { string msgOthers = Loc.GetString(component.MessagePerceivedByOthers, ("user", Identity.Entity(args.User, EntityManager)), ("target", Identity.Entity(uid, EntityManager))); - _popupSystem.PopupEntity(msg, uid, Filter.Entities(args.User)); - _popupSystem.PopupEntity(msgOthers, uid, Filter.Pvs(uid, 2F, EntityManager).RemoveWhereAttachedEntity(puid => puid == args.User)); + _popupSystem.PopupEntity(msg, uid, args.User); + _popupSystem.PopupEntity(msgOthers, uid, Filter.PvsExcept(args.User, entityManager: EntityManager), true); } else - _popupSystem.PopupEntity(msg, uid, Filter.Entities(args.User)); //play only for the initiating entity. + _popupSystem.PopupEntity(msg, uid, args.User); //play only for the initiating entity. if (sfx is not null) //not all cases will have sound. { diff --git a/Content.Server/Kitchen/EntitySystems/KitchenSpikeSystem.cs b/Content.Server/Kitchen/EntitySystems/KitchenSpikeSystem.cs index 025f8457b2..c8692194d1 100644 --- a/Content.Server/Kitchen/EntitySystems/KitchenSpikeSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/KitchenSpikeSystem.cs @@ -92,7 +92,7 @@ namespace Content.Server.Kitchen.EntitySystems return; if (component.PrototypesToSpawn?.Count > 0) { - _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-knife-needed"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-knife-needed"), uid, args.User); args.Handled = true; } } @@ -124,8 +124,7 @@ namespace Content.Server.Kitchen.EntitySystems UpdateAppearance(uid, null, component); - _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-kill", ("user", Identity.Entity(userUid, EntityManager)), ("victim", victimUid)), uid, - Filter.Pvs(userUid), PopupType.LargeCaution); + _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-kill", ("user", Identity.Entity(userUid, EntityManager)), ("victim", victimUid)), uid, PopupType.LargeCaution); // THE WHAT? // TODO: Need to be able to leave them on the spike to do DoT, see ss13. @@ -154,12 +153,12 @@ namespace Content.Server.Kitchen.EntitySystems if (component.PrototypesToSpawn.Count != 0) { - _popupSystem.PopupEntity(component.MeatSource1p, uid, Filter.Entities(user), PopupType.MediumCaution); + _popupSystem.PopupEntity(component.MeatSource1p, uid, user, PopupType.MediumCaution); } else { UpdateAppearance(uid, null, component); - _popupSystem.PopupEntity(component.MeatSource0, uid, Filter.Entities(user), PopupType.MediumCaution); + _popupSystem.PopupEntity(component.MeatSource0, uid, user, PopupType.MediumCaution); } return true; @@ -181,13 +180,13 @@ namespace Content.Server.Kitchen.EntitySystems if (component.PrototypesToSpawn?.Count > 0) { - _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-collect", ("this", uid)), uid, Filter.Entities(userUid)); + _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-collect", ("this", uid)), uid, userUid); return false; } if (!Resolve(victimUid, ref butcherable, false)) { - _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-butcher", ("victim", Identity.Entity(victimUid, EntityManager)), ("this", uid)), victimUid, Filter.Entities(userUid)); + _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-butcher", ("victim", Identity.Entity(victimUid, EntityManager)), ("this", uid)), victimUid, userUid); return false; } @@ -196,10 +195,10 @@ namespace Content.Server.Kitchen.EntitySystems case ButcheringType.Spike: return true; case ButcheringType.Knife: - _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-butcher-knife", ("victim", Identity.Entity(victimUid, EntityManager)), ("this", uid)), victimUid, Filter.Entities(userUid)); + _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-butcher-knife", ("victim", Identity.Entity(victimUid, EntityManager)), ("this", uid)), victimUid, userUid); return false; default: - _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-butcher", ("victim", Identity.Entity(victimUid, EntityManager)), ("this", uid)), victimUid, Filter.Entities(userUid)); + _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-butcher", ("victim", Identity.Entity(victimUid, EntityManager)), ("this", uid)), victimUid, userUid); return false; } } @@ -217,14 +216,13 @@ namespace Content.Server.Kitchen.EntitySystems !mobState.IsDead()) { _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-not-dead", ("victim", Identity.Entity(victimUid, EntityManager))), - victimUid, Filter.Entities(userUid)); + victimUid, userUid); return true; } if (userUid != victimUid) { - _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-begin-hook-victim", ("user", Identity.Entity(userUid, EntityManager)), ("this", uid)), victimUid, - Filter.Entities(victimUid), PopupType.LargeCaution); + _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-begin-hook-victim", ("user", Identity.Entity(userUid, EntityManager)), ("this", uid)), victimUid, victimUid, PopupType.LargeCaution); } // TODO: make it work when SuicideEvent is implemented // else diff --git a/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs b/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs index 9ec5686f46..5bca202a44 100644 --- a/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs @@ -210,8 +210,8 @@ namespace Content.Server.Kitchen.EntitySystems ? Loc.GetString("microwave-component-suicide-multi-head-message") : Loc.GetString("microwave-component-suicide-message"); - _popupSystem.PopupEntity(othersMessage, victim, Filter.PvsExcept(victim)); - _popupSystem.PopupEntity(selfMessage, victim, Filter.Entities(victim)); + _popupSystem.PopupEntity(othersMessage, victim, Filter.PvsExcept(victim), true); + _popupSystem.PopupEntity(selfMessage, victim, victim); _audio.PlayPvs(component.ClickSound, uid, AudioParams.Default.WithVolume(-2)); component.CurrentCookTimerTime = 10; @@ -230,19 +230,19 @@ namespace Content.Server.Kitchen.EntitySystems return; if (!(TryComp(uid, out var apc) && apc.Powered)) { - _popupSystem.PopupEntity(Loc.GetString("microwave-component-interact-using-no-power"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("microwave-component-interact-using-no-power"), uid, args.User); return; } if (component.Broken) { - _popupSystem.PopupEntity(Loc.GetString("microwave-component-interact-using-broken"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("microwave-component-interact-using-broken"), uid, args.User); return; } if (!HasComp(args.Used)) { - _popupSystem.PopupEntity(Loc.GetString("microwave-component-interact-using-transfer-fail"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("microwave-component-interact-using-transfer-fail"), uid, args.User); return; } diff --git a/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs b/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs index c1ce59777d..1d731ef436 100644 --- a/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs @@ -141,7 +141,7 @@ namespace Content.Server.Kitchen.EntitySystems if (!HasComp(heldEnt)) { // This is ugly but we can't use whitelistFailPopup because there are 2 containers with different whitelists. - _popupSystem.PopupEntity(Loc.GetString("reagent-grinder-component-cannot-put-entity-message"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("reagent-grinder-component-cannot-put-entity-message"), uid, args.User); } // Entity did NOT pass the whitelist for grind/juice. diff --git a/Content.Server/Kitchen/EntitySystems/SharpSystem.cs b/Content.Server/Kitchen/EntitySystems/SharpSystem.cs index 7d10b04274..87043994bc 100644 --- a/Content.Server/Kitchen/EntitySystems/SharpSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/SharpSystem.cs @@ -107,7 +107,7 @@ public sealed class SharpSystem : EntitySystem popupType = PopupType.LargeCaution; _popupSystem.PopupEntity(Loc.GetString("butcherable-knife-butchered-success", ("target", ev.Entity), ("knife", ev.Sharp)), - popupEnt, Filter.Entities(ev.User), popupType); + popupEnt, ev.User, popupType); if (hasBody) _bodySystem.GibBody(body!.Owner, body: body); diff --git a/Content.Server/Labels/Label/HandLabelerSystem.cs b/Content.Server/Labels/Label/HandLabelerSystem.cs index ea8cd01071..1f50906bec 100644 --- a/Content.Server/Labels/Label/HandLabelerSystem.cs +++ b/Content.Server/Labels/Label/HandLabelerSystem.cs @@ -45,9 +45,9 @@ namespace Content.Server.Labels { Act = () => { - AddLabelTo(uid, handLabeler, target, out string? result); + AddLabelTo(uid, handLabeler, target, out var result); if (result != null) - _popupSystem.PopupEntity(result, args.User, Filter.Entities(args.User)); + _popupSystem.PopupEntity(result, args.User, args.User); }, Text = labelerText }; @@ -62,7 +62,7 @@ namespace Content.Server.Labels AddLabelTo(uid, handLabeler, target, out string? result); if (result == null) return; - _popupSystem.PopupEntity(result, args.User, Filter.Entities(args.User)); + _popupSystem.PopupEntity(result, args.User, args.User); // Log labeling _adminLogger.Add(LogType.Action, LogImpact.Low, diff --git a/Content.Server/LandMines/LandMineSystem.cs b/Content.Server/LandMines/LandMineSystem.cs index b8b6b15ed2..78c48ef99e 100644 --- a/Content.Server/LandMines/LandMineSystem.cs +++ b/Content.Server/LandMines/LandMineSystem.cs @@ -35,7 +35,7 @@ public sealed class LandMineSystem : EntitySystem _popupSystem.PopupCoordinates( Loc.GetString("land-mine-triggered", ("mine", uid)), Transform(uid).Coordinates, - Filter.Entities(args.Tripper), + args.Tripper, PopupType.LargeCaution); } } diff --git a/Content.Server/Light/EntitySystems/HandheldLightSystem.cs b/Content.Server/Light/EntitySystems/HandheldLightSystem.cs index 5227ff6e0e..f66460d52f 100644 --- a/Content.Server/Light/EntitySystems/HandheldLightSystem.cs +++ b/Content.Server/Light/EntitySystems/HandheldLightSystem.cs @@ -210,7 +210,7 @@ namespace Content.Server.Light.EntitySystems !TryComp(component.Owner, out battery)) { SoundSystem.Play(component.TurnOnFailSound.GetSound(), Filter.Pvs(component.Owner, entityManager: EntityManager), component.Owner); - _popup.PopupEntity(Loc.GetString("handheld-light-component-cell-missing-message"), component.Owner, Filter.Entities(user)); + _popup.PopupEntity(Loc.GetString("handheld-light-component-cell-missing-message"), component.Owner, user); return false; } @@ -220,7 +220,7 @@ namespace Content.Server.Light.EntitySystems if (component.Wattage > battery.CurrentCharge) { SoundSystem.Play(component.TurnOnFailSound.GetSound(), Filter.Pvs(component.Owner, entityManager: EntityManager), component.Owner); - _popup.PopupEntity(Loc.GetString("handheld-light-component-cell-dead-message"), component.Owner, Filter.Entities(user)); + _popup.PopupEntity(Loc.GetString("handheld-light-component-cell-dead-message"), component.Owner, user); return false; } diff --git a/Content.Server/Light/EntitySystems/LightReplacerSystem.cs b/Content.Server/Light/EntitySystems/LightReplacerSystem.cs index 24c0791865..1e70c3b078 100644 --- a/Content.Server/Light/EntitySystems/LightReplacerSystem.cs +++ b/Content.Server/Light/EntitySystems/LightReplacerSystem.cs @@ -121,7 +121,7 @@ namespace Content.Server.Light.EntitySystems { var msg = Loc.GetString("comp-light-replacer-missing-light", ("light-replacer", replacer.Owner)); - _popupSystem.PopupEntity(msg, replacerUid, Filter.Entities(userUid.Value)); + _popupSystem.PopupEntity(msg, replacerUid, userUid.Value); } return false; } @@ -157,7 +157,7 @@ namespace Content.Server.Light.EntitySystems if (showTooltip && userUid != null) { var msg = Loc.GetString("comp-light-replacer-insert-broken-light"); - _popupSystem.PopupEntity(msg, replacerUid, Filter.Entities(userUid.Value)); + _popupSystem.PopupEntity(msg, replacerUid, userUid.Value); } return false; @@ -169,7 +169,7 @@ namespace Content.Server.Light.EntitySystems { var msg = Loc.GetString("comp-light-replacer-insert-light", ("light-replacer", replacer.Owner), ("bulb", bulb.Owner)); - _popupSystem.PopupEntity(msg, replacerUid, Filter.Entities(userUid.Value), PopupType.Medium); + _popupSystem.PopupEntity(msg, replacerUid, userUid.Value, PopupType.Medium); } return hasInsert; @@ -208,7 +208,7 @@ namespace Content.Server.Light.EntitySystems if (insertedBulbs > 0 && userUid != null) { var msg = Loc.GetString("comp-light-replacer-refill-from-storage", ("light-replacer", storage.Owner)); - _popupSystem.PopupEntity(msg, replacerUid, Filter.Entities(userUid.Value), PopupType.Medium); + _popupSystem.PopupEntity(msg, replacerUid, userUid.Value, PopupType.Medium); } return insertedBulbs > 0; diff --git a/Content.Server/Light/EntitySystems/PoweredLightSystem.cs b/Content.Server/Light/EntitySystems/PoweredLightSystem.cs index 0d870e6b45..395497ba21 100644 --- a/Content.Server/Light/EntitySystems/PoweredLightSystem.cs +++ b/Content.Server/Light/EntitySystems/PoweredLightSystem.cs @@ -115,7 +115,7 @@ namespace Content.Server.Light.EntitySystems { // apply damage to users hands and show message with sound var burnMsg = Loc.GetString("powered-light-component-burn-hand"); - _popupSystem.PopupEntity(burnMsg, uid, Filter.Entities(userUid)); + _popupSystem.PopupEntity(burnMsg, uid, userUid); var damage = _damageableSystem.TryChangeDamage(userUid, light.Damage, origin: userUid); diff --git a/Content.Server/Lock/LockSystem.cs b/Content.Server/Lock/LockSystem.cs index 6088740d04..27057b6bf1 100644 --- a/Content.Server/Lock/LockSystem.cs +++ b/Content.Server/Lock/LockSystem.cs @@ -66,7 +66,7 @@ namespace Content.Server.Lock if (component.Locked) { if (!args.Silent) - _sharedPopupSystem.PopupEntity(Loc.GetString("entity-storage-component-locked-message"), uid, Filter.Pvs(uid)); + _sharedPopupSystem.PopupEntity(Loc.GetString("entity-storage-component-locked-message"), uid); args.Cancel(); } diff --git a/Content.Server/MachineLinking/System/SignalLinkerSystem.cs b/Content.Server/MachineLinking/System/SignalLinkerSystem.cs index b6a5c2b9b9..98bc32c951 100644 --- a/Content.Server/MachineLinking/System/SignalLinkerSystem.cs +++ b/Content.Server/MachineLinking/System/SignalLinkerSystem.cs @@ -12,6 +12,7 @@ using Robust.Shared.Player; using Content.Shared.Verbs; using Robust.Shared.Prototypes; using Content.Shared.MachineLinking.Events; +using Content.Server.Database; namespace Content.Server.MachineLinking.System { @@ -89,7 +90,7 @@ namespace Content.Server.MachineLinking.System var msg = TryLinkDefaults(uid, linker.SavedTransmitter.Value, args.User, component) ? Loc.GetString("signal-linking-verb-success", ("machine", linker.SavedTransmitter.Value)) : Loc.GetString("signal-linking-verb-fail", ("machine", linker.SavedTransmitter.Value)); - _popupSystem.PopupEntity(msg, uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(msg, uid, args.User); }; return; } @@ -121,7 +122,7 @@ namespace Content.Server.MachineLinking.System var msg = TryLinkDefaults(linker.SavedReceiver.Value, uid, args.User, null, component) ? Loc.GetString("signal-linking-verb-success", ("machine", linker.SavedReceiver.Value)) : Loc.GetString("signal-linking-verb-fail", ("machine", linker.SavedReceiver.Value)); - _popupSystem.PopupEntity(msg, uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(msg, uid, args.User); }; return; } @@ -213,7 +214,7 @@ namespace Content.Server.MachineLinking.System if (!TryComp(linker.SavedReceiver, out SignalReceiverComponent? receiver)) { _popupSystem.PopupCursor(Loc.GetString("signal-linker-component-saved", ("machine", uid)), - Filter.Entities(args.User), PopupType.Medium); + args.User, PopupType.Medium); args.Handled = true; return; } @@ -239,7 +240,7 @@ namespace Content.Server.MachineLinking.System if (!TryComp(linker.SavedTransmitter, out SignalTransmitterComponent? transmitter)) { _popupSystem.PopupCursor(Loc.GetString("signal-linker-component-saved", ("machine", uid)), - Filter.Entities(args.User), PopupType.Medium); + args.User, PopupType.Medium); args.Handled = true; return; } @@ -287,8 +288,7 @@ namespace Content.Server.MachineLinking.System !receiver.Inputs.TryGetValue(args.ReceiverPort, out var linkedTransmitters)) return false; - // Accounts for possibly missing user & the quiet option. - var alertFilter = (!quiet && user != null) ? Filter.Entities(user.Value) : null; + quiet |= !user.HasValue; // Does the link already exist? Under the assumption that nothing has broken, lets only check the // transmitter ports. @@ -300,9 +300,8 @@ namespace Content.Server.MachineLinking.System if (checkRange && !IsInRange(transmitter, receiver)) { - if (alertFilter != null) - _popupSystem.PopupCursor(Loc.GetString("signal-linker-component-out-of-range"), - alertFilter); + if (!quiet) + _popupSystem.PopupCursor(Loc.GetString("signal-linker-component-out-of-range"), user!.Value); return false; } @@ -311,27 +310,25 @@ namespace Content.Server.MachineLinking.System RaiseLocalEvent(transmitter.Owner, linkAttempt, true); if (linkAttempt.Cancelled) { - if (alertFilter != null) - _popupSystem.PopupCursor(Loc.GetString("signal-linker-component-connection-refused", ("machine", transmitter.Owner)), - alertFilter); + if (!quiet) + _popupSystem.PopupCursor(Loc.GetString("signal-linker-component-connection-refused", ("machine", transmitter.Owner)), user!.Value); return false; } RaiseLocalEvent(receiver.Owner, linkAttempt, true); if (linkAttempt.Cancelled) { - if (alertFilter != null) - _popupSystem.PopupCursor(Loc.GetString("signal-linker-component-connection-refused", ("machine", receiver.Owner)), - alertFilter); + if (!quiet) + _popupSystem.PopupCursor(Loc.GetString("signal-linker-component-connection-refused", ("machine", receiver.Owner)), user!.Value); return false; } linkedReceivers.Add(new(receiver.Owner, args.ReceiverPort)); linkedTransmitters.Add(new(transmitter.Owner, args.TransmitterPort)); - if (alertFilter != null) + if (!quiet) _popupSystem.PopupCursor(Loc.GetString("signal-linker-component-linked-port", ("machine1", transmitter.Owner), ("port1", PortName(args.TransmitterPort)), ("machine2", receiver.Owner), ("port2", PortName(args.ReceiverPort))), - alertFilter, PopupType.Medium); + user!.Value, PopupType.Medium); var newLink = new NewLinkEvent(user, transmitter.Owner, args.TransmitterPort, receiver.Owner, args.ReceiverPort); RaiseLocalEvent(receiver.Owner, newLink); @@ -362,7 +359,7 @@ namespace Content.Server.MachineLinking.System _popupSystem.PopupCursor(Loc.GetString("signal-linker-component-unlinked-port", ("machine1", transmitter.Owner), ("port1", PortName(args.TransmitterPort)), ("machine2", receiver.Owner), ("port2", PortName(args.ReceiverPort))), - Filter.Entities(attached), PopupType.Medium); + attached, PopupType.Medium); } else { // something weird happened diff --git a/Content.Server/Materials/MaterialStorageSystem.cs b/Content.Server/Materials/MaterialStorageSystem.cs index 18ccc1ce12..5215262d72 100644 --- a/Content.Server/Materials/MaterialStorageSystem.cs +++ b/Content.Server/Materials/MaterialStorageSystem.cs @@ -23,7 +23,7 @@ public sealed class MaterialStorageSystem : SharedMaterialStorageSystem return false; _audio.PlayPvs(component.InsertingSound, component.Owner); _popup.PopupEntity(Loc.GetString("machine-insert-item", ("user", user), ("machine", component.Owner), - ("item", toInsert)), component.Owner, Filter.Pvs(component.Owner)); + ("item", toInsert)), component.Owner); QueueDel(toInsert); return true; } diff --git a/Content.Server/Mech/Systems/MechEquipmentSystem.cs b/Content.Server/Mech/Systems/MechEquipmentSystem.cs index e6f1c72e9f..087c2e3aa3 100644 --- a/Content.Server/Mech/Systems/MechEquipmentSystem.cs +++ b/Content.Server/Mech/Systems/MechEquipmentSystem.cs @@ -48,7 +48,7 @@ public sealed class MechEquipmentSystem : EntitySystem if (mechComp.EquipmentWhitelist != null && !mechComp.EquipmentWhitelist.IsValid(uid)) return; - _popup.PopupEntity(Loc.GetString("mech-equipment-begin-install", ("item", uid)), mech, Filter.Pvs(mech)); + _popup.PopupEntity(Loc.GetString("mech-equipment-begin-install", ("item", uid)), mech); component.TokenSource = new(); _doAfter.DoAfter(new DoAfterEventArgs(args.User, component.InstallDuration, component.TokenSource.Token, mech, uid) @@ -64,7 +64,7 @@ public sealed class MechEquipmentSystem : EntitySystem private void OnFinished(EntityUid uid, MechEquipmentComponent component, MechEquipmentInstallFinished args) { component.TokenSource = null; - _popup.PopupEntity(Loc.GetString("mech-equipment-finish-install", ("item", uid)), args.Mech, Filter.Pvs(args.Mech)); + _popup.PopupEntity(Loc.GetString("mech-equipment-finish-install", ("item", uid)), args.Mech); _mech.InsertEquipment(args.Mech, uid); } diff --git a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs index 9335a9ac19..aae82fcc37 100644 --- a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs +++ b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs @@ -112,7 +112,7 @@ namespace Content.Server.Medical.BiomassReclaimer if (TryComp(uid, out var power) && !power.Powered) return; - _popup.PopupEntity(Loc.GetString("biomass-reclaimer-suicide-others", ("victim", args.Victim)), uid, Filter.Pvs(uid), PopupType.LargeCaution); + _popup.PopupEntity(Loc.GetString("biomass-reclaimer-suicide-others", ("victim", args.Victim)), uid, PopupType.LargeCaution); StartProcessing(args.Victim, component); args.SetHandled(SuicideKind.Blunt); } diff --git a/Content.Server/Medical/HealthAnalyzerSystem.cs b/Content.Server/Medical/HealthAnalyzerSystem.cs index 0f02306edd..491b83b607 100644 --- a/Content.Server/Medical/HealthAnalyzerSystem.cs +++ b/Content.Server/Medical/HealthAnalyzerSystem.cs @@ -81,11 +81,11 @@ namespace Content.Server.Medical if (args.User == args.Target) { _popupSystem.PopupEntity(Loc.GetString("disease-scanner-gave-self", ("disease", args.Component.Disease)), - args.User, Filter.Entities(args.User)); + args.User, args.User); return; } _popupSystem.PopupEntity(Loc.GetString("disease-scanner-gave-other", ("target", Identity.Entity(args.Target.Value, EntityManager)), ("disease", args.Component.Disease)), - args.User, Filter.Entities(args.User)); + args.User, args.User); } private void OpenUserInterface(EntityUid user, HealthAnalyzerComponent healthAnalyzer) diff --git a/Content.Server/Medical/Stethoscope/StethoscopeSystem.cs b/Content.Server/Medical/Stethoscope/StethoscopeSystem.cs index 1233c83152..e8e0b4aa28 100644 --- a/Content.Server/Medical/Stethoscope/StethoscopeSystem.cs +++ b/Content.Server/Medical/Stethoscope/StethoscopeSystem.cs @@ -137,7 +137,7 @@ namespace Content.Server.Medical /// The mob check seems a bit redundant but (1) they could conceivably have lost it since when the doafter started and (2) I need it for .IsDead() if (!HasComp(target) || !TryComp(target, out var mobState) || mobState.IsDead()) { - _popupSystem.PopupEntity(Loc.GetString("stethoscope-dead"), target, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString("stethoscope-dead"), target, user); return; } @@ -149,7 +149,7 @@ namespace Content.Server.Medical var message = GetDamageMessage(value); - _popupSystem.PopupEntity(Loc.GetString(message), target, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString(message), target, user); } private string GetDamageMessage(FixedPoint2 totalOxyloss) diff --git a/Content.Server/Medical/SuitSensors/SuitSensorSystem.cs b/Content.Server/Medical/SuitSensors/SuitSensorSystem.cs index cd65d46c42..7664f69404 100644 --- a/Content.Server/Medical/SuitSensors/SuitSensorSystem.cs +++ b/Content.Server/Medical/SuitSensors/SuitSensorSystem.cs @@ -216,7 +216,7 @@ namespace Content.Server.Medical.SuitSensors if (userUid != null) { var msg = Loc.GetString("suit-sensor-mode-state", ("mode", GetModeName(mode))); - _popupSystem.PopupEntity(msg, uid, Filter.Entities(userUid.Value)); + _popupSystem.PopupEntity(msg, uid, userUid.Value); } } diff --git a/Content.Server/Medical/VomitSystem.cs b/Content.Server/Medical/VomitSystem.cs index 1d08058f66..312d83eb3d 100644 --- a/Content.Server/Medical/VomitSystem.cs +++ b/Content.Server/Medical/VomitSystem.cs @@ -53,7 +53,7 @@ namespace Content.Server.Medical SoundSystem.Play("/Audio/Effects/Fluids/splat.ogg", Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.2f).WithVolume(-4f)); - _popupSystem.PopupEntity(Loc.GetString("disease-vomit", ("person", Identity.Entity(uid, EntityManager))), uid, Filter.Pvs(uid)); + _popupSystem.PopupEntity(Loc.GetString("disease-vomit", ("person", Identity.Entity(uid, EntityManager))), uid); // Get the solution of the puddle we spawned if (!_solutionSystem.TryGetSolution(puddle, puddleComp.SolutionName, out var puddleSolution)) return; diff --git a/Content.Server/Morgue/CrematoriumSystem.cs b/Content.Server/Morgue/CrematoriumSystem.cs index 34cd85f1c0..7a3c0589bf 100644 --- a/Content.Server/Morgue/CrematoriumSystem.cs +++ b/Content.Server/Morgue/CrematoriumSystem.cs @@ -140,13 +140,13 @@ public sealed class CrematoriumSystem : EntitySystem if (mind.OwnedEntity is { Valid: true } entity) { - _popup.PopupEntity(Loc.GetString("crematorium-entity-storage-component-suicide-message"), entity, Filter.Pvs(entity)); + _popup.PopupEntity(Loc.GetString("crematorium-entity-storage-component-suicide-message"), entity); } } _popup.PopupEntity(Loc.GetString("crematorium-entity-storage-component-suicide-message-others", ("victim", Identity.Entity(victim, EntityManager))), - victim, Filter.PvsExcept(victim), PopupType.LargeCaution); + victim, Filter.PvsExcept(victim), true, PopupType.LargeCaution); if (_entityStorage.CanInsert(uid)) { diff --git a/Content.Server/Mousetrap/MousetrapSystem.cs b/Content.Server/Mousetrap/MousetrapSystem.cs index f10eb1747f..005e388630 100644 --- a/Content.Server/Mousetrap/MousetrapSystem.cs +++ b/Content.Server/Mousetrap/MousetrapSystem.cs @@ -30,7 +30,7 @@ public sealed class MousetrapSystem : EntitySystem ? Loc.GetString("mousetrap-on-activate") : Loc.GetString("mousetrap-on-deactivate"), uid, - Filter.Entities(args.User)); + args.User); UpdateVisuals(uid); } diff --git a/Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/MedibotInjectOperator.cs b/Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/MedibotInjectOperator.cs index 5693311d83..eadeb67d48 100644 --- a/Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/MedibotInjectOperator.cs +++ b/Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/MedibotInjectOperator.cs @@ -68,7 +68,7 @@ public sealed class MedibotInjectOperator : HTNOperator if (damage.TotalDamage >= MedibotComponent.EmergencyMedDamageThreshold) { _solutionSystem.TryAddReagent(target, injectable, botComp.EmergencyMed, botComp.EmergencyMedInjectAmount, out var accepted); - _popupSystem.PopupEntity(Loc.GetString("hypospray-component-feel-prick-message"), target, Filter.Entities(target)); + _popupSystem.PopupEntity(Loc.GetString("hypospray-component-feel-prick-message"), target, target); SoundSystem.Play("/Audio/Items/hypospray.ogg", Filter.Pvs(target), target); _chat.TrySendInGameICMessage(owner, Loc.GetString("medibot-finish-inject"), InGameICChatType.Speak, hideChat: false, hideGlobalGhostChat: true); return HTNOperatorStatus.Finished; @@ -77,7 +77,7 @@ public sealed class MedibotInjectOperator : HTNOperator if (damage.TotalDamage >= MedibotComponent.StandardMedDamageThreshold) { _solutionSystem.TryAddReagent(target, injectable, botComp.StandardMed, botComp.StandardMedInjectAmount, out var accepted); - _popupSystem.PopupEntity(Loc.GetString("hypospray-component-feel-prick-message"), target, Filter.Entities(target)); + _popupSystem.PopupEntity(Loc.GetString("hypospray-component-feel-prick-message"), target, target); SoundSystem.Play("/Audio/Items/hypospray.ogg", Filter.Pvs(target), target); _chat.TrySendInGameICMessage(owner, Loc.GetString("medibot-finish-inject"), InGameICChatType.Speak, hideChat: false, hideGlobalGhostChat: true); return HTNOperatorStatus.Finished; diff --git a/Content.Server/Nuke/NukeSystem.cs b/Content.Server/Nuke/NukeSystem.cs index 12169a061b..509417c628 100644 --- a/Content.Server/Nuke/NukeSystem.cs +++ b/Content.Server/Nuke/NukeSystem.cs @@ -151,7 +151,7 @@ namespace Content.Server.Nuke if (component.Status == NukeStatus.ARMED) { var msg = Loc.GetString("nuke-component-cant-anchor"); - _popups.PopupEntity(msg, uid, Filter.Entities(args.User)); + _popups.PopupEntity(msg, uid, args.User); args.Cancel(); } @@ -591,7 +591,7 @@ namespace Content.Server.Nuke _doAfterSystem.DoAfter(doafter); _popups.PopupEntity(Loc.GetString("nuke-component-doafter-warning"), user, - Filter.Entities(user), PopupType.LargeCaution); + user, PopupType.LargeCaution); } private void NukeArmedAudio(NukeComponent component) diff --git a/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs b/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs index 7e726aceeb..37e173e4ee 100644 --- a/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs @@ -231,7 +231,7 @@ namespace Content.Server.Nutrition.EntitySystems if (!drink.Opened) { _popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-not-open", - ("owner", EntityManager.GetComponent(drink.Owner).EntityName)), drink.Owner, Filter.Entities(user)); + ("owner", EntityManager.GetComponent(drink.Owner).EntityName)), drink.Owner, user); return true; } @@ -239,7 +239,7 @@ namespace Content.Server.Nutrition.EntitySystems drinkSolution.DrainAvailable <= 0) { _popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty", - ("entity", EntityManager.GetComponent(drink.Owner).EntityName)), drink.Owner, Filter.Entities(user)); + ("entity", EntityManager.GetComponent(drink.Owner).EntityName)), drink.Owner, user); return true; } @@ -256,7 +256,7 @@ namespace Content.Server.Nutrition.EntitySystems var userName = Identity.Entity(user, EntityManager); _popupSystem.PopupEntity(Loc.GetString("drink-component-force-feed", ("user", userName)), - user, Filter.Entities(target)); + user, target); // logging _adminLogger.Add(LogType.ForceFeed, LogImpact.Medium, $"{ToPrettyString(user):user} is forcing {ToPrettyString(target):target} to drink {ToPrettyString(drink.Owner):drink} {SolutionContainerSystem.ToPrettyString(drinkSolution)}"); @@ -308,7 +308,7 @@ namespace Content.Server.Nutrition.EntitySystems forceDrink ? Loc.GetString("drink-component-try-use-drink-cannot-drink-other") : Loc.GetString("drink-component-try-use-drink-had-enough"), - uid, Filter.Entities(args.User)); + uid, args.User); if (EntityManager.HasComponent(uid)) { @@ -327,12 +327,12 @@ namespace Content.Server.Nutrition.EntitySystems if (firstStomach == null) { _popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-had-enough"), - uid, Filter.Entities(uid)); + uid, uid); if (forceDrink) { _popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-had-enough-other"), - uid, Filter.Entities(args.User)); + uid, args.User); _spillableSystem.SpillAt(uid, drained, "PuddleSmear"); } else @@ -351,11 +351,11 @@ namespace Content.Server.Nutrition.EntitySystems var userName = Identity.Entity(args.User, EntityManager); _popupSystem.PopupEntity( - Loc.GetString("drink-component-force-feed-success", ("user", userName), ("flavors", flavors)), uid, Filter.Entities(uid)); + Loc.GetString("drink-component-force-feed-success", ("user", userName), ("flavors", flavors)), uid, uid); _popupSystem.PopupEntity( Loc.GetString("drink-component-force-feed-success-user", ("target", targetName)), - args.User, Filter.Entities(args.User)); + args.User, args.User); // log successful forced drinking _adminLogger.Add(LogType.ForceFeed, LogImpact.Medium, $"{ToPrettyString(uid):user} forced {ToPrettyString(args.User):target} to drink {ToPrettyString(args.Drink.Owner):drink}"); @@ -364,9 +364,9 @@ namespace Content.Server.Nutrition.EntitySystems { _popupSystem.PopupEntity( Loc.GetString("drink-component-try-use-drink-success-slurp-taste", ("flavors", flavors)), args.User, - Filter.Entities(args.User)); + args.User); _popupSystem.PopupEntity( - Loc.GetString("drink-component-try-use-drink-success-slurp"), args.User, Filter.PvsExcept(args.User)); + Loc.GetString("drink-component-try-use-drink-success-slurp"), args.User, Filter.PvsExcept(args.User), true); // log successful voluntary drinking _adminLogger.Add(LogType.Ingestion, LogImpact.Low, $"{ToPrettyString(args.User):target} drank {ToPrettyString(args.Drink.Owner):drink}"); diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index c00313432e..72f8678441 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -99,7 +99,7 @@ namespace Content.Server.Nutrition.EntitySystems if (food.UsesRemaining <= 0) { _popupSystem.PopupEntity(Loc.GetString("food-system-try-use-food-is-empty", - ("entity", food.Owner)), user, Filter.Entities(user)); + ("entity", food.Owner)), user, user); DeleteAndSpawnTrash(food, user); return false; } @@ -120,7 +120,7 @@ namespace Content.Server.Nutrition.EntitySystems { var userName = Identity.Entity(user, EntityManager); _popupSystem.PopupEntity(Loc.GetString("food-system-force-feed", ("user", userName)), - user, Filter.Entities(target)); + user, target); // logging _adminLogger.Add(LogType.ForceFeed, LogImpact.Medium, $"{ToPrettyString(user):user} is forcing {ToPrettyString(target):target} to eat {ToPrettyString(food.Owner):food} {SolutionContainerSystem.ToPrettyString(foodSolution)}"); @@ -180,7 +180,7 @@ namespace Content.Server.Nutrition.EntitySystems forceFeed ? Loc.GetString("food-system-you-cannot-eat-any-more-other") : Loc.GetString("food-system-you-cannot-eat-any-more") - , uid, Filter.Entities(args.User)); + , uid, args.User); return; } @@ -194,17 +194,17 @@ namespace Content.Server.Nutrition.EntitySystems var targetName = Identity.Entity(uid, EntityManager); var userName = Identity.Entity(args.User, EntityManager); _popupSystem.PopupEntity(Loc.GetString("food-system-force-feed-success", ("user", userName), ("flavors", flavors)), - uid, Filter.Entities(uid)); + uid, uid); _popupSystem.PopupEntity(Loc.GetString("food-system-force-feed-success-user", ("target", targetName)), - args.User, Filter.Entities(args.User)); + args.User, args.User); // log successful force feed _adminLogger.Add(LogType.ForceFeed, LogImpact.Medium, $"{ToPrettyString(uid):user} forced {ToPrettyString(args.User):target} to eat {ToPrettyString(args.Food.Owner):food}"); } else { - _popupSystem.PopupEntity(Loc.GetString(args.Food.EatMessage, ("food", args.Food.Owner), ("flavors", flavors)), args.User, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString(args.Food.EatMessage, ("food", args.Food.Owner), ("flavors", flavors)), args.User, args.User); // log successful voluntary eating _adminLogger.Add(LogType.Ingestion, LogImpact.Low, $"{ToPrettyString(args.User):target} ate {ToPrettyString(args.Food.Owner):food}"); @@ -309,7 +309,7 @@ namespace Content.Server.Nutrition.EntitySystems _adminLogger.Add(LogType.ForceFeed, $"{ToPrettyString(user.Value):user} threw {ToPrettyString(uid):food} {SolutionContainerSystem.ToPrettyString(foodSolution):solution} into the mouth of {ToPrettyString(target):target}"); var filter = user == null ? Filter.Entities(target) : Filter.Entities(target, user.Value); - _popupSystem.PopupEntity(Loc.GetString(food.EatMessage, ("food", food.Owner)), target, filter); + _popupSystem.PopupEntity(Loc.GetString(food.EatMessage, ("food", food.Owner)), target, filter, true); foodSolution.DoEntityReaction(uid, ReactionMethod.Ingestion); _stomachSystem.TryTransferSolution(((IComponent) firstStomach.Value.Comp).Owner, foodSolution, firstStomach.Value.Comp); @@ -352,7 +352,7 @@ namespace Content.Server.Nutrition.EntitySystems // If "required" field is set, try to block eating without proper utensils used if (component.UtensilRequired && (usedTypes & component.Utensil) != component.Utensil) { - _popupSystem.PopupEntity(Loc.GetString("food-you-need-to-hold-utensil", ("utensil", component.Utensil ^ usedTypes)), user, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString("food-you-need-to-hold-utensil", ("utensil", component.Utensil ^ usedTypes)), user, user); return false; } @@ -408,7 +408,7 @@ namespace Content.Server.Nutrition.EntitySystems { var name = EntityManager.GetComponent(attempt.Blocker.Value).EntityName; _popupSystem.PopupEntity(Loc.GetString("food-system-remove-mask", ("entity", name)), - uid, Filter.Entities(popupUid.Value)); + uid, popupUid.Value); } return attempt.Cancelled; diff --git a/Content.Server/Nutrition/EntitySystems/UtensilSystem.cs b/Content.Server/Nutrition/EntitySystems/UtensilSystem.cs index 543b4884f3..3a3b9918c4 100644 --- a/Content.Server/Nutrition/EntitySystems/UtensilSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/UtensilSystem.cs @@ -44,7 +44,7 @@ namespace Content.Server.Nutrition.EntitySystems //Prevents food usage with a wrong utensil if ((food.Utensil & component.Types) == 0) { - _popupSystem.PopupEntity(Loc.GetString("food-system-wrong-utensil", ("food", food.Owner), ("utensil", component.Owner)), user, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString("food-system-wrong-utensil", ("food", food.Owner), ("utensil", component.Owner)), user, user); return false; } diff --git a/Content.Server/PAI/PAISystem.cs b/Content.Server/PAI/PAISystem.cs index b3e1530a47..922b9b56ea 100644 --- a/Content.Server/PAI/PAISystem.cs +++ b/Content.Server/PAI/PAISystem.cs @@ -59,12 +59,12 @@ namespace Content.Server.PAI // Check for pAI activation if (EntityManager.TryGetComponent(uid, out var mind) && mind.HasMind) { - _popupSystem.PopupEntity(Loc.GetString("pai-system-pai-installed"), uid, Filter.Entities(args.User), PopupType.Large); + _popupSystem.PopupEntity(Loc.GetString("pai-system-pai-installed"), uid, args.User, PopupType.Large); return; } else if (EntityManager.HasComponent(uid)) { - _popupSystem.PopupEntity(Loc.GetString("pai-system-still-searching"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("pai-system-still-searching"), uid, args.User); return; } @@ -83,7 +83,7 @@ namespace Content.Server.PAI ghostFinder.RoleName = Loc.GetString("pai-system-role-name"); ghostFinder.RoleDescription = Loc.GetString("pai-system-role-description"); - _popupSystem.PopupEntity(Loc.GetString("pai-system-searching"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("pai-system-searching"), uid, args.User); UpdatePAIAppearance(uid, PAIStatus.Searching); } @@ -148,7 +148,7 @@ namespace Content.Server.PAI if (EntityManager.HasComponent(uid)) { EntityManager.RemoveComponent(uid); - _popupSystem.PopupEntity(Loc.GetString("pai-system-wiped-device"), uid, Filter.Entities(args.User), PopupType.Large); + _popupSystem.PopupEntity(Loc.GetString("pai-system-wiped-device"), uid, args.User, PopupType.Large); PAITurningOff(uid); } }; @@ -164,7 +164,7 @@ namespace Content.Server.PAI if (EntityManager.HasComponent(uid)) { EntityManager.RemoveComponent(uid); - _popupSystem.PopupEntity(Loc.GetString("pai-system-stopped-searching"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("pai-system-stopped-searching"), uid, args.User); PAITurningOff(uid); } }; diff --git a/Content.Server/Paper/PaperSystem.cs b/Content.Server/Paper/PaperSystem.cs index 7625390587..26eac88aa3 100644 --- a/Content.Server/Paper/PaperSystem.cs +++ b/Content.Server/Paper/PaperSystem.cs @@ -95,9 +95,9 @@ namespace Content.Server.Paper { // successfully stamped, play popup var stampPaperOtherMessage = Loc.GetString("paper-component-action-stamp-paper-other", ("user", Identity.Entity(args.User, EntityManager)),("target", Identity.Entity(args.Target, EntityManager)),("stamp", args.Used)); - _popupSystem.PopupEntity(stampPaperOtherMessage, args.User, Filter.Pvs(args.User, entityManager: EntityManager).RemoveWhereAttachedEntity(puid => puid == args.User)); + _popupSystem.PopupEntity(stampPaperOtherMessage, args.User, Filter.PvsExcept(args.User, entityManager: EntityManager), true); var stampPaperSelfMessage = Loc.GetString("paper-component-action-stamp-paper-self", ("target", Identity.Entity(args.Target, EntityManager)),("stamp", args.Used)); - _popupSystem.PopupEntity(stampPaperSelfMessage, args.User, Filter.Entities(args.User)); + _popupSystem.PopupEntity(stampPaperSelfMessage, args.User, args.User); } } diff --git a/Content.Server/Plants/Systems/PottedPlantHideSystem.cs b/Content.Server/Plants/Systems/PottedPlantHideSystem.cs index 091b73e481..91e544b796 100644 --- a/Content.Server/Plants/Systems/PottedPlantHideSystem.cs +++ b/Content.Server/Plants/Systems/PottedPlantHideSystem.cs @@ -47,7 +47,7 @@ namespace Content.Server.Plants.Systems if (!gotItem) { var msg = Loc.GetString("potted-plant-hide-component-interact-hand-got-no-item-message"); - _popupSystem.PopupEntity(msg, uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(msg, uid, args.User); } args.Handled = gotItem; diff --git a/Content.Server/Pointing/EntitySystems/PointingSystem.cs b/Content.Server/Pointing/EntitySystems/PointingSystem.cs index dd72c68156..6882376ca3 100644 --- a/Content.Server/Pointing/EntitySystems/PointingSystem.cs +++ b/Content.Server/Pointing/EntitySystems/PointingSystem.cs @@ -130,7 +130,7 @@ namespace Content.Server.Pointing.EntitySystems if (!InRange(player, coords)) { - _popup.PopupEntity(Loc.GetString("pointing-system-try-point-cannot-reach"), player, Filter.Entities(player)); + _popup.PopupEntity(Loc.GetString("pointing-system-try-point-cannot-reach"), player, player); return false; } diff --git a/Content.Server/Polymorph/Systems/PolymorphedEntitySystem.cs b/Content.Server/Polymorph/Systems/PolymorphedEntitySystem.cs index 95b79c441b..7b4e2c0429 100644 --- a/Content.Server/Polymorph/Systems/PolymorphedEntitySystem.cs +++ b/Content.Server/Polymorph/Systems/PolymorphedEntitySystem.cs @@ -107,8 +107,7 @@ namespace Content.Server.Polymorph.Systems _popup.PopupEntity(Loc.GetString("polymorph-revert-popup-generic", ("parent", Identity.Entity(uid, EntityManager)), ("child", Identity.Entity(component.Parent, EntityManager))), - component.Parent, - Filter.Pvs(component.Parent)); + component.Parent); QueueDel(uid); } diff --git a/Content.Server/Popups/PopupSystem.cs b/Content.Server/Popups/PopupSystem.cs index 7dca1a3047..ef5cd7ca88 100644 --- a/Content.Server/Popups/PopupSystem.cs +++ b/Content.Server/Popups/PopupSystem.cs @@ -1,31 +1,78 @@ using Content.Shared.Popups; +using Robust.Server.GameObjects; +using Robust.Server.Player; +using Robust.Shared.Configuration; using Robust.Shared.Map; using Robust.Shared.Player; +using Robust.Shared.Players; namespace Content.Server.Popups { public sealed class PopupSystem : SharedPopupSystem { - public override void PopupCursor(string message, Filter filter, PopupType type=PopupType.Small) + [Dependency] private readonly IPlayerManager _player = default!; + [Dependency] private readonly IConfigurationManager _cfg = default!; + + public override void PopupCursor(string message, PopupType type = PopupType.Small) { - // TODO REPLAYS - // add variants that take in a EntityUid or ICommonSession - // then remove any that send Filter.SinglePlayer() or single entity. - // then default to recording replays - // and manually remove any that shouldn't be replayed. - RaiseNetworkEvent(new PopupCursorEvent(message, type), filter); + // No local user. } - public override void PopupCoordinates(string message, EntityCoordinates coordinates, Filter filter, PopupType type=PopupType.Small) + public override void PopupCursor(string message, ICommonSession recipient, PopupType type=PopupType.Small) { - // TODO REPLAYS See above + RaiseNetworkEvent(new PopupCursorEvent(message, type), recipient); + } + + public override void PopupCursor(string message, EntityUid recipient, PopupType type = PopupType.Small) + { + if (TryComp(recipient, out ActorComponent? actor)) + RaiseNetworkEvent(new PopupCursorEvent(message, type), actor.PlayerSession); + } + + public override void PopupCoordinates(string message, EntityCoordinates coordinates, Filter filter, bool replayRecord, PopupType type = PopupType.Small) + { + RaiseNetworkEvent(new PopupCoordinatesEvent(message, type, coordinates), filter, replayRecord); + } + + public override void PopupCoordinates(string message, EntityCoordinates coordinates, PopupType type = PopupType.Small) + { + var mapPos = coordinates.ToMap(EntityManager); + var filter = Filter.Empty().AddPlayersByPvs(mapPos, entManager: EntityManager, playerMan: _player, cfgMan: _cfg); RaiseNetworkEvent(new PopupCoordinatesEvent(message, type, coordinates), filter); } - public override void PopupEntity(string message, EntityUid uid, Filter filter, PopupType type=PopupType.Small) + public override void PopupCoordinates(string message, EntityCoordinates coordinates, ICommonSession recipient, PopupType type = PopupType.Small) { - // TODO REPLAYS See above + RaiseNetworkEvent(new PopupCoordinatesEvent(message, type, coordinates), recipient); + } + + public override void PopupCoordinates(string message, EntityCoordinates coordinates, EntityUid recipient, PopupType type = PopupType.Small) + { + if (TryComp(recipient, out ActorComponent? actor)) + RaiseNetworkEvent(new PopupCoordinatesEvent(message, type, coordinates), actor.PlayerSession); + } + + public override void PopupEntity(string message, EntityUid uid, PopupType type = PopupType.Small) + { + var filter = Filter.Empty().AddPlayersByPvs(uid, entityManager:EntityManager, playerMan: _player, cfgMan: _cfg); RaiseNetworkEvent(new PopupEntityEvent(message, type, uid), filter); } + + public override void PopupEntity(string message, EntityUid uid, EntityUid recipient, PopupType type=PopupType.Small) + { + if (TryComp(recipient, out ActorComponent? actor)) + RaiseNetworkEvent(new PopupEntityEvent(message, type, uid), actor.PlayerSession); + } + + + public override void PopupEntity(string message, EntityUid uid, ICommonSession recipient, PopupType type = PopupType.Small) + { + RaiseNetworkEvent(new PopupEntityEvent(message, type, uid), recipient); + } + + public override void PopupEntity(string message, EntityUid uid, Filter filter, bool recordReplay, PopupType type = PopupType.Small) + { + RaiseNetworkEvent(new PopupEntityEvent(message, type, uid), filter, recordReplay); + } } } diff --git a/Content.Server/Power/EntitySystems/ApcSystem.cs b/Content.Server/Power/EntitySystems/ApcSystem.cs index 35f7bc6bcb..d5ccef48b3 100644 --- a/Content.Server/Power/EntitySystems/ApcSystem.cs +++ b/Content.Server/Power/EntitySystems/ApcSystem.cs @@ -69,7 +69,7 @@ namespace Content.Server.Power.EntitySystems else { _popupSystem.PopupCursor(Loc.GetString("apc-component-insufficient-access"), - Filter.Entities(args.Session.AttachedEntity.Value), PopupType.Medium); + args.Session, PopupType.Medium); } } diff --git a/Content.Server/Prayer/PrayerSystem.cs b/Content.Server/Prayer/PrayerSystem.cs index ccd1bf8bab..8072222216 100644 --- a/Content.Server/Prayer/PrayerSystem.cs +++ b/Content.Server/Prayer/PrayerSystem.cs @@ -1,4 +1,4 @@ -using Content.Server.Administration; +using Content.Server.Administration; using Content.Server.Bible.Components; using Content.Server.Chat.Managers; using Content.Server.Popups; @@ -48,7 +48,7 @@ public sealed class PrayerSystem : EntitySystem { if (comp.BibleUserOnly && !EntityManager.TryGetComponent(args.User, out var bibleUser)) { - _popupSystem.PopupEntity(Loc.GetString("prayer-popup-notify-locked"), uid, Filter.Empty().AddPlayer(actor.PlayerSession), PopupType.Large); + _popupSystem.PopupEntity(Loc.GetString("prayer-popup-notify-locked"), uid, actor.PlayerSession, PopupType.Large); return; } @@ -77,7 +77,7 @@ public sealed class PrayerSystem : EntitySystem var message = popupMessage == "" ? "" : popupMessage + $" \"{messageString}\""; - _popupSystem.PopupEntity(popupMessage, target.AttachedEntity.Value, Filter.Empty().AddPlayer(target), PopupType.Large); + _popupSystem.PopupEntity(popupMessage, target.AttachedEntity.Value, target, PopupType.Large); _chatManager.ChatMessageToOne(ChatChannel.Local, messageString, message, EntityUid.Invalid, false, target.ConnectedClient); } @@ -96,7 +96,7 @@ public sealed class PrayerSystem : EntitySystem return; - _popupSystem.PopupEntity(Loc.GetString("prayer-popup-notify-sent"), sender.AttachedEntity.Value, Filter.Empty().AddPlayer(sender), PopupType.Medium); + _popupSystem.PopupEntity(Loc.GetString("prayer-popup-notify-sent"), sender.AttachedEntity.Value, sender, PopupType.Medium); _chatManager.SendAdminAnnouncement(Loc.GetString("prayer-chat-notify", ("name", sender.Name), ("message", message))); } diff --git a/Content.Server/RCD/Systems/RCDSystem.cs b/Content.Server/RCD/Systems/RCDSystem.cs index c7fa4c6280..9193b7650f 100644 --- a/Content.Server/RCD/Systems/RCDSystem.cs +++ b/Content.Server/RCD/Systems/RCDSystem.cs @@ -161,7 +161,7 @@ namespace Content.Server.RCD.Systems //Less expensive checks first. Failing those ones, we need to check that the tile isn't obstructed. if (rcd.CurrentAmmo <= 0) { - _popup.PopupEntity(Loc.GetString("rcd-component-no-ammo-message"), rcd.Owner, Filter.Entities(eventArgs.User)); + _popup.PopupEntity(Loc.GetString("rcd-component-no-ammo-message"), rcd.Owner, eventArgs.User); return false; } @@ -183,7 +183,7 @@ namespace Content.Server.RCD.Systems case RcdMode.Floors: if (!tile.Tile.IsEmpty) { - _popup.PopupEntity(Loc.GetString("rcd-component-cannot-build-floor-tile-not-empty-message"), rcd.Owner, Filter.Entities(eventArgs.User)); + _popup.PopupEntity(Loc.GetString("rcd-component-cannot-build-floor-tile-not-empty-message"), rcd.Owner, eventArgs.User); return false; } @@ -198,13 +198,13 @@ namespace Content.Server.RCD.Systems //They tried to decon a turf but the turf is blocked if (eventArgs.Target == null && tile.IsBlockedTurf(true)) { - _popup.PopupEntity(Loc.GetString("rcd-component-tile-obstructed-message"), rcd.Owner, Filter.Entities(eventArgs.User)); + _popup.PopupEntity(Loc.GetString("rcd-component-tile-obstructed-message"), rcd.Owner, eventArgs.User); return false; } //They tried to decon a non-turf but it's not in the whitelist if (eventArgs.Target != null && !_tagSystem.HasTag(eventArgs.Target.Value, "RCDDeconstructWhitelist")) { - _popup.PopupEntity(Loc.GetString("rcd-component-deconstruct-target-not-on-whitelist-message"), rcd.Owner, Filter.Entities(eventArgs.User)); + _popup.PopupEntity(Loc.GetString("rcd-component-deconstruct-target-not-on-whitelist-message"), rcd.Owner, eventArgs.User); return false; } @@ -213,25 +213,25 @@ namespace Content.Server.RCD.Systems case RcdMode.Walls: if (tile.Tile.IsEmpty) { - _popup.PopupEntity(Loc.GetString("rcd-component-cannot-build-wall-tile-not-empty-message"), rcd.Owner, Filter.Entities(eventArgs.User)); + _popup.PopupEntity(Loc.GetString("rcd-component-cannot-build-wall-tile-not-empty-message"), rcd.Owner, eventArgs.User); return false; } if (tile.IsBlockedTurf(true)) { - _popup.PopupEntity(Loc.GetString("rcd-component-tile-obstructed-message"), rcd.Owner, Filter.Entities(eventArgs.User)); + _popup.PopupEntity(Loc.GetString("rcd-component-tile-obstructed-message"), rcd.Owner, eventArgs.User); return false; } return true; case RcdMode.Airlock: if (tile.Tile.IsEmpty) { - _popup.PopupEntity(Loc.GetString("rcd-component-cannot-build-airlock-tile-not-empty-message"), rcd.Owner, Filter.Entities(eventArgs.User)); + _popup.PopupEntity(Loc.GetString("rcd-component-cannot-build-airlock-tile-not-empty-message"), rcd.Owner, eventArgs.User); return false; } if (tile.IsBlockedTurf(true)) { - _popup.PopupEntity(Loc.GetString("rcd-component-tile-obstructed-message"), rcd.Owner, Filter.Entities(eventArgs.User)); + _popup.PopupEntity(Loc.GetString("rcd-component-tile-obstructed-message"), rcd.Owner, eventArgs.User); return false; } return true; @@ -249,7 +249,7 @@ namespace Content.Server.RCD.Systems rcd.Mode = (RcdMode) mode; var msg = Loc.GetString("rcd-component-change-mode", ("mode", rcd.Mode.ToString())); - _popup.PopupEntity(msg, rcd.Owner, Filter.Entities(user)); + _popup.PopupEntity(msg, rcd.Owner, user); } } } diff --git a/Content.Server/Radio/EntitySystems/RadioDeviceSystem.cs b/Content.Server/Radio/EntitySystems/RadioDeviceSystem.cs index 9b40e5b67f..dec609cdc6 100644 --- a/Content.Server/Radio/EntitySystems/RadioDeviceSystem.cs +++ b/Content.Server/Radio/EntitySystems/RadioDeviceSystem.cs @@ -99,7 +99,7 @@ public sealed class RadioDeviceSystem : EntitySystem { var state = Loc.GetString(component.Enabled ? "handheld-radio-component-on-state" : "handheld-radio-component-off-state"); var message = Loc.GetString("handheld-radio-component-on-use", ("radioState", state)); - _popup.PopupEntity(message, user, Filter.Entities(user)); + _popup.PopupEntity(message, user, user); } if (component.Enabled) @@ -134,7 +134,7 @@ public sealed class RadioDeviceSystem : EntitySystem { component.BroadcastChannel = channel; _popup.PopupEntity(Loc.GetString("handheld-radio-component-channel-set", - ("channel", channel)), uid, Filter.Entities(args.User)); + ("channel", channel)), uid, args.User); } }; args.Verbs.Add(v); @@ -168,7 +168,7 @@ public sealed class RadioDeviceSystem : EntitySystem { var state = Loc.GetString(component.Enabled ? "handheld-radio-component-on-state" : "handheld-radio-component-off-state"); var message = Loc.GetString("handheld-radio-component-on-use", ("radioState", state)); - _popup.PopupEntity(message, user, Filter.Entities(user)); + _popup.PopupEntity(message, user, user); } if (component.Enabled) diff --git a/Content.Server/RatKing/RatKingSystem.cs b/Content.Server/RatKing/RatKingSystem.cs index 9806024dff..55b64384ff 100644 --- a/Content.Server/RatKing/RatKingSystem.cs +++ b/Content.Server/RatKing/RatKingSystem.cs @@ -46,7 +46,7 @@ namespace Content.Server.RatKing //make sure the hunger doesn't go into the negatives if (hunger.CurrentHunger < component.HungerPerArmyUse) { - _popup.PopupEntity(Loc.GetString("rat-king-too-hungry"), uid, Filter.Entities(uid)); + _popup.PopupEntity(Loc.GetString("rat-king-too-hungry"), uid, uid); return; } args.Handled = true; @@ -69,13 +69,13 @@ namespace Content.Server.RatKing //make sure the hunger doesn't go into the negatives if (hunger.CurrentHunger < component.HungerPerDomainUse) { - _popup.PopupEntity(Loc.GetString("rat-king-too-hungry"), uid, Filter.Entities(uid)); + _popup.PopupEntity(Loc.GetString("rat-king-too-hungry"), uid, uid); return; } args.Handled = true; hunger.CurrentHunger -= component.HungerPerDomainUse; - _popup.PopupEntity(Loc.GetString("rat-king-domain-popup"), uid, Filter.Pvs(uid)); + _popup.PopupEntity(Loc.GetString("rat-king-domain-popup"), uid); var transform = Transform(uid); var indices = _xform.GetGridOrMapTilePosition(uid, transform); diff --git a/Content.Server/Recycling/RecyclerSystem.cs b/Content.Server/Recycling/RecyclerSystem.cs index 9708cc6b09..92fdabe111 100644 --- a/Content.Server/Recycling/RecyclerSystem.cs +++ b/Content.Server/Recycling/RecyclerSystem.cs @@ -62,13 +62,13 @@ namespace Content.Server.Recycling _ticker.OnGhostAttempt(mind, false); if (mind.OwnedEntity is { Valid: true } entity) { - _popup.PopupEntity(Loc.GetString("recycler-component-suicide-message"), entity, Filter.Pvs(entity, entityManager: EntityManager)); + _popup.PopupEntity(Loc.GetString("recycler-component-suicide-message"), entity); } } _popup.PopupEntity(Loc.GetString("recycler-component-suicide-message-others", ("victim", Identity.Entity(victim, EntityManager))), victim, - Filter.Pvs(victim, entityManager: EntityManager).RemoveWhereAttachedEntity(e => e == victim)); + Filter.PvsExcept(victim, entityManager: EntityManager), true); if (TryComp(victim, out var body)) { diff --git a/Content.Server/Remotes/DoorRemoteSystem.cs b/Content.Server/Remotes/DoorRemoteSystem.cs index fee13fbf85..2cb033ff77 100644 --- a/Content.Server/Remotes/DoorRemoteSystem.cs +++ b/Content.Server/Remotes/DoorRemoteSystem.cs @@ -97,6 +97,6 @@ namespace Content.Server.Remotes } private void ShowPopupToUser(string messageId, EntityUid user) => - _popupSystem.PopupEntity(Loc.GetString(messageId), user, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString(messageId), user, user); } } diff --git a/Content.Server/Research/Disk/ResearchDiskSystem.cs b/Content.Server/Research/Disk/ResearchDiskSystem.cs index 35ac5f8670..c9d154ca19 100644 --- a/Content.Server/Research/Disk/ResearchDiskSystem.cs +++ b/Content.Server/Research/Disk/ResearchDiskSystem.cs @@ -23,7 +23,7 @@ namespace Content.Server.Research.Disk return; server.Points += component.Points; - _popupSystem.PopupEntity(Loc.GetString("research-disk-inserted", ("points", component.Points)), args.Target.Value, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("research-disk-inserted", ("points", component.Points)), args.Target.Value, args.User); EntityManager.QueueDeleteEntity(uid); } } diff --git a/Content.Server/Resist/EscapeInventorySystem.cs b/Content.Server/Resist/EscapeInventorySystem.cs index 32e598fa01..18546e07f0 100644 --- a/Content.Server/Resist/EscapeInventorySystem.cs +++ b/Content.Server/Resist/EscapeInventorySystem.cs @@ -81,8 +81,8 @@ public sealed class EscapeInventorySystem : EntitySystem UserCancelledEvent = new EscapeDoAfterCancel(), }; - _popupSystem.PopupEntity(Loc.GetString("escape-inventory-component-start-resisting"), user, Filter.Entities(user)); - _popupSystem.PopupEntity(Loc.GetString("escape-inventory-component-start-resisting-target"), container, Filter.Entities(container)); + _popupSystem.PopupEntity(Loc.GetString("escape-inventory-component-start-resisting"), user, user); + _popupSystem.PopupEntity(Loc.GetString("escape-inventory-component-start-resisting-target"), container, container); _doAfterSystem.DoAfter(doAfterEventArgs); } diff --git a/Content.Server/Resist/ResistLockerSystem.cs b/Content.Server/Resist/ResistLockerSystem.cs index 7e4c59ef5d..0222cfef66 100644 --- a/Content.Server/Resist/ResistLockerSystem.cs +++ b/Content.Server/Resist/ResistLockerSystem.cs @@ -59,7 +59,7 @@ public sealed class ResistLockerSystem : EntitySystem }; resistLockerComponent.IsResisting = true; - _popupSystem.PopupEntity(Loc.GetString("resist-locker-component-start-resisting"), user, Filter.Entities(user), PopupType.Large); + _popupSystem.PopupEntity(Loc.GetString("resist-locker-component-start-resisting"), user, user, PopupType.Large); _doAfterSystem.DoAfter(doAfterEventArgs); } @@ -84,7 +84,7 @@ public sealed class ResistLockerSystem : EntitySystem { component.IsResisting = false; component.CancelToken = null; - _popupSystem.PopupEntity(Loc.GetString("resist-locker-component-resist-interrupted"), ev.User, Filter.Entities(ev.User), PopupType.Medium); + _popupSystem.PopupEntity(Loc.GetString("resist-locker-component-resist-interrupted"), ev.User, ev.User, PopupType.Medium); } private void OnRemovedFromContainer(EntityUid uid, ResistLockerComponent component, EntRemovedFromContainerMessage message) diff --git a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs index c82bbea077..01009a04f9 100644 --- a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs +++ b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs @@ -89,7 +89,7 @@ public sealed partial class RevenantSystem if (revenant.SoulSearchCancelToken != null) return; - _popup.PopupEntity(Loc.GetString("revenant-soul-searching", ("target", target)), uid, Filter.Entities(uid), PopupType.Medium); + _popup.PopupEntity(Loc.GetString("revenant-soul-searching", ("target", target)), uid, uid, PopupType.Medium); revenant.SoulSearchCancelToken = new(); var searchDoAfter = new DoAfterEventArgs(uid, revenant.SoulSearchDuration, revenant.SoulSearchCancelToken.Token, target) { @@ -121,7 +121,7 @@ public sealed partial class RevenantSystem message = "revenant-soul-yield-average"; break; } - _popup.PopupEntity(Loc.GetString(message, ("target", args.Target)), args.Target, Filter.Entities(uid), PopupType.Medium); + _popup.PopupEntity(Loc.GetString(message, ("target", args.Target)), args.Target, uid, PopupType.Medium); } private void OnSoulSearchCancelled(EntityUid uid, RevenantComponent component, SoulSearchDoAfterCancelled args) @@ -136,13 +136,13 @@ public sealed partial class RevenantSystem if (essence.Harvested) { - _popup.PopupEntity(Loc.GetString("revenant-soul-harvested"), target, Filter.Entities(uid), PopupType.SmallCaution); + _popup.PopupEntity(Loc.GetString("revenant-soul-harvested"), target, uid, PopupType.SmallCaution); return; } if (TryComp(target, out var mobstate) && mobstate.CurrentState == DamageState.Alive && !HasComp(target)) { - _popup.PopupEntity(Loc.GetString("revenant-soul-too-powerful"), target, Filter.Entities(uid)); + _popup.PopupEntity(Loc.GetString("revenant-soul-too-powerful"), target, uid); return; } @@ -159,7 +159,7 @@ public sealed partial class RevenantSystem _appearance.SetData(uid, RevenantVisuals.Harvesting, true); _popup.PopupEntity(Loc.GetString("revenant-soul-begin-harvest", ("target", target)), - target, Filter.Pvs(target), PopupType.Large); + target, PopupType.Large); TryUseAbility(uid, revenant, 0, revenant.HarvestDebuffs); _doAfter.DoAfter(doAfter); @@ -174,7 +174,7 @@ public sealed partial class RevenantSystem return; _popup.PopupEntity(Loc.GetString("revenant-soul-finish-harvest", ("target", args.Target)), - args.Target, Filter.Pvs(args.Target), PopupType.LargeCaution); + args.Target, PopupType.LargeCaution); essence.Harvested = true; ChangeEssenceAmount(uid, essence.EssenceAmount, component); @@ -189,7 +189,7 @@ public sealed partial class RevenantSystem if (_mobState.IsAlive(args.Target) || _mobState.IsCritical(args.Target)) { - _popup.PopupEntity(Loc.GetString("revenant-max-essence-increased"), uid, Filter.Entities(uid)); + _popup.PopupEntity(Loc.GetString("revenant-max-essence-increased"), uid, uid); component.EssenceRegenCap += component.MaxEssenceUpgradeAmount; } diff --git a/Content.Server/Revenant/EntitySystems/RevenantSystem.cs b/Content.Server/Revenant/EntitySystems/RevenantSystem.cs index 8ce4135a76..29cccb95dc 100644 --- a/Content.Server/Revenant/EntitySystems/RevenantSystem.cs +++ b/Content.Server/Revenant/EntitySystems/RevenantSystem.cs @@ -146,7 +146,7 @@ public sealed partial class RevenantSystem : EntitySystem { if (component.Essence <= abilityCost) { - _popup.PopupEntity(Loc.GetString("revenant-not-enough-essence"), uid, Filter.Entities(uid)); + _popup.PopupEntity(Loc.GetString("revenant-not-enough-essence"), uid, uid); return false; } @@ -155,7 +155,7 @@ public sealed partial class RevenantSystem : EntitySystem { if(_physics.GetEntitiesIntersectingBody(uid, (int) CollisionGroup.Impassable).Count > 0) { - _popup.PopupEntity(Loc.GetString("revenant-in-solid"), uid, Filter.Entities(uid)); + _popup.PopupEntity(Loc.GetString("revenant-in-solid"), uid, uid); return false; } } diff --git a/Content.Server/Salvage/SalvageSystem.cs b/Content.Server/Salvage/SalvageSystem.cs index 04eae75fd0..5e33fb55f4 100644 --- a/Content.Server/Salvage/SalvageSystem.cs +++ b/Content.Server/Salvage/SalvageSystem.cs @@ -220,7 +220,7 @@ namespace Content.Server.Salvage } private void ShowPopup(string messageKey, SalvageMagnetComponent component, EntityUid user) { - _popupSystem.PopupEntity(Loc.GetString(messageKey), component.Owner, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString(messageKey), component.Owner, user); } private void SafeDeleteSalvage(EntityUid salvage) diff --git a/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs b/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs index e5fb8efa48..fb4bda76e6 100644 --- a/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs +++ b/Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs @@ -71,17 +71,13 @@ namespace Content.Server.Shuttles.Systems if (HasComp(xform.GridUid)) { - if (args.Session.AttachedEntity != null) - _popup.PopupCursor(Loc.GetString("shuttle-console-in-ftl"), Filter.Entities(args.Session.AttachedEntity.Value)); - + _popup.PopupCursor(Loc.GetString("shuttle-console-in-ftl"), args.Session); return; } if (!_shuttle.CanFTL(shuttle.Owner, out var reason)) { - if (args.Session.AttachedEntity != null) - _popup.PopupCursor(reason, Filter.Entities(args.Session.AttachedEntity.Value)); - + _popup.PopupCursor(reason, args.Session); return; } diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyConsole.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyConsole.cs index a1fe65824c..070ea65146 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyConsole.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyConsole.cs @@ -92,7 +92,7 @@ public sealed partial class ShuttleSystem if (!_configManager.GetCVar(CCVars.EmergencyEarlyLaunchAllowed)) { args.Cancel(); - _popup.PopupEntity(Loc.GetString("emergency-shuttle-console-no-early-launches"), uid, Filter.Entities(args.User)); + _popup.PopupEntity(Loc.GetString("emergency-shuttle-console-no-early-launches"), uid, args.User); return; } } @@ -182,7 +182,7 @@ public sealed partial class ShuttleSystem if (!_reader.FindAccessTags(player.Value).Contains(EmergencyRepealAllAccess)) { - _popup.PopupCursor(Loc.GetString("emergency-shuttle-console-denied"), Filter.Entities(player.Value), PopupType.Medium); + _popup.PopupCursor(Loc.GetString("emergency-shuttle-console-denied"), player.Value, PopupType.Medium); return; } @@ -201,7 +201,7 @@ public sealed partial class ShuttleSystem if (!_idSystem.TryFindIdCard(player.Value, out var idCard) || !_reader.IsAllowed(idCard.Owner, uid)) { - _popup.PopupCursor(Loc.GetString("emergency-shuttle-console-denied"), Filter.Entities(player.Value), PopupType.Medium); + _popup.PopupCursor(Loc.GetString("emergency-shuttle-console-denied"), player.Value, PopupType.Medium); return; } @@ -222,7 +222,7 @@ public sealed partial class ShuttleSystem if (!_idSystem.TryFindIdCard(player.Value, out var idCard) || !_reader.IsAllowed(idCard.Owner, uid)) { - _popup.PopupCursor(Loc.GetString("emergency-shuttle-console-denied"), Filter.Entities(player.Value), PopupType.Medium); + _popup.PopupCursor(Loc.GetString("emergency-shuttle-console-denied"), args.Session, PopupType.Medium); return; } diff --git a/Content.Server/Singularity/EntitySystems/ContainmentFieldGeneratorSystem.cs b/Content.Server/Singularity/EntitySystems/ContainmentFieldGeneratorSystem.cs index c2b8852d46..8487c01759 100644 --- a/Content.Server/Singularity/EntitySystems/ContainmentFieldGeneratorSystem.cs +++ b/Content.Server/Singularity/EntitySystems/ContainmentFieldGeneratorSystem.cs @@ -1,4 +1,4 @@ -using Content.Server.Singularity.Components; +using Content.Server.Singularity.Components; using Content.Shared.Singularity.Components; using Content.Shared.Tag; using Robust.Server.GameObjects; @@ -89,7 +89,7 @@ public sealed class ContainmentFieldGeneratorSystem : EntitySystem TurnOn(component); else if (component.Enabled && component.IsConnected) { - _popupSystem.PopupEntity(Loc.GetString("comp-containment-toggle-warning"), args.User, Filter.Entities(args.User), PopupType.LargeCaution); + _popupSystem.PopupEntity(Loc.GetString("comp-containment-toggle-warning"), args.User, args.User, PopupType.LargeCaution); return; } else @@ -114,7 +114,7 @@ public sealed class ContainmentFieldGeneratorSystem : EntitySystem { if (component.Enabled) { - _popupSystem.PopupEntity(Loc.GetString("comp-containment-anchor-warning"), args.User, Filter.Entities(args.User), PopupType.LargeCaution); + _popupSystem.PopupEntity(Loc.GetString("comp-containment-anchor-warning"), args.User, args.User, PopupType.LargeCaution); args.Cancel(); } } @@ -123,14 +123,14 @@ public sealed class ContainmentFieldGeneratorSystem : EntitySystem { component.Enabled = true; ChangeFieldVisualizer(component); - _popupSystem.PopupEntity(Loc.GetString("comp-containment-turned-on"), component.Owner, Filter.Pvs(component.Owner)); + _popupSystem.PopupEntity(Loc.GetString("comp-containment-turned-on"), component.Owner); } private void TurnOff(ContainmentFieldGeneratorComponent component) { component.Enabled = false; ChangeFieldVisualizer(component); - _popupSystem.PopupEntity(Loc.GetString("comp-containment-turned-off"), component.Owner, Filter.Pvs(component.Owner)); + _popupSystem.PopupEntity(Loc.GetString("comp-containment-turned-off"), component.Owner); } private void OnComponentRemoved(EntityUid uid, ContainmentFieldGeneratorComponent component, ComponentRemove args) @@ -163,7 +163,7 @@ public sealed class ContainmentFieldGeneratorSystem : EntitySystem component.IsConnected = false; ChangeOnLightVisualizer(component); ChangeFieldVisualizer(component); - _popupSystem.PopupEntity(Loc.GetString("comp-containment-disconnected"), component.Owner, Filter.Pvs(component.Owner), PopupType.LargeCaution); + _popupSystem.PopupEntity(Loc.GetString("comp-containment-disconnected"), component.Owner, PopupType.LargeCaution); } #endregion @@ -275,7 +275,7 @@ public sealed class ContainmentFieldGeneratorSystem : EntitySystem ChangeFieldVisualizer(component); UpdateConnectionLights(component); - _popupSystem.PopupEntity(Loc.GetString("comp-containment-connected"), component.Owner, Filter.Pvs(component.Owner)); + _popupSystem.PopupEntity(Loc.GetString("comp-containment-connected"), component.Owner); return true; } diff --git a/Content.Server/Singularity/EntitySystems/ContainmentFieldSystem.cs b/Content.Server/Singularity/EntitySystems/ContainmentFieldSystem.cs index 36ad1ae746..a926d98210 100644 --- a/Content.Server/Singularity/EntitySystems/ContainmentFieldSystem.cs +++ b/Content.Server/Singularity/EntitySystems/ContainmentFieldSystem.cs @@ -30,7 +30,7 @@ public sealed class ContainmentFieldSystem : EntitySystem if (TryComp(otherBody, out var garbage)) { - _popupSystem.PopupEntity(Loc.GetString("comp-field-vaporized", ("entity", otherBody)), component.Owner, Filter.Pvs(component.Owner), PopupType.LargeCaution); + _popupSystem.PopupEntity(Loc.GetString("comp-field-vaporized", ("entity", otherBody)), component.Owner, PopupType.LargeCaution); QueueDel(garbage.Owner); } diff --git a/Content.Server/Singularity/EntitySystems/EmitterSystem.cs b/Content.Server/Singularity/EntitySystems/EmitterSystem.cs index 6e49a47f30..9511f7a8f2 100644 --- a/Content.Server/Singularity/EntitySystems/EmitterSystem.cs +++ b/Content.Server/Singularity/EntitySystems/EmitterSystem.cs @@ -48,7 +48,7 @@ namespace Content.Server.Singularity.EntitySystems if (EntityManager.TryGetComponent(uid, out LockComponent? lockComp) && lockComp.Locked) { _popup.PopupEntity(Loc.GetString("comp-emitter-access-locked", - ("target", component.Owner)), uid, Filter.Entities(args.User)); + ("target", component.Owner)), uid, args.User); return; } @@ -58,13 +58,13 @@ namespace Content.Server.Singularity.EntitySystems { SwitchOn(component); _popup.PopupEntity(Loc.GetString("comp-emitter-turned-on", - ("target", component.Owner)), uid, Filter.Entities(args.User)); + ("target", component.Owner)), uid, args.User); } else { SwitchOff(component); _popup.PopupEntity(Loc.GetString("comp-emitter-turned-off", - ("target", component.Owner)), uid, Filter.Entities(args.User)); + ("target", component.Owner)), uid, args.User); } _adminLogger.Add(LogType.Emitter, @@ -74,7 +74,7 @@ namespace Content.Server.Singularity.EntitySystems else { _popup.PopupEntity(Loc.GetString("comp-emitter-not-anchored", - ("target", component.Owner)), uid, Filter.Entities(args.User)); + ("target", component.Owner)), uid, args.User); } } diff --git a/Content.Server/Singularity/EntitySystems/RadiationCollectorSystem.cs b/Content.Server/Singularity/EntitySystems/RadiationCollectorSystem.cs index b3b6a054be..15e831d935 100644 --- a/Content.Server/Singularity/EntitySystems/RadiationCollectorSystem.cs +++ b/Content.Server/Singularity/EntitySystems/RadiationCollectorSystem.cs @@ -64,7 +64,7 @@ namespace Content.Server.Singularity.EntitySystems if (user != null) { var msg = component.Enabled ? "radiation-collector-component-use-on" : "radiation-collector-component-use-off"; - _popupSystem.PopupEntity(Loc.GetString(msg), uid, Filter.Pvs(user.Value)); + _popupSystem.PopupEntity(Loc.GetString(msg), uid); } diff --git a/Content.Server/Sound/EmitSoundSystem.cs b/Content.Server/Sound/EmitSoundSystem.cs index 23e512a03b..539557d486 100644 --- a/Content.Server/Sound/EmitSoundSystem.cs +++ b/Content.Server/Sound/EmitSoundSystem.cs @@ -49,7 +49,7 @@ namespace Content.Server.Sound if (_random.Prob(soundSpammer.PlayChance)) { if (soundSpammer.PopUp != null) - _popupSystem.PopupEntity(Loc.GetString(soundSpammer.PopUp), soundSpammer.Owner, Filter.Pvs(soundSpammer.Owner)); + _popupSystem.PopupEntity(Loc.GetString(soundSpammer.PopUp), soundSpammer.Owner); TryEmitSound(soundSpammer); } } diff --git a/Content.Server/Stack/StackSystem.cs b/Content.Server/Stack/StackSystem.cs index e13ea803b9..de1d112cd9 100644 --- a/Content.Server/Stack/StackSystem.cs +++ b/Content.Server/Stack/StackSystem.cs @@ -154,7 +154,7 @@ namespace Content.Server.Stack if (amount <= 0) { - PopupSystem.PopupCursor(Loc.GetString("comp-stack-split-too-small"), Filter.Entities(userUid), PopupType.Medium); + PopupSystem.PopupCursor(Loc.GetString("comp-stack-split-too-small"), userUid, PopupType.Medium); return; } @@ -163,7 +163,7 @@ namespace Content.Server.Stack HandsSystem.PickupOrDrop(userUid, split); - PopupSystem.PopupCursor(Loc.GetString("comp-stack-split"), Filter.Entities(userUid)); + PopupSystem.PopupCursor(Loc.GetString("comp-stack-split"), userUid); } } } diff --git a/Content.Server/Sticky/Systems/StickySystem.cs b/Content.Server/Sticky/Systems/StickySystem.cs index 50f873a183..5757d8a9e6 100644 --- a/Content.Server/Sticky/Systems/StickySystem.cs +++ b/Content.Server/Sticky/Systems/StickySystem.cs @@ -79,7 +79,7 @@ public sealed class StickySystem : EntitySystem if (component.StickPopupStart != null) { var msg = Loc.GetString(component.StickPopupStart); - _popupSystem.PopupEntity(msg, user, Filter.Entities(user)); + _popupSystem.PopupEntity(msg, user, user); } // start sticking object to target @@ -122,7 +122,7 @@ public sealed class StickySystem : EntitySystem if (component.UnstickPopupStart != null) { var msg = Loc.GetString(component.UnstickPopupStart); - _popupSystem.PopupEntity(msg, user, Filter.Entities(user)); + _popupSystem.PopupEntity(msg, user, user); } // start unsticking object @@ -166,7 +166,7 @@ public sealed class StickySystem : EntitySystem if (component.StickPopupSuccess != null) { var msg = Loc.GetString(component.StickPopupSuccess); - _popupSystem.PopupEntity(msg, user, Filter.Entities(user)); + _popupSystem.PopupEntity(msg, user, user); } // send information to appearance that entity is stuck @@ -207,7 +207,7 @@ public sealed class StickySystem : EntitySystem if (component.UnstickPopupSuccess != null) { var msg = Loc.GetString(component.UnstickPopupSuccess); - _popupSystem.PopupEntity(msg, user, Filter.Entities(user)); + _popupSystem.PopupEntity(msg, user, user); } component.StuckTo = null; diff --git a/Content.Server/Storage/EntitySystems/EntityStorageSystem.cs b/Content.Server/Storage/EntitySystems/EntityStorageSystem.cs index de29706eb1..8d56e3de78 100644 --- a/Content.Server/Storage/EntitySystems/EntityStorageSystem.cs +++ b/Content.Server/Storage/EntitySystems/EntityStorageSystem.cs @@ -94,7 +94,7 @@ public sealed class EntityStorageSystem : EntitySystem if (component.Contents.Contains(args.User)) { var msg = Loc.GetString("entity-storage-component-already-contains-user-message"); - _popupSystem.PopupEntity(msg, args.User, Filter.Entities(args.User)); + _popupSystem.PopupEntity(msg, args.User, args.User); args.Cancel(); } } @@ -274,7 +274,7 @@ public sealed class EntityStorageSystem : EntitySystem if (component.IsWeldedShut) { if (!silent && !component.Contents.Contains(user)) - _popupSystem.PopupEntity(Loc.GetString("entity-storage-component-welded-shut-message"), target, Filter.Pvs(target)); + _popupSystem.PopupEntity(Loc.GetString("entity-storage-component-welded-shut-message"), target); return false; } @@ -286,7 +286,7 @@ public sealed class EntityStorageSystem : EntitySystem if (!_interactionSystem.InRangeUnobstructed(target, newCoords, 0, collisionMask: component.EnteringOffsetCollisionFlags)) { if (!silent) - _popupSystem.PopupEntity(Loc.GetString("entity-storage-component-cannot-open-no-space"), target, Filter.Pvs(target)); + _popupSystem.PopupEntity(Loc.GetString("entity-storage-component-cannot-open-no-space"), target); return false; } } diff --git a/Content.Server/Storage/EntitySystems/SecretStashSystem.cs b/Content.Server/Storage/EntitySystems/SecretStashSystem.cs index b1cf5007bf..bf78fafb6b 100644 --- a/Content.Server/Storage/EntitySystems/SecretStashSystem.cs +++ b/Content.Server/Storage/EntitySystems/SecretStashSystem.cs @@ -70,7 +70,7 @@ namespace Content.Server.Storage.EntitySystems if (container.ContainedEntity != null) { var msg = Loc.GetString("comp-secret-stash-action-hide-container-not-empty"); - _popupSystem.PopupEntity(msg, uid, Filter.Entities(userUid)); + _popupSystem.PopupEntity(msg, uid, userUid); return false; } @@ -80,7 +80,7 @@ namespace Content.Server.Storage.EntitySystems { var msg = Loc.GetString("comp-secret-stash-action-hide-item-too-big", ("item", itemName), ("stash", component.SecretPartName)); - _popupSystem.PopupEntity(msg, uid, Filter.Entities(userUid)); + _popupSystem.PopupEntity(msg, uid, userUid); return false; } @@ -93,7 +93,7 @@ namespace Content.Server.Storage.EntitySystems // all done, show success message var successMsg = Loc.GetString("comp-secret-stash-action-hide-success", ("item", itemName), ("this", component.SecretPartName)); - _popupSystem.PopupEntity(successMsg, uid, Filter.Entities(userUid)); + _popupSystem.PopupEntity(successMsg, uid, userUid); return true; } @@ -122,7 +122,7 @@ namespace Content.Server.Storage.EntitySystems // show success message var successMsg = Loc.GetString("comp-secret-stash-action-get-item-found-something", ("stash", component.SecretPartName)); - _popupSystem.PopupEntity(successMsg, uid, Filter.Entities(userUid)); + _popupSystem.PopupEntity(successMsg, uid, userUid); return true; } diff --git a/Content.Server/Storage/EntitySystems/StorageSystem.cs b/Content.Server/Storage/EntitySystems/StorageSystem.cs index 671235856e..f54aa25434 100644 --- a/Content.Server/Storage/EntitySystems/StorageSystem.cs +++ b/Content.Server/Storage/EntitySystems/StorageSystem.cs @@ -721,7 +721,7 @@ namespace Content.Server.Storage.EntitySystems { if (!storageComp.ShowPopup) return; - _popupSystem.PopupEntity(Loc.GetString(message), player, Filter.Entities(player)); + _popupSystem.PopupEntity(Loc.GetString(message), player, player); } /// diff --git a/Content.Server/Store/Systems/StoreSystem.cs b/Content.Server/Store/Systems/StoreSystem.cs index aecb36e5be..0aa57a5e09 100644 --- a/Content.Server/Store/Systems/StoreSystem.cs +++ b/Content.Server/Store/Systems/StoreSystem.cs @@ -64,7 +64,7 @@ public sealed partial class StoreSystem : EntitySystem if (args.Handled) { var msg = Loc.GetString("store-currency-inserted", ("used", args.Used), ("target", args.Target)); - _popup.PopupEntity(msg, args.Target.Value, Filter.Pvs(args.Target.Value)); + _popup.PopupEntity(msg, args.Target.Value); QueueDel(args.Used); } } diff --git a/Content.Server/Strip/StrippableSystem.cs b/Content.Server/Strip/StrippableSystem.cs index 69e1d67ddf..e14b85b22b 100644 --- a/Content.Server/Strip/StrippableSystem.cs +++ b/Content.Server/Strip/StrippableSystem.cs @@ -216,7 +216,7 @@ namespace Content.Server.Strip { var message = Loc.GetString("strippable-component-alert-owner-insert", ("user", Identity.Entity(user, EntityManager)), ("item", userHands.ActiveHandEntity)); - _popupSystem.PopupEntity(message, component.Owner, Filter.Entities(component.Owner), PopupType.Large); + _popupSystem.PopupEntity(message, component.Owner, component.Owner, PopupType.Large); } var result = await _doAfterSystem.WaitDoAfter(doAfterArgs); @@ -285,7 +285,7 @@ namespace Content.Server.Strip if (handSlot.HeldEntity != null) { _popupSystem.PopupEntity(Loc.GetString("strippable-component-alert-owner-insert", ("user", Identity.Entity(user, EntityManager)), ("item", handSlot.HeldEntity)), component.Owner, - Filter.Entities(component.Owner), PopupType.Large); + component.Owner, PopupType.Large); } } @@ -351,12 +351,12 @@ namespace Content.Server.Strip if (slotDef.StripHidden) { _popupSystem.PopupEntity(Loc.GetString("strippable-component-alert-owner-hidden", ("slot", slot)), component.Owner, - Filter.Entities(component.Owner), PopupType.Large); + component.Owner, PopupType.Large); } else if (_inventorySystem.TryGetSlotEntity(component.Owner, slot, out var slotItem)) { _popupSystem.PopupEntity(Loc.GetString("strippable-component-alert-owner", ("user", Identity.Entity(user, EntityManager)), ("item", slotItem)), component.Owner, - Filter.Entities(component.Owner), PopupType.Large); + component.Owner, PopupType.Large); } } @@ -419,7 +419,7 @@ namespace Content.Server.Strip { if (handSlot.HeldEntity != null) { - _popupSystem.PopupEntity(Loc.GetString("strippable-component-alert-owner", ("user", Identity.Entity(user, EntityManager)), ("item", handSlot.HeldEntity)), component.Owner, Filter.Entities(component.Owner)); + _popupSystem.PopupEntity(Loc.GetString("strippable-component-alert-owner", ("user", Identity.Entity(user, EntityManager)), ("item", handSlot.HeldEntity)), component.Owner, component.Owner); } } diff --git a/Content.Server/Toilet/ToiletSystem.cs b/Content.Server/Toilet/ToiletSystem.cs index 12456c14df..1bb6de9e48 100644 --- a/Content.Server/Toilet/ToiletSystem.cs +++ b/Content.Server/Toilet/ToiletSystem.cs @@ -54,11 +54,11 @@ namespace Content.Server.Toilet { var othersMessage = Loc.GetString("toilet-component-suicide-head-message-others", ("victim", Identity.Entity(args.Victim, EntityManager)), ("owner", uid)); - _popupSystem.PopupEntity(othersMessage, uid, Filter.PvsExcept(args.Victim), PopupType.MediumCaution); + _popupSystem.PopupEntity(othersMessage, uid, Filter.PvsExcept(args.Victim), true, PopupType.MediumCaution); var selfMessage = Loc.GetString("toilet-component-suicide-head-message", ("owner", uid)); - _popupSystem.PopupEntity(selfMessage, uid, Filter.Entities(args.Victim), PopupType.LargeCaution); + _popupSystem.PopupEntity(selfMessage, uid, args.Victim, PopupType.LargeCaution); args.SetHandled(SuicideKind.Asphyxiation); } @@ -66,11 +66,11 @@ namespace Content.Server.Toilet { var othersMessage = Loc.GetString("toilet-component-suicide-message-others", ("victim", Identity.Entity(args.Victim, EntityManager)), ("owner", uid)); - _popupSystem.PopupEntity(othersMessage, uid, Filter.PvsExcept(uid), PopupType.MediumCaution); + _popupSystem.PopupEntity(othersMessage, uid, Filter.PvsExcept(uid), true, PopupType.MediumCaution); var selfMessage = Loc.GetString("toilet-component-suicide-message", ("owner", uid)); - _popupSystem.PopupEntity(selfMessage, uid, Filter.Entities(args.Victim), PopupType.LargeCaution); + _popupSystem.PopupEntity(selfMessage, uid, args.Victim, PopupType.LargeCaution); args.SetHandled(SuicideKind.Blunt); } diff --git a/Content.Server/Tools/ToolSystem.Welder.cs b/Content.Server/Tools/ToolSystem.Welder.cs index 73282b6143..29ed1fc296 100644 --- a/Content.Server/Tools/ToolSystem.Welder.cs +++ b/Content.Server/Tools/ToolSystem.Welder.cs @@ -100,7 +100,7 @@ namespace Content.Server.Tools if (fuel == FixedPoint2.Zero || fuel < welder.FuelLitCost) { if(user != null) - _popupSystem.PopupEntity(Loc.GetString("welder-component-no-fuel-message"), uid, Filter.Entities(user.Value)); + _popupSystem.PopupEntity(Loc.GetString("welder-component-no-fuel-message"), uid, user.Value); return false; } @@ -227,15 +227,15 @@ namespace Content.Server.Tools var drained = _solutionContainerSystem.Drain(target, targetSolution, trans); _solutionContainerSystem.TryAddSolution(uid, welderSolution, drained); _audioSystem.PlayPvs(welder.WelderRefill, uid); - _popupSystem.PopupEntity(Loc.GetString("welder-component-after-interact-refueled-message"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("welder-component-after-interact-refueled-message"), uid, args.User); } else if (welderSolution.AvailableVolume <= 0) { - _popupSystem.PopupEntity(Loc.GetString("welder-component-already-full"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("welder-component-already-full"), uid, args.User); } else { - _popupSystem.PopupEntity(Loc.GetString("welder-component-no-fuel-in-tank", ("owner", args.Target)), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("welder-component-no-fuel-in-tank", ("owner", args.Target)), uid, args.User); } } @@ -249,7 +249,7 @@ namespace Content.Server.Tools if (!welder.Lit) { - _popupSystem.PopupEntity(Loc.GetString("welder-component-welder-not-lit-message"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("welder-component-welder-not-lit-message"), uid, args.User); args.Cancel(); return; } @@ -258,7 +258,7 @@ namespace Content.Server.Tools if (FixedPoint2.New(args.Fuel) > fuel) { - _popupSystem.PopupEntity(Loc.GetString("welder-component-cannot-weld-message"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("welder-component-cannot-weld-message"), uid, args.User); args.Cancel(); return; } @@ -271,7 +271,7 @@ namespace Content.Server.Tools if (!welder.Lit) { - _popupSystem.PopupEntity(Loc.GetString("welder-component-welder-not-lit-message"), uid, Filter.Entities(args.User)); + _popupSystem.PopupEntity(Loc.GetString("welder-component-welder-not-lit-message"), uid, args.User); args.Cancel(); return; } diff --git a/Content.Server/TraitorDeathMatch/TraitorDeathMatchRedemptionSystem.cs b/Content.Server/TraitorDeathMatch/TraitorDeathMatchRedemptionSystem.cs index 1c5908fe14..c40ce777ae 100644 --- a/Content.Server/TraitorDeathMatch/TraitorDeathMatchRedemptionSystem.cs +++ b/Content.Server/TraitorDeathMatch/TraitorDeathMatchRedemptionSystem.cs @@ -34,7 +34,7 @@ public sealed class TraitorDeathMatchRedemptionSystem : EntitySystem _popup.PopupEntity(Loc.GetString( "traitor-death-match-redemption-component-interact-using-main-message", ("secondMessage", - Loc.GetString("traitor-death-match-redemption-component-interact-using-no-mind-message"))), uid, Filter.Entities(args.User)); + Loc.GetString("traitor-death-match-redemption-component-interact-using-no-mind-message"))), uid, args.User); return; } @@ -44,7 +44,7 @@ public sealed class TraitorDeathMatchRedemptionSystem : EntitySystem _popup.PopupEntity(Loc.GetString( "traitor-death-match-redemption-component-interact-using-main-message", ("secondMessage", - Loc.GetString("traitor-death-match-redemption-component-interact-using-no-user-mind-message"))), uid, Filter.Entities(args.User)); + Loc.GetString("traitor-death-match-redemption-component-interact-using-no-user-mind-message"))), uid, args.User); return; } @@ -53,7 +53,7 @@ public sealed class TraitorDeathMatchRedemptionSystem : EntitySystem _popup.PopupEntity(Loc.GetString( "traitor-death-match-redemption-component-interact-using-main-message", ("secondMessage", - Loc.GetString("traitor-death-match-redemption-component-interact-using-no-pda-message"))), uid, Filter.Entities(args.User)); + Loc.GetString("traitor-death-match-redemption-component-interact-using-no-pda-message"))), uid, args.User); return; } @@ -63,7 +63,7 @@ public sealed class TraitorDeathMatchRedemptionSystem : EntitySystem _popup.PopupEntity(Loc.GetString( "traitor-death-match-redemption-component-interact-using-main-message", ("secondMessage", - Loc.GetString("traitor-death-match-redemption-component-interact-using-no-pda-owner-message"))), uid, Filter.Entities(args.User)); + Loc.GetString("traitor-death-match-redemption-component-interact-using-no-pda-owner-message"))), uid, args.User); return; } @@ -73,7 +73,7 @@ public sealed class TraitorDeathMatchRedemptionSystem : EntitySystem "traitor-death-match-redemption-component-interact-using-main-message", ("secondMessage", Loc.GetString( - "traitor-death-match-redemption-component-interact-using-pda-different-user-message"))), uid, Filter.Entities(args.User)); + "traitor-death-match-redemption-component-interact-using-pda-different-user-message"))), uid, args.User); return; } @@ -89,7 +89,7 @@ public sealed class TraitorDeathMatchRedemptionSystem : EntitySystem "traitor-death-match-redemption-component-interact-using-main-message", ("secondMessage", Loc.GetString( - "traitor-death-match-redemption-component-interact-using-no-pda-in-pocket-message"))), uid, Filter.Entities(args.User)); + "traitor-death-match-redemption-component-interact-using-no-pda-in-pocket-message"))), uid, args.User); return; } @@ -104,7 +104,7 @@ public sealed class TraitorDeathMatchRedemptionSystem : EntitySystem EntityManager.DeleteEntity(victimUplink.Owner); _popup.PopupEntity(Loc.GetString("traitor-death-match-redemption-component-interact-using-success-message", - ("tcAmount", transferAmount)), uid, Filter.Entities(args.User)); + ("tcAmount", transferAmount)), uid, args.User); args.Handled = true; } diff --git a/Content.Server/VendingMachines/VendingMachineSystem.cs b/Content.Server/VendingMachines/VendingMachineSystem.cs index 68463a97e7..0ac47c629a 100644 --- a/Content.Server/VendingMachines/VendingMachineSystem.cs +++ b/Content.Server/VendingMachines/VendingMachineSystem.cs @@ -200,7 +200,7 @@ namespace Content.Server.VendingMachines { if (!_accessReader.IsAllowed(sender.Value, accessReader) && !vendComponent.Emagged) { - _popupSystem.PopupEntity(Loc.GetString("vending-machine-component-try-eject-access-denied"), uid, Filter.Pvs(uid)); + _popupSystem.PopupEntity(Loc.GetString("vending-machine-component-try-eject-access-denied"), uid); Deny(uid, vendComponent); return false; } @@ -229,14 +229,14 @@ namespace Content.Server.VendingMachines if (entry == null) { - _popupSystem.PopupEntity(Loc.GetString("vending-machine-component-try-eject-invalid-item"), uid, Filter.Pvs(uid)); + _popupSystem.PopupEntity(Loc.GetString("vending-machine-component-try-eject-invalid-item"), uid); Deny(uid, vendComponent); return; } if (entry.Amount <= 0) { - _popupSystem.PopupEntity(Loc.GetString("vending-machine-component-try-eject-out-of-stock"), uid, Filter.Pvs(uid)); + _popupSystem.PopupEntity(Loc.GetString("vending-machine-component-try-eject-out-of-stock"), uid); Deny(uid, vendComponent); return; } diff --git a/Content.Server/Verbs/VerbSystem.cs b/Content.Server/Verbs/VerbSystem.cs index f00a0f60c1..ae7fd11e73 100644 --- a/Content.Server/Verbs/VerbSystem.cs +++ b/Content.Server/Verbs/VerbSystem.cs @@ -76,7 +76,7 @@ namespace Content.Server.Verbs { // Send an informative pop-up message if (!string.IsNullOrWhiteSpace(verb.Message)) - _popupSystem.PopupEntity(verb.Message, user, Filter.Entities(user)); + _popupSystem.PopupEntity(verb.Message, user, user); return; } diff --git a/Content.Server/VoiceMask/VoiceMaskSystem.cs b/Content.Server/VoiceMask/VoiceMaskSystem.cs index 43e2e1dbf9..c738ad5c99 100644 --- a/Content.Server/VoiceMask/VoiceMaskSystem.cs +++ b/Content.Server/VoiceMask/VoiceMaskSystem.cs @@ -34,13 +34,13 @@ public sealed partial class VoiceMaskSystem : EntitySystem { if (message.Name.Length > HumanoidCharacterProfile.MaxNameLength || message.Name.Length <= 0) { - _popupSystem.PopupCursor(Loc.GetString("voice-mask-popup-failure"), Filter.SinglePlayer(message.Session)); + _popupSystem.PopupCursor(Loc.GetString("voice-mask-popup-failure"), message.Session); return; } component.VoiceName = message.Name; - _popupSystem.PopupCursor(Loc.GetString("voice-mask-popup-success"), Filter.SinglePlayer(message.Session)); + _popupSystem.PopupCursor(Loc.GetString("voice-mask-popup-success"), message.Session); TrySetLastKnownName(uid, message.Name); diff --git a/Content.Server/Weapons/Melee/MeleeWeaponSystem.cs b/Content.Server/Weapons/Melee/MeleeWeaponSystem.cs index e51da7c123..aa86696bf5 100644 --- a/Content.Server/Weapons/Melee/MeleeWeaponSystem.cs +++ b/Content.Server/Weapons/Melee/MeleeWeaponSystem.cs @@ -90,7 +90,10 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem if (uid == null) return; - PopupSystem.PopupEntity(message, uid.Value, Filter.Pvs(uid.Value, entityManager: EntityManager).RemoveWhereAttachedEntity(e => e == user)); + if (user == null) + PopupSystem.PopupEntity(message, uid.Value); + else + PopupSystem.PopupEntity(message, uid.Value, Filter.PvsExcept(user.Value, entityManager: EntityManager), true); } protected override bool DoDisarm(EntityUid user, DisarmAttackEvent ev, MeleeWeaponComponent component, ICommonSession? session) @@ -147,7 +150,7 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem return false; } - var filterOther = Filter.Pvs(user, entityManager: EntityManager).RemoveWhereAttachedEntity(e => e == user); + var filterOther = Filter.PvsExcept(user, entityManager: EntityManager); var msgPrefix = "disarm-action-"; if (inTargetHand == null) @@ -160,8 +163,8 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem var msgUser = Loc.GetString(msgPrefix + "popup-message-cursor", ("targetName", Identity.Entity(target, EntityManager))); - PopupSystem.PopupEntity(msgOther, user, filterOther); - PopupSystem.PopupEntity(msgUser, target, Filter.Entities(user)); + PopupSystem.PopupEntity(msgOther, user, filterOther, true); + PopupSystem.PopupEntity(msgUser, target, user); Audio.PlayPvs(combatMode.DisarmSuccessSound, user, AudioParams.Default.WithVariation(0.025f).WithVolume(5f)); AdminLogger.Add(LogType.DisarmedAction, $"{ToPrettyString(user):user} used disarm on {ToPrettyString(target):target}"); @@ -220,7 +223,7 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem public override void DoLunge(EntityUid user, Angle angle, Vector2 localPos, string? animation) { - RaiseNetworkEvent(new MeleeLungeEvent(user, angle, localPos, animation), Filter.Pvs(user, entityManager: EntityManager).RemoveWhereAttachedEntity(e => e == user)); + RaiseNetworkEvent(new MeleeLungeEvent(user, angle, localPos, animation), Filter.PvsExcept(user, entityManager: EntityManager)); } private void OnChemicalInjectorHit(EntityUid owner, MeleeChemicalInjectorComponent comp, MeleeHitEvent args) diff --git a/Content.Server/Weapons/Ranged/Systems/GunSystem.cs b/Content.Server/Weapons/Ranged/Systems/GunSystem.cs index 45b9e79400..83afa89897 100644 --- a/Content.Server/Weapons/Ranged/Systems/GunSystem.cs +++ b/Content.Server/Weapons/Ranged/Systems/GunSystem.cs @@ -79,7 +79,7 @@ public sealed partial class GunSystem : SharedGunSystem Audio.PlayPvs(new SoundPathSpecifier("/Audio/Weapons/Guns/Gunshots/bang.ogg"), gun.Owner); Audio.PlayPvs(new SoundPathSpecifier("/Audio/Items/bikehorn.ogg"), gun.Owner); - PopupSystem.PopupEntity(Loc.GetString("gun-clumsy"), user.Value, Filter.Pvs(user.Value, entityManager: EntityManager)); + PopupSystem.PopupEntity(Loc.GetString("gun-clumsy"), user.Value); Del(gun.Owner); return; } diff --git a/Content.Server/Wieldable/WieldableSystem.cs b/Content.Server/Wieldable/WieldableSystem.cs index 40259867b3..feea5492b4 100644 --- a/Content.Server/Wieldable/WieldableSystem.cs +++ b/Content.Server/Wieldable/WieldableSystem.cs @@ -85,7 +85,7 @@ namespace Content.Server.Wieldable if (!EntityManager.TryGetComponent(user, out var hands)) { if(!quiet) - _popupSystem.PopupEntity(Loc.GetString("wieldable-component-no-hands"), user, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString("wieldable-component-no-hands"), user, user); return false; } @@ -93,7 +93,7 @@ namespace Content.Server.Wieldable if (!_handsSystem.IsHolding(user, uid, out _, hands)) { if (!quiet) - _popupSystem.PopupEntity(Loc.GetString("wieldable-component-not-in-hands", ("item", uid)), user, Filter.Entities(user)); + _popupSystem.PopupEntity(Loc.GetString("wieldable-component-not-in-hands", ("item", uid)), user, user); return false; } @@ -103,7 +103,7 @@ namespace Content.Server.Wieldable { var message = Loc.GetString("wieldable-component-not-enough-free-hands", ("number", component.FreeHandsRequired), ("item", uid)); - _popupSystem.PopupEntity(message, user, Filter.Entities(user)); + _popupSystem.PopupEntity(message, user, user); } return false; } @@ -187,9 +187,9 @@ namespace Content.Server.Wieldable } _popupSystem.PopupEntity(Loc.GetString("wieldable-component-successful-wield", - ("item", uid)), args.User.Value, Filter.Entities(args.User.Value)); + ("item", uid)), args.User.Value, args.User.Value); _popupSystem.PopupEntity(Loc.GetString("wieldable-component-successful-wield-other", - ("user", args.User.Value),("item", uid)), args.User.Value, Filter.PvsExcept(args.User.Value)); + ("user", args.User.Value),("item", uid)), args.User.Value, Filter.PvsExcept(args.User.Value), true); } private void OnItemUnwielded(EntityUid uid, WieldableComponent component, ItemUnwieldedEvent args) @@ -212,9 +212,9 @@ namespace Content.Server.Wieldable _audioSystem.PlayPvs(component.UnwieldSound, uid); _popupSystem.PopupEntity(Loc.GetString("wieldable-component-failed-wield", - ("item", uid)), args.User.Value, Filter.Entities(args.User.Value)); + ("item", uid)), args.User.Value, args.User.Value); _popupSystem.PopupEntity(Loc.GetString("wieldable-component-failed-wield-other", - ("user", args.User.Value), ("item", uid)), args.User.Value, Filter.PvsExcept(args.User.Value)); + ("user", args.User.Value), ("item", uid)), args.User.Value, Filter.PvsExcept(args.User.Value), true); } _virtualItemSystem.DeleteInHandsMatching(args.User.Value, uid); diff --git a/Content.Server/Wires/WiresSystem.cs b/Content.Server/Wires/WiresSystem.cs index e5001610a2..113ea9e48c 100644 --- a/Content.Server/Wires/WiresSystem.cs +++ b/Content.Server/Wires/WiresSystem.cs @@ -412,13 +412,13 @@ public sealed class WiresSystem : EntitySystem if (!EntityManager.TryGetComponent(player, out HandsComponent? handsComponent)) { - _popupSystem.PopupEntity(Loc.GetString("wires-component-ui-on-receive-message-no-hands"), uid, Filter.Entities(player)); + _popupSystem.PopupEntity(Loc.GetString("wires-component-ui-on-receive-message-no-hands"), uid, player); return; } if (!_interactionSystem.InRangeUnobstructed(player, uid)) { - _popupSystem.PopupEntity(Loc.GetString("wires-component-ui-on-receive-message-cannot-reach"), uid, Filter.Entities(player)); + _popupSystem.PopupEntity(Loc.GetString("wires-component-ui-on-receive-message-cannot-reach"), uid, player); return; } @@ -649,13 +649,13 @@ public sealed class WiresSystem : EntitySystem case WiresAction.Cut: if (!_toolSystem.HasQuality(toolEntity, "Cutting", tool)) { - _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-wirecutters"), Filter.Entities(user)); + _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-wirecutters"), user); return; } if (wire.IsCut) { - _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-cannot-cut-cut-wire"), Filter.Entities(user)); + _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-cannot-cut-cut-wire"), user); return; } @@ -663,13 +663,13 @@ public sealed class WiresSystem : EntitySystem case WiresAction.Mend: if (!_toolSystem.HasQuality(toolEntity, "Cutting", tool)) { - _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-wirecutters"), Filter.Entities(user)); + _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-wirecutters"), user); return; } if (!wire.IsCut) { - _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-cannot-mend-uncut-wire"), Filter.Entities(user)); + _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-cannot-mend-uncut-wire"), user); return; } @@ -677,13 +677,13 @@ public sealed class WiresSystem : EntitySystem case WiresAction.Pulse: if (!_toolSystem.HasQuality(toolEntity, "Pulsing", tool)) { - _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-multitool"), Filter.Entities(user)); + _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-multitool"), user); return; } if (wire.IsCut) { - _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-cannot-pulse-cut-wire"), Filter.Entities(user)); + _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-cannot-pulse-cut-wire"), user); return; } @@ -751,13 +751,13 @@ public sealed class WiresSystem : EntitySystem case WiresAction.Cut: if (!_toolSystem.HasQuality(toolEntity, "Cutting", tool)) { - _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-wirecutters"), Filter.Entities(user)); + _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-wirecutters"), user); break; } if (wire.IsCut) { - _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-cannot-cut-cut-wire"), Filter.Entities(user)); + _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-cannot-cut-cut-wire"), user); break; } @@ -772,13 +772,13 @@ public sealed class WiresSystem : EntitySystem case WiresAction.Mend: if (!_toolSystem.HasQuality(toolEntity, "Cutting", tool)) { - _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-wirecutters"), Filter.Entities(user)); + _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-wirecutters"), user); break; } if (!wire.IsCut) { - _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-cannot-mend-uncut-wire"), Filter.Entities(user)); + _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-cannot-mend-uncut-wire"), user); break; } @@ -793,13 +793,13 @@ public sealed class WiresSystem : EntitySystem case WiresAction.Pulse: if (!_toolSystem.HasQuality(toolEntity, "Pulsing", tool)) { - _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-multitool"), Filter.Entities(user)); + _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-need-multitool"), user); break; } if (wire.IsCut) { - _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-cannot-pulse-cut-wire"), Filter.Entities(user)); + _popupSystem.PopupCursor(Loc.GetString("wires-component-ui-on-receive-message-cannot-pulse-cut-wire"), user); break; } diff --git a/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs b/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs index bfe4bdb401..83fdd5a8a1 100644 --- a/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs +++ b/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs @@ -272,7 +272,7 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem if (msg == null) return; - _popup.PopupEntity(Loc.GetString("analysis-console-print-popup"), uid, Filter.Pvs(uid)); + _popup.PopupEntity(Loc.GetString("analysis-console-print-popup"), uid); _paper.SetContent(report, msg.ToMarkup()); UpdateUserInterface(uid, component); } @@ -351,7 +351,7 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem _audio.PlayPvs(component.DestroySound, component.AnalyzerEntity.Value, AudioParams.Default.WithVolume(2f)); _popup.PopupEntity(Loc.GetString("analyzer-artifact-destroy-popup"), - component.AnalyzerEntity.Value, Filter.Pvs(component.AnalyzerEntity.Value), PopupType.Large); + component.AnalyzerEntity.Value, PopupType.Large); UpdateUserInterface(uid, component); } diff --git a/Content.Server/Xenoarchaeology/Equipment/Systems/TraversalDistorterSystem.cs b/Content.Server/Xenoarchaeology/Equipment/Systems/TraversalDistorterSystem.cs index f1dacaabca..190cb51bdd 100644 --- a/Content.Server/Xenoarchaeology/Equipment/Systems/TraversalDistorterSystem.cs +++ b/Content.Server/Xenoarchaeology/Equipment/Systems/TraversalDistorterSystem.cs @@ -58,7 +58,7 @@ public sealed class TraversalDistorterSystem : EntitySystem toPopup = Loc.GetString("traversal-distorter-set-out"); break; } - _popup.PopupEntity(toPopup, uid, Filter.Pvs(uid)); + _popup.PopupEntity(toPopup, uid); } private void OnExamine(EntityUid uid, TraversalDistorterComponent component, ExaminedEvent args) diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/RandomTeleportArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/RandomTeleportArtifactSystem.cs index a8da6c9a51..c366a33e82 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/RandomTeleportArtifactSystem.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/RandomTeleportArtifactSystem.cs @@ -23,7 +23,7 @@ public sealed class RandomTeleportArtifactSystem : EntitySystem private void OnActivate(EntityUid uid, RandomTeleportArtifactComponent component, ArtifactActivatedEvent args) { var xform = Transform(uid); - _popup.PopupCoordinates(Loc.GetString("blink-artifact-popup"), xform.Coordinates, Filter.Pvs(uid), PopupType.Medium); + _popup.PopupCoordinates(Loc.GetString("blink-artifact-popup"), xform.Coordinates, PopupType.Medium); xform.Coordinates = xform.Coordinates.Offset(_random.NextVector2(component.Range)); } diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/TelepathicArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/TelepathicArtifactSystem.cs index 06be114d42..df06d4ab01 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/TelepathicArtifactSystem.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/TelepathicArtifactSystem.cs @@ -44,7 +44,7 @@ public sealed class TelepathicArtifactSystem : EntitySystem var msg = Loc.GetString(msgId); // show it as a popup, but only for the victim - _popupSystem.PopupEntity(msg, victimUid, Filter.Entities(victimUid)); + _popupSystem.PopupEntity(msg, victimUid, victimUid); } } } diff --git a/Content.Server/Zombies/ZombifyOnDeathSystem.cs b/Content.Server/Zombies/ZombifyOnDeathSystem.cs index c470998599..042ff30a71 100644 --- a/Content.Server/Zombies/ZombifyOnDeathSystem.cs +++ b/Content.Server/Zombies/ZombifyOnDeathSystem.cs @@ -156,7 +156,7 @@ namespace Content.Server.Zombies _serverInventory.TryUnequip(target, "gloves", true, true); //popup - _popupSystem.PopupEntity(Loc.GetString("zombie-transform", ("target", target)), target, Filter.Pvs(target), PopupType.LargeCaution); + _popupSystem.PopupEntity(Loc.GetString("zombie-transform", ("target", target)), target, PopupType.LargeCaution); //Make it sentient if it's an animal or something if (!HasComp(target)) //this component is cursed and fucks shit up diff --git a/Content.Shared/Actions/SharedActionsSystem.cs b/Content.Shared/Actions/SharedActionsSystem.cs index 5a8a92072c..0d0dbffda4 100644 --- a/Content.Shared/Actions/SharedActionsSystem.cs +++ b/Content.Shared/Actions/SharedActionsSystem.cs @@ -321,7 +321,7 @@ public abstract class SharedActionsSystem : EntitySystem if (action.Sound == null && string.IsNullOrWhiteSpace(action.Popup)) return false; - var filter = Filter.Pvs(performer).RemoveWhereAttachedEntity(e => e == performer); + var filter = Filter.PvsExcept(performer); _audio.Play(action.Sound, filter, performer, true, action.AudioParams); @@ -332,7 +332,7 @@ public abstract class SharedActionsSystem : EntitySystem ? Loc.GetString(action.Popup) : Loc.GetString(action.Popup + action.PopupToggleSuffix); - _popupSystem.PopupEntity(msg, performer, filter); + _popupSystem.PopupEntity(msg, performer, filter, true); return true; } diff --git a/Content.Shared/Blocking/BlockingSystem.cs b/Content.Shared/Blocking/BlockingSystem.cs index fb392ebc6e..3bb4f08cb7 100644 --- a/Content.Shared/Blocking/BlockingSystem.cs +++ b/Content.Shared/Blocking/BlockingSystem.cs @@ -180,8 +180,8 @@ public sealed partial class BlockingSystem : EntitySystem return false; } _actionsSystem.SetToggled(component.BlockingToggleAction, true); - _popupSystem.PopupEntity(msgUser, user, Filter.Entities(user)); - _popupSystem.PopupEntity(msgOther, user, Filter.Pvs(user).RemoveWhereAttachedEntity(e => e == user)); + _popupSystem.PopupEntity(msgUser, user, user); + _popupSystem.PopupEntity(msgOther, user, Filter.PvsExcept(user), true); } if (TryComp(user, out var physicsComponent)) @@ -204,13 +204,13 @@ public sealed partial class BlockingSystem : EntitySystem private void CantBlockError(EntityUid user) { var msgError = Loc.GetString("action-popup-blocking-user-cant-block"); - _popupSystem.PopupEntity(msgError, user, Filter.Entities(user)); + _popupSystem.PopupEntity(msgError, user, user); } private void TooCloseError(EntityUid user) { var msgError = Loc.GetString("action-popup-blocking-user-too-close"); - _popupSystem.PopupEntity(msgError, user, Filter.Entities(user)); + _popupSystem.PopupEntity(msgError, user, user); } /// @@ -245,8 +245,8 @@ public sealed partial class BlockingSystem : EntitySystem _actionsSystem.SetToggled(component.BlockingToggleAction, false); _fixtureSystem.DestroyFixture(physicsComponent, BlockingComponent.BlockFixtureID); _physics.SetBodyType(physicsComponent, blockingUserComponent.OriginalBodyType); - _popupSystem.PopupEntity(msgUser, user, Filter.Entities(user)); - _popupSystem.PopupEntity(msgOther, user, Filter.Pvs(user).RemoveWhereAttachedEntity(e => e == user)); + _popupSystem.PopupEntity(msgUser, user, user); + _popupSystem.PopupEntity(msgOther, user, Filter.PvsExcept(user), true); } component.IsBlocking = false; diff --git a/Content.Shared/Clothing/EntitySystems/ToggleableClothingSystem.cs b/Content.Shared/Clothing/EntitySystems/ToggleableClothingSystem.cs index dcbf1ca3ac..7d7a652943 100644 --- a/Content.Shared/Clothing/EntitySystems/ToggleableClothingSystem.cs +++ b/Content.Shared/Clothing/EntitySystems/ToggleableClothingSystem.cs @@ -146,7 +146,7 @@ public sealed class ToggleableClothingSystem : EntitySystem else if (_inventorySystem.TryGetSlotEntity(parent, component.Slot, out var existing)) { _popupSystem.PopupEntity(Loc.GetString("toggleable-clothing-remove-first", ("entity", existing)), - args.Performer, Filter.Entities(args.Performer)); + args.Performer, args.Performer); } else _inventorySystem.TryEquip(parent, component.ClothingUid.Value, component.Slot); diff --git a/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs b/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs index 0b1d1dcf76..556c149886 100644 --- a/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs +++ b/Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs @@ -249,7 +249,7 @@ namespace Content.Shared.Containers.ItemSlots if (slot.Whitelist != null && !slot.Whitelist.IsValid(usedUid)) { if (_netManager.IsClient && _timing.IsFirstTimePredicted && popup.HasValue && !string.IsNullOrWhiteSpace(slot.WhitelistFailPopup)) - _popupSystem.PopupEntity(Loc.GetString(slot.WhitelistFailPopup), uid, Filter.Entities(popup.Value)); + _popupSystem.PopupEntity(Loc.GetString(slot.WhitelistFailPopup), uid, popup.Value); return false; } diff --git a/Content.Shared/Damage/Systems/StaminaSystem.cs b/Content.Shared/Damage/Systems/StaminaSystem.cs index 8645961338..f2ecf2c090 100644 --- a/Content.Shared/Damage/Systems/StaminaSystem.cs +++ b/Content.Shared/Damage/Systems/StaminaSystem.cs @@ -129,8 +129,8 @@ public sealed class StaminaSystem : EntitySystem var targetEnt = Identity.Entity(args.Target, EntityManager); var sourceEnt = Identity.Entity(args.Source, EntityManager); - _popup.PopupEntity(Loc.GetString("stunned-component-disarm-success-others", ("source", sourceEnt), ("target", targetEnt)), targetEnt, Filter.PvsExcept(args.Source), PopupType.LargeCaution); - _popup.PopupCursor(Loc.GetString("stunned-component-disarm-success", ("target", targetEnt)), Filter.Entities(args.Source), PopupType.Large); + _popup.PopupEntity(Loc.GetString("stunned-component-disarm-success-others", ("source", sourceEnt), ("target", targetEnt)), targetEnt, Filter.PvsExcept(args.Source), true, PopupType.LargeCaution); + _popup.PopupCursor(Loc.GetString("stunned-component-disarm-success", ("target", targetEnt)), args.Source, PopupType.Large); _adminLogger.Add(LogType.DisarmedKnockdown, LogImpact.Medium, $"{ToPrettyString(args.Source):user} knocked down {ToPrettyString(args.Target):target}"); @@ -178,7 +178,7 @@ public sealed class StaminaSystem : EntitySystem TakeStaminaDamage(comp.Owner, damage / toHit.Count, comp, source:args.User, with:component.Owner); if (comp.StaminaDamage.Equals(oldDamage)) { - _popup.PopupEntity(Loc.GetString("stamina-resist"), comp.Owner, Filter.Entities(args.User)); + _popup.PopupEntity(Loc.GetString("stamina-resist"), comp.Owner, args.User); } } } diff --git a/Content.Shared/Implants/SharedImplanterSystem.cs b/Content.Shared/Implants/SharedImplanterSystem.cs index 53c9cd81dd..995b9f829d 100644 --- a/Content.Shared/Implants/SharedImplanterSystem.cs +++ b/Content.Shared/Implants/SharedImplanterSystem.cs @@ -96,7 +96,7 @@ public abstract class SharedImplanterSystem : EntitySystem var implantName = Identity.Entity(implant, EntityManager); var targetName = Identity.Entity(target, EntityManager); var failedPermanentMessage = Loc.GetString("implanter-draw-failed-permanent", ("implant", implantName), ("target", targetName)); - _popup.PopupEntity(failedPermanentMessage, target, Filter.Entities(user)); + _popup.PopupEntity(failedPermanentMessage, target, user); permanentFound = implantComp.Permanent; continue; } diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index 764caaad53..dfbacb396a 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -578,7 +578,7 @@ namespace Content.Shared.Interaction if (!inRange && popup && _gameTiming.IsFirstTimePredicted) { var message = Loc.GetString("interaction-system-user-interaction-cannot-reach"); - _popupSystem.PopupEntity(message, origin, Filter.Entities(origin)); + _popupSystem.PopupEntity(message, origin, origin); } return inRange; @@ -723,7 +723,7 @@ namespace Content.Shared.Interaction if (!inRange && popup && _gameTiming.IsFirstTimePredicted) { var message = Loc.GetString("interaction-system-user-interaction-cannot-reach"); - _popupSystem.PopupEntity(message, origin, Filter.Entities(origin)); + _popupSystem.PopupEntity(message, origin, origin); } return inRange; diff --git a/Content.Shared/Inventory/InventorySystem.Equip.cs b/Content.Shared/Inventory/InventorySystem.Equip.cs index 2c110520bd..8b4eb58a07 100644 --- a/Content.Shared/Inventory/InventorySystem.Equip.cs +++ b/Content.Shared/Inventory/InventorySystem.Equip.cs @@ -140,7 +140,7 @@ public abstract partial class InventorySystem if (!CanEquip(actor, held.Value, ev.Slot, out var reason)) { if (_gameTiming.IsFirstTimePredicted) - _popup.PopupCursor(Loc.GetString(reason), Filter.Local()); + _popup.PopupCursor(Loc.GetString(reason)); return; } @@ -166,7 +166,7 @@ public abstract partial class InventorySystem if (!Resolve(target, ref inventory, false)) { if(!silent && _gameTiming.IsFirstTimePredicted) - _popup.PopupCursor(Loc.GetString("inventory-component-can-equip-cannot"), Filter.Local()); + _popup.PopupCursor(Loc.GetString("inventory-component-can-equip-cannot")); return false; } @@ -177,21 +177,21 @@ public abstract partial class InventorySystem if (!TryGetSlotContainer(target, slot, out var slotContainer, out var slotDefinition, inventory)) { if(!silent && _gameTiming.IsFirstTimePredicted) - _popup.PopupCursor(Loc.GetString("inventory-component-can-equip-cannot"), Filter.Local()); + _popup.PopupCursor(Loc.GetString("inventory-component-can-equip-cannot")); return false; } if (!force && !CanEquip(actor, target, itemUid, slot, out var reason, slotDefinition, inventory, clothing)) { if(!silent && _gameTiming.IsFirstTimePredicted) - _popup.PopupCursor(Loc.GetString(reason), Filter.Local()); + _popup.PopupCursor(Loc.GetString(reason)); return false; } if (!slotContainer.Insert(itemUid)) { if(!silent && _gameTiming.IsFirstTimePredicted) - _popup.PopupCursor(Loc.GetString("inventory-component-can-unequip-cannot"), Filter.Local()); + _popup.PopupCursor(Loc.GetString("inventory-component-can-unequip-cannot")); return false; } @@ -342,14 +342,14 @@ public abstract partial class InventorySystem if (!Resolve(target, ref inventory, false)) { if(!silent && _gameTiming.IsFirstTimePredicted) - _popup.PopupCursor(Loc.GetString("inventory-component-can-unequip-cannot"), Filter.Local()); + _popup.PopupCursor(Loc.GetString("inventory-component-can-unequip-cannot")); return false; } if (!TryGetSlotContainer(target, slot, out var slotContainer, out var slotDefinition, inventory)) { if(!silent && _gameTiming.IsFirstTimePredicted) - _popup.PopupCursor(Loc.GetString("inventory-component-can-unequip-cannot"), Filter.Local()); + _popup.PopupCursor(Loc.GetString("inventory-component-can-unequip-cannot")); return false; } @@ -360,7 +360,7 @@ public abstract partial class InventorySystem if (!force && !CanUnequip(actor, target, slot, out var reason, slotContainer, slotDefinition, inventory)) { if(!silent && _gameTiming.IsFirstTimePredicted) - _popup.PopupCursor(Loc.GetString(reason), Filter.Local()); + _popup.PopupCursor(Loc.GetString(reason)); return false; } diff --git a/Content.Shared/Mech/EntitySystems/SharedMechSystem.cs b/Content.Shared/Mech/EntitySystems/SharedMechSystem.cs index 21edf6a25f..d7e63aece8 100644 --- a/Content.Shared/Mech/EntitySystems/SharedMechSystem.cs +++ b/Content.Shared/Mech/EntitySystems/SharedMechSystem.cs @@ -237,7 +237,8 @@ public abstract class SharedMechSystem : EntitySystem : Loc.GetString("mech-equipment-select-none-popup"); if (_timing.IsFirstTimePredicted) - _popup.PopupEntity(popupString, uid, Filter.Pvs(uid)); + _popup.PopupEntity(popupString, uid); + Dirty(component); } diff --git a/Content.Shared/Movement/Systems/SharedJetpackSystem.cs b/Content.Shared/Movement/Systems/SharedJetpackSystem.cs index 9e2bb5da7d..cb18fac036 100644 --- a/Content.Shared/Movement/Systems/SharedJetpackSystem.cs +++ b/Content.Shared/Movement/Systems/SharedJetpackSystem.cs @@ -55,7 +55,7 @@ public abstract class SharedJetpackSystem : EntitySystem jetpackQuery.TryGetComponent(user.Jetpack, out var jetpack)) { if (_timing.IsFirstTimePredicted) - _popups.PopupEntity(Loc.GetString("jetpack-to-grid"), user.Jetpack, Filter.Entities(user.Owner)); + _popups.PopupEntity(Loc.GetString("jetpack-to-grid"), user.Jetpack, user.Owner); SetEnabled(jetpack, false, user.Owner); } @@ -94,7 +94,7 @@ public abstract class SharedJetpackSystem : EntitySystem SetEnabled(jetpack, false, uid); if (_timing.IsFirstTimePredicted && _network.IsClient) - _popups.PopupEntity(Loc.GetString("jetpack-to-grid"), uid, Filter.Entities(uid)); + _popups.PopupEntity(Loc.GetString("jetpack-to-grid"), uid, uid); } } @@ -120,7 +120,7 @@ public abstract class SharedJetpackSystem : EntitySystem if (TryComp(uid, out var xform) && !CanEnableOnGrid(xform.GridUid)) { if (_timing.IsFirstTimePredicted) - _popups.PopupEntity(Loc.GetString("jetpack-no-station"), uid, Filter.Entities(args.Performer)); + _popups.PopupEntity(Loc.GetString("jetpack-no-station"), uid, args.Performer); return; } diff --git a/Content.Shared/Popups/SharedPopupExtensions.cs b/Content.Shared/Popups/SharedPopupExtensions.cs index 8b04179f7f..94305330ef 100644 --- a/Content.Shared/Popups/SharedPopupExtensions.cs +++ b/Content.Shared/Popups/SharedPopupExtensions.cs @@ -17,7 +17,7 @@ namespace Content.Shared.Popups { var popupSystem = EntitySystem.Get(); - popupSystem.PopupEntity(message, source, Filter.Entities(viewer)); + popupSystem.PopupEntity(message, source, viewer); } /// @@ -42,7 +42,7 @@ namespace Content.Shared.Popups public static void PopupMessageCursor(this EntityUid viewer, string message) { var popupSystem = EntitySystem.Get(); - popupSystem.PopupCursor(message, Filter.Entities(viewer)); + popupSystem.PopupCursor(message, viewer); } } } diff --git a/Content.Shared/Popups/SharedPopupSystem.cs b/Content.Shared/Popups/SharedPopupSystem.cs index a2492d289d..cc4baac717 100644 --- a/Content.Shared/Popups/SharedPopupSystem.cs +++ b/Content.Shared/Popups/SharedPopupSystem.cs @@ -1,5 +1,6 @@ using Robust.Shared.Map; using Robust.Shared.Player; +using Robust.Shared.Players; using Robust.Shared.Serialization; namespace Content.Shared.Popups @@ -10,30 +11,77 @@ namespace Content.Shared.Popups public abstract class SharedPopupSystem : EntitySystem { /// - /// Shows a popup on the users' cursors. + /// Shows a popup at the local users' cursor. Does nothing on the server. /// /// The message to display. - /// Filter for the players that will see the popup. /// Used to customize how this popup should appear visually. - public abstract void PopupCursor(string message, Filter filter, PopupType type=PopupType.Small); + public abstract void PopupCursor(string message, PopupType type = PopupType.Small); /// - /// Shows a popup at a world location. + /// Shows a popup at a users' cursor. + /// + /// The message to display. + /// Client that will see this popup. + /// Used to customize how this popup should appear visually. + public abstract void PopupCursor(string message, ICommonSession recipient, PopupType type = PopupType.Small); + + /// + /// Shows a popup at a users' cursor. + /// + /// The message to display. + /// Client that will see this popup. + /// Used to customize how this popup should appear visually. + public abstract void PopupCursor(string message, EntityUid recipient, PopupType type = PopupType.Small); + + /// + /// Shows a popup at a world location to every entity in PVS range. /// /// The message to display. /// The coordinates where to display the message. - /// Filter for the players that will see the popup. /// Used to customize how this popup should appear visually. - public abstract void PopupCoordinates(string message, EntityCoordinates coordinates, Filter filter, PopupType type=PopupType.Small); + public abstract void PopupCoordinates(string message, EntityCoordinates coordinates, PopupType type = PopupType.Small); /// - /// Shows a popup above an entity. + /// Filtered variant of , which should only be used + /// if the filtering has to be more specific than simply PVS range based. + /// + /// Filter for the players that will see the popup. + /// If true, this pop-up will be considered as a globally visible pop-up that gets shown during replays. + public abstract void PopupCoordinates(string message, EntityCoordinates coordinates, Filter filter, bool recordReplay, PopupType type = PopupType.Small); + + /// + /// Variant of that sends a pop-up to the player attached to some entity. + /// + public abstract void PopupCoordinates(string message, EntityCoordinates coordinates, EntityUid recipient, PopupType type = PopupType.Small); + + /// + /// Variant of that sends a pop-up to a specific player. + /// + public abstract void PopupCoordinates(string message, EntityCoordinates coordinates, ICommonSession recipient, PopupType type = PopupType.Small); + + /// + /// Shows a popup above an entity for every player in pvs range. /// /// The message to display. /// The UID of the entity. - /// Filter for the players that will see the popup. /// Used to customize how this popup should appear visually. - public abstract void PopupEntity(string message, EntityUid uid, Filter filter, PopupType type=PopupType.Small); + public abstract void PopupEntity(string message, EntityUid uid, PopupType type=PopupType.Small); + + /// + /// Variant of that shoes the popup only to some specific client. + /// + public abstract void PopupEntity(string message, EntityUid uid, EntityUid recipient, PopupType type = PopupType.Small); + + /// + /// Variant of that shoes the popup only to some specific client. + /// + public abstract void PopupEntity(string message, EntityUid uid, ICommonSession recipient, PopupType type = PopupType.Small); + + /// + /// Filtered variant of , which should only be used + /// if the filtering has to be more specific than simply PVS range based. + /// + public abstract void PopupEntity(string message, EntityUid uid, Filter filter, bool recordReplay, PopupType type = PopupType.Small); } /// diff --git a/Content.Shared/Speech/Muting/MutingSystem.cs b/Content.Shared/Speech/Muting/MutingSystem.cs index 0f3e89e91a..3dfc14e521 100644 --- a/Content.Shared/Speech/Muting/MutingSystem.cs +++ b/Content.Shared/Speech/Muting/MutingSystem.cs @@ -14,7 +14,7 @@ namespace Content.Shared.Speech.Muting private void OnSpeakAttempt(EntityUid uid, MutedComponent component, SpeakAttemptEvent args) { - _popupSystem.PopupEntity(Loc.GetString("speech-muted"), uid, Filter.Entities(uid)); + _popupSystem.PopupEntity(Loc.GetString("speech-muted"), uid, uid); args.Cancel(); } } diff --git a/Content.Shared/Stacks/SharedStackSystem.cs b/Content.Shared/Stacks/SharedStackSystem.cs index 46e9155956..678ee81fd1 100644 --- a/Content.Shared/Stacks/SharedStackSystem.cs +++ b/Content.Shared/Stacks/SharedStackSystem.cs @@ -72,18 +72,18 @@ namespace Content.Shared.Stacks switch (transfered) { case > 0: - PopupSystem.PopupCoordinates($"+{transfered}", popupPos, Filter.Local()); + PopupSystem.PopupCoordinates($"+{transfered}", popupPos); if (GetAvailableSpace(recipientStack) == 0) { PopupSystem.PopupCoordinates(Loc.GetString("comp-stack-becomes-full"), - popupPos.Offset(new Vector2(0, -0.5f)), Filter.Local()); + popupPos.Offset(new Vector2(0, -0.5f))); } break; case 0 when GetAvailableSpace(recipientStack) == 0: - PopupSystem.PopupCoordinates(Loc.GetString("comp-stack-already-full"), popupPos, Filter.Local()); + PopupSystem.PopupCoordinates(Loc.GetString("comp-stack-already-full"), popupPos); break; } }