diff --git a/Content.Server/Buckle/Components/BuckleComponent.cs b/Content.Server/Buckle/Components/BuckleComponent.cs index 8204b0826e..d30e904b0f 100644 --- a/Content.Server/Buckle/Components/BuckleComponent.cs +++ b/Content.Server/Buckle/Components/BuckleComponent.cs @@ -17,6 +17,7 @@ using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.Player; using Robust.Shared.Timing; +using Content.Shared.IdentityManagement; namespace Content.Server.Buckle.Components { @@ -169,7 +170,7 @@ namespace Content.Server.Buckle.Components { var message = Loc.GetString(Owner == user ? "buckle-component-already-buckled-message" - : "buckle-component-other-already-buckled-message", ("owner", Owner)); + : "buckle-component-other-already-buckled-message", ("owner", Identity.Entity(Owner, _entMan))); popupSystem.PopupEntity(message, user, Filter.Entities(user)); return false; @@ -182,7 +183,7 @@ namespace Content.Server.Buckle.Components { var message = Loc.GetString(Owner == user ? "buckle-component-cannot-buckle-message" - : "buckle-component-other-cannot-buckle-message", ("owner", Owner)); + : "buckle-component-other-cannot-buckle-message", ("owner", Identity.Entity(Owner, _entMan))); popupSystem.PopupEntity(message, user, Filter.Entities(user)); return false; @@ -195,7 +196,7 @@ namespace Content.Server.Buckle.Components { var message = Loc.GetString(Owner == user ? "buckle-component-cannot-fit-message" - : "buckle-component-other-cannot-fit-message", ("owner", Owner)); + : "buckle-component-other-cannot-fit-message", ("owner", Identity.Entity(Owner, _entMan))); popupSystem.PopupEntity(message, user, Filter.Entities(user)); return false; @@ -218,7 +219,7 @@ namespace Content.Server.Buckle.Components { var message = Loc.GetString(Owner == user ? "buckle-component-cannot-buckle-message" - : "buckle-component-other-cannot-buckle-message", ("owner", Owner)); + : "buckle-component-other-cannot-buckle-message", ("owner", Identity.Entity(Owner, _entMan))); popupSystem.PopupEntity(message, user, Filter.Entities(user)); return false; } diff --git a/Content.Server/Cargo/Systems/PriceGunSystem.cs b/Content.Server/Cargo/Systems/PriceGunSystem.cs index 569e1bb0d4..af4baa7b0a 100644 --- a/Content.Server/Cargo/Systems/PriceGunSystem.cs +++ b/Content.Server/Cargo/Systems/PriceGunSystem.cs @@ -1,5 +1,6 @@ -using Content.Server.Cargo.Components; +using Content.Server.Cargo.Components; using Content.Server.Popups; +using Content.Shared.IdentityManagement; using Content.Shared.Interaction; using Content.Shared.Timing; using Robust.Shared.Player; @@ -31,7 +32,7 @@ public sealed class PriceGunSystem : EntitySystem var price = _pricingSystem.GetPrice(args.Target.Value); - _popupSystem.PopupEntity(Loc.GetString("price-gun-pricing-result", ("object", args.Target.Value), ("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, Filter.Entities(args.User)); _useDelay.BeginDelay(uid, useDelay); } } diff --git a/Content.Server/Climbing/ClimbSystem.cs b/Content.Server/Climbing/ClimbSystem.cs index 2f60968750..d41f94d45c 100644 --- a/Content.Server/Climbing/ClimbSystem.cs +++ b/Content.Server/Climbing/ClimbSystem.cs @@ -328,7 +328,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", args.Climber)), args.Climber, + Loc.GetString("glass-table-shattered-others", ("table", uid), ("climber", Identity.Entity(args.Climber, EntityManager))), args.Climber, Filter.Pvs(uid).RemoveWhereAttachedEntity(puid => puid == args.Climber)); } diff --git a/Content.Server/Disease/DiseaseSystem.cs b/Content.Server/Disease/DiseaseSystem.cs index a0b7405a5a..1f89f0e900 100644 --- a/Content.Server/Disease/DiseaseSystem.cs +++ b/Content.Server/Disease/DiseaseSystem.cs @@ -19,6 +19,7 @@ using Robust.Shared.Serialization.Manager; using Content.Shared.Inventory.Events; using Content.Server.Nutrition.EntitySystems; using Robust.Shared.Utility; +using Content.Shared.IdentityManagement; namespace Content.Server.Disease { @@ -441,7 +442,7 @@ namespace Content.Server.Disease if (!Resolve(uid, ref xform)) return; if (!string.IsNullOrEmpty(snoughMessage)) - _popupSystem.PopupEntity(Loc.GetString(snoughMessage, ("person", uid)), uid, Filter.Pvs(uid)); + _popupSystem.PopupEntity(Loc.GetString(snoughMessage, ("person", Identity.Entity(uid, EntityManager))), uid, Filter.Pvs(uid)); if (disease is not { Infectious: true } || !airTransmit) return; diff --git a/Content.Server/Disease/Effects/DiseasePopUp.cs b/Content.Server/Disease/Effects/DiseasePopUp.cs index 3de3adfccb..fac7f4454d 100644 --- a/Content.Server/Disease/Effects/DiseasePopUp.cs +++ b/Content.Server/Disease/Effects/DiseasePopUp.cs @@ -2,6 +2,7 @@ using Content.Shared.Disease; using Content.Shared.Popups; using Robust.Shared.Player; using JetBrains.Annotations; +using Content.Shared.IdentityManagement; namespace Content.Server.Disease.Effects { @@ -24,12 +25,12 @@ namespace Content.Server.Disease.Effects public override void Effect(DiseaseEffectArgs args) { - var popupSys = EntitySystem.Get(); + var popupSys = args.EntityManager.EntitySysManager.GetEntitySystem(); if (Type == PopupRecipients.Local) popupSys.PopupEntity(Loc.GetString(Message), args.DiseasedEntity, Filter.Entities(args.DiseasedEntity), VisualType); else if (Type == PopupRecipients.Pvs) - popupSys.PopupEntity(Loc.GetString(Message, ("person", args.DiseasedEntity)), args.DiseasedEntity, Filter.Pvs(args.DiseasedEntity), VisualType); + popupSys.PopupEntity(Loc.GetString(Message, ("person", Identity.Entity(args.DiseasedEntity, args.EntityManager))), args.DiseasedEntity, Filter.Pvs(args.DiseasedEntity), VisualType); } } diff --git a/Content.Server/Drone/DroneSystem.cs b/Content.Server/Drone/DroneSystem.cs index 66eeb2728c..416b58d986 100644 --- a/Content.Server/Drone/DroneSystem.cs +++ b/Content.Server/Drone/DroneSystem.cs @@ -24,6 +24,7 @@ using Content.Shared.Popups; using Content.Shared.Storage; using Robust.Shared.Random; using Robust.Shared.Timing; +using Content.Shared.IdentityManagement; namespace Content.Server.Drone { @@ -184,7 +185,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", entity)), uid, Filter.Entities(uid)); + _popupSystem.PopupEntity(Loc.GetString("drone-too-close", ("being", Identity.Entity(entity, EntityManager))), uid, Filter.Entities(uid)); return true; } } diff --git a/Content.Server/Kitchen/EntitySystems/KitchenSpikeSystem.cs b/Content.Server/Kitchen/EntitySystems/KitchenSpikeSystem.cs index e8c5cb0921..a91bc7ace1 100644 --- a/Content.Server/Kitchen/EntitySystems/KitchenSpikeSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/KitchenSpikeSystem.cs @@ -187,7 +187,7 @@ namespace Content.Server.Kitchen.EntitySystems if (!Resolve(victimUid, ref butcherable, false)) { - _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-butcher", ("victim", victimUid), ("this", uid)), victimUid, Filter.Entities(userUid)); + _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-butcher", ("victim", Identity.Entity(victimUid, EntityManager)), ("this", uid)), victimUid, Filter.Entities(userUid)); return false; } @@ -196,10 +196,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", victimUid), ("this", uid)), victimUid, Filter.Entities(userUid)); + _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-butcher-knife", ("victim", Identity.Entity(victimUid, EntityManager)), ("this", uid)), victimUid, Filter.Entities(userUid)); return false; default: - _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-butcher", ("victim", victimUid), ("this", uid)), victimUid, Filter.Entities(userUid)); + _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-butcher", ("victim", Identity.Entity(victimUid, EntityManager)), ("this", uid)), victimUid, Filter.Entities(userUid)); return false; } } @@ -216,14 +216,14 @@ namespace Content.Server.Kitchen.EntitySystems if (Resolve(victimUid, ref mobState, false) && !mobState.IsDead()) { - _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-not-dead", ("victim", victimUid)), + _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-not-dead", ("victim", Identity.Entity(victimUid, EntityManager))), victimUid, Filter.Entities(userUid)); return true; } if (userUid != victimUid) { - _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-begin-hook-victim", ("user", userUid), ("this", uid)), victimUid, + _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-begin-hook-victim", ("user", Identity.Entity(userUid, EntityManager)), ("this", uid)), victimUid, Filter.Entities(victimUid), PopupType.LargeCaution); } // TODO: make it work when SuicideEvent is implemented diff --git a/Content.Server/Medical/VomitSystem.cs b/Content.Server/Medical/VomitSystem.cs index 9367243380..ef14593183 100644 --- a/Content.Server/Medical/VomitSystem.cs +++ b/Content.Server/Medical/VomitSystem.cs @@ -10,6 +10,7 @@ using Content.Shared.StatusEffect; using Content.Shared.Audio; using Robust.Shared.Audio; using Robust.Shared.Player; +using Content.Shared.IdentityManagement; namespace Content.Server.Medical { @@ -52,7 +53,7 @@ namespace Content.Server.Medical SoundSystem.Play("/Audio/Effects/Diseases/vomiting.ogg", Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.2f).WithVolume(-4f)); - _popupSystem.PopupEntity(Loc.GetString("disease-vomit", ("person", uid)), uid, Filter.Pvs(uid)); + _popupSystem.PopupEntity(Loc.GetString("disease-vomit", ("person", Identity.Entity(uid, EntityManager))), uid, Filter.Pvs(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 e10f620843..effc609535 100644 --- a/Content.Server/Morgue/CrematoriumSystem.cs +++ b/Content.Server/Morgue/CrematoriumSystem.cs @@ -15,6 +15,7 @@ using Content.Server.Storage.EntitySystems; using Content.Shared.Examine; using Content.Shared.Standing; using Content.Shared.Storage; +using Content.Shared.IdentityManagement; namespace Content.Server.Morgue; @@ -143,7 +144,8 @@ public sealed class CrematoriumSystem : EntitySystem } } - _popup.PopupEntity(Loc.GetString("crematorium-entity-storage-component-suicide-message-others", ("victim", victim)), + _popup.PopupEntity(Loc.GetString("crematorium-entity-storage-component-suicide-message-others", + ("victim", Identity.Entity(victim, EntityManager))), victim, Filter.PvsExcept(victim), PopupType.LargeCaution); if (_entityStorage.CanInsert(uid)) diff --git a/Content.Server/PAI/PAISystem.cs b/Content.Server/PAI/PAISystem.cs index 20476d549e..b3e1530a47 100644 --- a/Content.Server/PAI/PAISystem.cs +++ b/Content.Server/PAI/PAISystem.cs @@ -70,6 +70,12 @@ namespace Content.Server.PAI // Ownership tag string val = Loc.GetString("pai-system-pai-name", ("owner", args.User)); + + // TODO Identity? People shouldn't dox-themselves by carrying around a PAI. + // But having the pda's name permanently be "old lady's PAI" is weird. + // Changing the PAI's identity in a way that ties it to the owner's identity also seems weird. + // Cause then you could remotely figure out information about the owner's equipped items. + EntityManager.GetComponent(component.Owner).EntityName = val; var ghostFinder = EntityManager.EnsureComponent(uid); diff --git a/Content.Server/Polymorph/Systems/PolymorphedEntitySystem.cs b/Content.Server/Polymorph/Systems/PolymorphedEntitySystem.cs index ced781d2de..9c1295f178 100644 --- a/Content.Server/Polymorph/Systems/PolymorphedEntitySystem.cs +++ b/Content.Server/Polymorph/Systems/PolymorphedEntitySystem.cs @@ -7,6 +7,7 @@ using Content.Shared.Actions; using Content.Shared.Actions.ActionTypes; using Content.Shared.Damage; using Content.Shared.Hands.EntitySystems; +using Content.Shared.IdentityManagement; using Content.Shared.MobState.Components; using Content.Shared.Polymorph; using Robust.Server.Containers; @@ -96,7 +97,11 @@ namespace Content.Server.Polymorph.Systems mind.Mind.TransferTo(component.Parent); } - _popup.PopupEntity(Loc.GetString("polymorph-revert-popup-generic", ("parent", uid), ("child", component.Parent)), component.Parent, Filter.Pvs(component.Parent)); + _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)); QueueDel(uid); } diff --git a/Content.Server/Recycling/RecyclerSystem.cs b/Content.Server/Recycling/RecyclerSystem.cs index bc6801737a..1f42cdefc5 100644 --- a/Content.Server/Recycling/RecyclerSystem.cs +++ b/Content.Server/Recycling/RecyclerSystem.cs @@ -8,6 +8,7 @@ using Content.Server.Recycling.Components; using Content.Shared.Audio; using Content.Shared.Body.Components; using Content.Shared.Emag.Systems; +using Content.Shared.IdentityManagement; using Content.Shared.Interaction.Events; using Content.Shared.Recycling; using Content.Shared.Tag; @@ -51,7 +52,7 @@ namespace Content.Server.Recycling } } - _popup.PopupEntity(Loc.GetString("recycler-component-suicide-message-others", ("victim", victim)), + _popup.PopupEntity(Loc.GetString("recycler-component-suicide-message-others", ("victim", Identity.Entity(victim, EntityManager))), victim, Filter.Pvs(victim, entityManager: EntityManager).RemoveWhereAttachedEntity(e => e == victim)); diff --git a/Content.Server/Toilet/ToiletSystem.cs b/Content.Server/Toilet/ToiletSystem.cs index 76340e1ee7..a702097c14 100644 --- a/Content.Server/Toilet/ToiletSystem.cs +++ b/Content.Server/Toilet/ToiletSystem.cs @@ -8,6 +8,7 @@ using Content.Shared.Audio; using Content.Shared.Body.Components; using Content.Shared.Body.Part; using Content.Shared.Examine; +using Content.Shared.IdentityManagement; using Content.Shared.Interaction; using Content.Shared.Interaction.Events; using Content.Shared.Popups; @@ -48,7 +49,7 @@ namespace Content.Server.Toilet body.HasPartOfType(BodyPartType.Head)) { var othersMessage = Loc.GetString("toilet-component-suicide-head-message-others", - ("victim", args.Victim), ("owner", uid)); + ("victim", Identity.Entity(args.Victim, EntityManager)), ("owner", uid)); _popupSystem.PopupEntity(othersMessage, uid, Filter.PvsExcept(args.Victim), PopupType.MediumCaution); var selfMessage = Loc.GetString("toilet-component-suicide-head-message", @@ -60,7 +61,7 @@ namespace Content.Server.Toilet else { var othersMessage = Loc.GetString("toilet-component-suicide-message-others", - ("victim", args.Victim), ("owner", uid)); + ("victim", Identity.Entity(args.Victim, EntityManager)), ("owner", uid)); _popupSystem.PopupEntity(othersMessage, uid, Filter.PvsExcept(uid), PopupType.MediumCaution); var selfMessage = Loc.GetString("toilet-component-suicide-message", diff --git a/Content.Shared/Popups/SharedPopupExtensions.cs b/Content.Shared/Popups/SharedPopupExtensions.cs index a3581cefeb..8b04179f7f 100644 --- a/Content.Shared/Popups/SharedPopupExtensions.cs +++ b/Content.Shared/Popups/SharedPopupExtensions.cs @@ -31,19 +31,6 @@ namespace Content.Shared.Popups viewer.PopupMessage(viewer, message); } - /// - /// Makes a string of text float up from a location on a grid. - /// - /// Location on a grid that the message floats up from. - /// The client attached entity that the message is being sent to. - /// Text contents of the message. - [Obsolete("Use PopupSystem.PopupCoordinates instead.")] - public static void PopupMessage(this EntityCoordinates coordinates, EntityUid viewer, string message) - { - var popupSystem = EntitySystem.Get(); - popupSystem.PopupCoordinates(message, coordinates, Filter.Entities(viewer)); - } - /// /// Makes a string of text float up from a client's cursor. ///