PopupSystem public methods rejig (#12830)

This commit is contained in:
Leon Friedrich
2022-12-19 10:41:47 +13:00
committed by GitHub
parent e459452333
commit 881a2b2ece
164 changed files with 721 additions and 631 deletions

View File

@@ -9,6 +9,7 @@ using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Timing; using Robust.Shared.Timing;
using Robust.Shared.Utility; using Robust.Shared.Utility;
@@ -35,38 +36,6 @@ namespace Content.Client.Popups
SubscribeNetworkEvent<RoundRestartCleanupEvent>(OnRoundRestart); SubscribeNetworkEvent<RoundRestartCleanupEvent>(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<TransformComponent>(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) private void PopupMessage(string message, PopupType type, EntityCoordinates coordinates, EntityUid? entity = null)
{ {
var label = new WorldPopupLabel(_eyeManager, EntityManager) var label = new WorldPopupLabel(_eyeManager, EntityManager)
@@ -83,32 +52,77 @@ namespace Content.Client.Popups
_aliveWorldLabels.Add(label); _aliveWorldLabels.Add(label);
} }
#endregion
#region Abstract Method Implementations #region Abstract Method Implementations
public override void PopupCoordinates(string message, EntityCoordinates coordinates, PopupType type = PopupType.Small)
public override void PopupCursor(string message, Filter filter, PopupType type=PopupType.Small)
{ {
if (!filter.CheckPrediction) PopupMessage(message, type, coordinates, null);
return;
PopupCursor(message, type);
} }
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) if (_playerManager.LocalPlayer?.Session == recipient)
return; 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); 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; return;
PopupEntity(message, uid, type); var transform = EntityManager.GetComponent<TransformComponent>(uid);
PopupMessage(message, type, transform.Coordinates, uid);
} }
#endregion #endregion

View File

@@ -239,7 +239,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem
return true; return true;
if (Timing.IsFirstTimePredicted && HasComp<MobStateComponent>(ev.Target.Value)) if (Timing.IsFirstTimePredicted && HasComp<MobStateComponent>(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; return false;
} }
@@ -252,7 +252,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem
if (!Timing.IsFirstTimePredicted || uid == null) if (!Timing.IsFirstTimePredicted || uid == null)
return; return;
PopupSystem.PopupEntity(message, uid.Value, Filter.Local()); PopupSystem.PopupEntity(message, uid.Value);
} }
private void OnMeleeLunge(MeleeLungeEvent ev) private void OnMeleeLunge(MeleeLungeEvent ev)

View File

@@ -227,7 +227,7 @@ public sealed partial class GunSystem : SharedGunSystem
protected override void Popup(string message, EntityUid? uid, EntityUid? user) protected override void Popup(string message, EntityUid? uid, EntityUid? user)
{ {
if (uid == null || user == null || !Timing.IsFirstTimePredicted) return; 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) protected override void CreateEffect(EntityUid uid, MuzzleFlashEvent message, EntityUid? user = null)

View File

@@ -56,7 +56,7 @@ namespace Content.Server.AME
{ {
if (!TryComp(args.User, out HandsComponent? hands)) 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; return;
} }
@@ -64,20 +64,20 @@ namespace Content.Server.AME
{ {
if (component.HasJar) 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 else
{ {
component.JarSlot.Insert(args.Used); component.JarSlot.Insert(args.Used);
_popupSystem.PopupEntity(Loc.GetString("ame-controller-component-interact-using-success"), uid, _popupSystem.PopupEntity(Loc.GetString("ame-controller-component-interact-using-success"), uid,
Filter.Entities(args.User), PopupType.Medium); args.User, PopupType.Medium);
component.UpdateUserInterface(); component.UpdateUserInterface();
} }
} }
else 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<HandsComponent>(args.User)) if (!HasComp<HandsComponent>(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; return;
} }
@@ -98,7 +98,7 @@ namespace Content.Server.AME
var snapPos = mapGrid.TileIndicesFor(args.ClickLocation); var snapPos = mapGrid.TileIndicesFor(args.ClickLocation);
if (mapGrid.GetAnchoredEntities(snapPos).Any(sc => HasComp<AMEShieldComponent>(sc))) if (mapGrid.GetAnchoredEntities(snapPos).Any(sc => HasComp<AMEShieldComponent>(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; return;
} }

View File

@@ -41,7 +41,7 @@ namespace Content.Server.Abilities.Mime
continue; continue;
mime.ReadyToRepent = true; 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) if (!component.Enabled)
return; return;
_popupSystem.PopupEntity(Loc.GetString("mime-cant-speak"), uid, Filter.Entities(uid)); _popupSystem.PopupEntity(Loc.GetString("mime-cant-speak"), uid, uid);
args.Cancel(); 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? ((Resolve(entity, ref physics, false) && (physics.CollisionLayer & (int) CollisionGroup.Impassable) != 0) // Is it impassable?
&& !(TryComp<DoorComponent>(entity, out var door) && door.State != DoorState.Closed))) // Is it a door that's open and so not actually impassable? && !(TryComp<DoorComponent>(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; 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 // Make sure we set the invisible wall to despawn properly
Spawn(component.WallPrototype, coords); Spawn(component.WallPrototype, coords);
// Handle args so cooldown works // Handle args so cooldown works
@@ -119,7 +119,7 @@ namespace Content.Server.Abilities.Mime
if (!mimePowers.ReadyToRepent) 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; return;
} }

View File

@@ -39,15 +39,15 @@ namespace Content.Server.Access.Systems
if (addedLength == 0) 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; return;
} }
else if (addedLength == 1) 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; 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) private void AfterUIOpen(EntityUid uid, AgentIDCardComponent component, AfterActivatableUIOpenEvent args)

View File

@@ -44,7 +44,7 @@ namespace Content.Server.Access.Systems
if (transformComponent != null) if (transformComponent != null)
{ {
_popupSystem.PopupCoordinates(Loc.GetString("id-card-component-microwave-burnt", ("id", uid)), _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", EntityManager.SpawnEntity("FoodBadRecipe",
transformComponent.Coordinates); transformComponent.Coordinates);
} }
@@ -54,14 +54,12 @@ namespace Content.Server.Access.Systems
// If they're unlucky, brick their ID // If they're unlucky, brick their ID
if (randomPick <= 0.25f) if (randomPick <= 0.25f)
{ {
_popupSystem.PopupEntity(Loc.GetString("id-card-component-microwave-bricked", ("id", uid)), _popupSystem.PopupEntity(Loc.GetString("id-card-component-microwave-bricked", ("id", uid)), uid);
uid, Filter.Pvs(uid));
access.Tags.Clear(); access.Tags.Clear();
} }
else else
{ {
_popupSystem.PopupEntity(Loc.GetString("id-card-component-microwave-safe", ("id", uid)), _popupSystem.PopupEntity(Loc.GetString("id-card-component-microwave-safe", ("id", uid)), uid, PopupType.Medium);
uid, Filter.Pvs(uid), PopupType.Medium);
} }
// Give them a wonderful new access to compensate for everything // Give them a wonderful new access to compensate for everything

View File

@@ -123,10 +123,10 @@ public sealed partial class AdminVerbSystem
RemComp<PhysicsComponent>(args.Target); // So they can be dragged around. RemComp<PhysicsComponent>(args.Target); // So they can be dragged around.
var xform = Transform(args.Target); var xform = Transform(args.Target);
_popupSystem.PopupEntity(Loc.GetString("admin-smite-chess-self"), args.Target, _popupSystem.PopupEntity(Loc.GetString("admin-smite-chess-self"), args.Target,
Filter.Entities(args.Target), PopupType.LargeCaution); args.Target, PopupType.LargeCaution);
_popupSystem.PopupCoordinates( _popupSystem.PopupCoordinates(
Loc.GetString("admin-smite-chess-others", ("name", args.Target)), xform.Coordinates, 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 board = Spawn("ChessBoard", xform.Coordinates);
var session = _tabletopSystem.EnsureSession(Comp<TabletopGameComponent>(board)); var session = _tabletopSystem.EnsureSession(Comp<TabletopGameComponent>(board));
xform.Coordinates = EntityCoordinates.FromMap(_mapManager, session.Position); xform.Coordinates = EntityCoordinates.FromMap(_mapManager, session.Position);
@@ -151,9 +151,9 @@ public sealed partial class AdminVerbSystem
_flammableSystem.Ignite(args.Target); _flammableSystem.Ignite(args.Target);
var xform = Transform(args.Target); var xform = Transform(args.Target);
_popupSystem.PopupEntity(Loc.GetString("admin-smite-set-alight-self"), 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, _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, Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-set-alight-description") Message = Loc.GetString("admin-smite-set-alight-description")
@@ -285,9 +285,9 @@ public sealed partial class AdminVerbSystem
_bloodstreamSystem.SpillAllSolutions(args.Target, bloodstream); _bloodstreamSystem.SpillAllSolutions(args.Target, bloodstream);
var xform = Transform(args.Target); var xform = Transform(args.Target);
_popupSystem.PopupEntity(Loc.GetString("admin-smite-remove-blood-self"), 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, _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, Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-remove-blood-description") 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, _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, _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, Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-vomit-organs-description") 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); _bodySystem.DropPartAt(part.Id, baseXform.Coordinates, part.Component);
} }
_popupSystem.PopupEntity(Loc.GetString("admin-smite-remove-hands-self"), args.Target, _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, _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, Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-remove-hands-description") Message = Loc.GetString("admin-smite-remove-hands-description")
@@ -363,9 +363,9 @@ public sealed partial class AdminVerbSystem
break; break;
} }
_popupSystem.PopupEntity(Loc.GetString("admin-smite-remove-hands-self"), args.Target, _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, _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, Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-remove-hand-description") 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, _popupSystem.PopupEntity(Loc.GetString("admin-smite-stomach-removal-self"), args.Target,
Filter.Entities(args.Target), PopupType.LargeCaution); args.Target, PopupType.LargeCaution);
}, },
Impact = LogImpact.Extreme, Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-stomach-removal-description"), 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, _popupSystem.PopupEntity(Loc.GetString("admin-smite-lung-removal-self"), args.Target,
Filter.Entities(args.Target), PopupType.LargeCaution); args.Target, PopupType.LargeCaution);
}, },
Impact = LogImpact.Extreme, Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-lung-removal-description"), Message = Loc.GetString("admin-smite-lung-removal-description"),
@@ -616,8 +616,7 @@ public sealed partial class AdminVerbSystem
{ {
EntityManager.QueueDeleteEntity(args.Target); EntityManager.QueueDeleteEntity(args.Target);
Spawn("Ash", Transform(args.Target).Coordinates); Spawn("Ash", Transform(args.Target).Coordinates);
_popupSystem.PopupEntity(Loc.GetString("admin-smite-turned-ash-other", ("name", args.Target)), args.Target, _popupSystem.PopupEntity(Loc.GetString("admin-smite-turned-ash-other", ("name", args.Target)), args.Target, PopupType.LargeCaution);
Filter.Pvs(args.Target), PopupType.LargeCaution);
}, },
Impact = LogImpact.Extreme, Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-dust-description"), Message = Loc.GetString("admin-smite-dust-description"),
@@ -768,7 +767,7 @@ public sealed partial class AdminVerbSystem
Dirty(movementSpeed); Dirty(movementSpeed);
_popupSystem.PopupEntity(Loc.GetString("admin-smite-run-walk-swap-prompt"), args.Target, _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, Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-run-walk-swap-description"), 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); _movementSpeedModifierSystem?.ChangeBaseSpeed(args.Target, 400, 8000, 40, movementSpeed);
_popupSystem.PopupEntity(Loc.GetString("admin-smite-super-speed-prompt"), args.Target, _popupSystem.PopupEntity(Loc.GetString("admin-smite-super-speed-prompt"), args.Target,
Filter.Entities(args.Target), PopupType.LargeCaution); args.Target, PopupType.LargeCaution);
}, },
Impact = LogImpact.Extreme, Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-super-speed-description"), Message = Loc.GetString("admin-smite-super-speed-description"),

View File

@@ -76,7 +76,7 @@ namespace Content.Server.AirlockPainter
if (!grp.StylePaths.TryGetValue(style, out var sprite)) if (!grp.StylePaths.TryGetValue(style, out var sprite))
{ {
string msg = Loc.GetString("airlock-painter-style-not-available"); 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; return;
} }
component.IsSpraying = true; component.IsSpraying = true;

View File

@@ -1,4 +1,4 @@
using Content.Server.Actions; using Content.Server.Actions;
using Content.Server.Animals.Components; using Content.Server.Animals.Components;
using Content.Server.Nutrition.Components; using Content.Server.Nutrition.Components;
using Content.Server.Popups; using Content.Server.Popups;
@@ -73,7 +73,7 @@ public sealed class EggLayerSystem : EntitySystem
{ {
if (hunger.CurrentHunger < component.HungerUsage) 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; return false;
} }
@@ -87,8 +87,8 @@ public sealed class EggLayerSystem : EntitySystem
// Sound + popups // Sound + popups
SoundSystem.Play(component.EggLaySound.GetSound(), Filter.Pvs(uid), uid, component.EggLaySound.Params); 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-user"), uid, uid);
_popup.PopupEntity(Loc.GetString("action-popup-lay-egg-others", ("entity", uid)), uid, Filter.PvsExcept(uid)); _popup.PopupEntity(Loc.GetString("action-popup-lay-egg-others", ("entity", uid)), uid, Filter.PvsExcept(uid), true);
return true; return true;
} }

View File

@@ -68,7 +68,7 @@ namespace Content.Server.Animals.Systems
if (udder.BeingMilked) 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; return;
} }
@@ -101,7 +101,7 @@ namespace Content.Server.Animals.Systems
var quantity = solution.TotalVolume; var quantity = solution.TotalVolume;
if(quantity == 0) 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; return;
} }
@@ -112,7 +112,7 @@ namespace Content.Server.Animals.Systems
_solutionContainerSystem.TryAddSolution(ev.ContainerUid, targetSolution, split); _solutionContainerSystem.TryAddSolution(ev.ContainerUid, targetSolution, split);
_popupSystem.PopupEntity(Loc.GetString("udder-system-success", ("amount", quantity), ("target", Identity.Entity(ev.ContainerUid, EntityManager))), uid, _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) private void OnMilkingFailed(EntityUid uid, UdderComponent component, MilkingFailEvent ev)

View File

@@ -57,7 +57,7 @@ namespace Content.Server.Atmos.EntitySystems
{ {
if (!args.CanReach) 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; return;
} }
ActivateAnalyzer(uid, component, args.User, args.Target); 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) private void OnDropped(EntityUid uid, GasAnalyzerComponent component, DroppedEvent args)
{ {
if(args.User is { } userId && component.Enabled) 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); 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.LastPosition.Value.InRange(EntityManager, userPos, SharedInteractionSystem.InteractionRange))
{ {
if(component.User is { } userId && component.Enabled) 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); DisableAnalyzer(uid, component, component.User);
return false; return false;
} }

View File

@@ -297,7 +297,7 @@ public sealed class AirAlarmSystem : EntitySystem
if (!_accessSystem.IsAllowed(user.Value, reader)) 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; return false;
} }

View File

@@ -40,7 +40,7 @@ namespace Content.Server.Atmos.Piping.EntitySystems
{ {
args.Delay += 2f; args.Delay += 2f;
_popup.PopupEntity(Loc.GetString("comp-atmos-unsafe-unanchor-warning"), pipe.Owner, _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. return; // Show the warning only once.
} }
} }

View File

@@ -113,7 +113,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
} }
else 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; args.Handled = true;

View File

@@ -228,7 +228,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
return; return;
if (TryComp<LockComponent>(uid, out var lockComponent) && lockComponent.Locked) if (TryComp<LockComponent>(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) if (component.AccessDeniedSound != null)
_audioSys.PlayPvs(component.AccessDeniedSound, uid); _audioSys.PlayPvs(component.AccessDeniedSound, uid);
return; return;

View File

@@ -199,7 +199,7 @@ namespace Content.Server.Bed.Sleep
if (user != null) if (user != null)
{ {
SoundSystem.Play("/Audio/Effects/thudswoosh.ogg", Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.05f, _robustRandom)); 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; return false;
} }
@@ -207,7 +207,7 @@ namespace Content.Server.Bed.Sleep
if (user != null) if (user != null)
{ {
SoundSystem.Play("/Audio/Effects/thudswoosh.ogg", Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.05f, _robustRandom)); 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<SleepingComponent>(uid); RemComp<SleepingComponent>(uid);
return true; return true;

View File

@@ -78,8 +78,7 @@ namespace Content.Server.Bible
summonableComp.Summon = null; summonableComp.Summon = null;
} }
summonableComp.AlreadySummoned = false; summonableComp.AlreadySummoned = false;
_popupSystem.PopupEntity(Loc.GetString("bible-summon-respawn-ready", ("book", summonableComp.Owner)), summonableComp.Owner, _popupSystem.PopupEntity(Loc.GetString("bible-summon-respawn-ready", ("book", summonableComp.Owner)), summonableComp.Owner, PopupType.Medium);
Filter.Pvs(summonableComp.Owner), PopupType.Medium);
SoundSystem.Play("/Audio/Effects/radpulse9.ogg", Filter.Pvs(summonableComp.Owner), summonableComp.Owner, AudioParams.Default.WithVolume(-4f)); SoundSystem.Play("/Audio/Effects/radpulse9.ogg", Filter.Pvs(summonableComp.Owner), summonableComp.Owner, AudioParams.Default.WithVolume(-4f));
// Clean up the accumulator and respawn tracking component // Clean up the accumulator and respawn tracking component
summonableComp.Accumulator = 0; summonableComp.Accumulator = 0;
@@ -104,7 +103,7 @@ namespace Content.Server.Bible
if (!HasComp<BibleUserComponent>(args.User)) if (!HasComp<BibleUserComponent>(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); SoundSystem.Play(component.SizzleSoundPath.GetSound(), Filter.Pvs(args.User), args.User);
_damageableSystem.TryChangeDamage(args.User, component.DamageOnUntrainedUse, true, origin: uid); _damageableSystem.TryChangeDamage(args.User, component.DamageOnUntrainedUse, true, origin: uid);
@@ -119,10 +118,10 @@ namespace Content.Server.Bible
if (_random.Prob(component.FailChance)) 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)); 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)); 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); SoundSystem.Play("/Audio/Effects/hit_kick.ogg", Filter.Pvs(args.Target.Value), args.User);
_damageableSystem.TryChangeDamage(args.Target.Value, component.DamageOnFail, true, origin: uid); _damageableSystem.TryChangeDamage(args.Target.Value, component.DamageOnFail, true, origin: uid);
@@ -136,18 +135,18 @@ namespace Content.Server.Bible
if (damage == null || damage.Total == 0) 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)); 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)); 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 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)); 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)); 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); SoundSystem.Play(component.HealSoundPath.GetSound(), Filter.Pvs(args.Target.Value), args.User);
_delay.BeginDelay(uid, delay); _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 this is going to use a ghost role mob spawner, attach it to the bible.
if (HasComp<GhostRoleMobSpawnerComponent>(familiar)) if (HasComp<GhostRoleMobSpawnerComponent>(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); Transform(familiar).AttachParent(component.Owner);
} }
component.AlreadySummoned = true; component.AlreadySummoned = true;

View File

@@ -176,7 +176,7 @@ public sealed class BloodstreamSystem : EntitySystem
// We'll play a special sound and popup for feedback. // We'll play a special sound and popup for feedback.
SoundSystem.Play(component.BloodHealedSound.GetSound(), Filter.Pvs(uid), uid, AudioParams.Default); SoundSystem.Play(component.BloodHealedSound.GetSound(), Filter.Pvs(uid), uid, AudioParams.Default);
_popupSystem.PopupEntity(Loc.GetString("bloodstream-component-wounds-cauterized"), uid, _popupSystem.PopupEntity(Loc.GetString("bloodstream-component-wounds-cauterized"), uid,
Filter.Entities(uid), PopupType.Medium); uid, PopupType.Medium);
; } ; }
} }

View File

@@ -74,7 +74,7 @@ public sealed class InternalsSystem : EntitySystem
// If they're not on then check if we have a mask to use // If they're not on then check if we have a mask to use
if (internals.BreathToolEntity == null) 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; return;
} }
@@ -82,7 +82,7 @@ public sealed class InternalsSystem : EntitySystem
if (tank == null) if (tank == null)
{ {
_popupSystem.PopupEntity(Loc.GetString("internals-no-tank"), uid, Filter.Entities(user)); _popupSystem.PopupEntity(Loc.GetString("internals-no-tank"), uid, user);
return; return;
} }

View File

@@ -77,7 +77,7 @@ namespace Content.Server.Body.Systems
if (_gameTiming.CurTime >= respirator.LastGaspPopupTime + respirator.GaspPopupCooldown) if (_gameTiming.CurTime >= respirator.LastGaspPopupTime + respirator.GaspPopupCooldown)
{ {
respirator.LastGaspPopupTime = _gameTiming.CurTime; 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); TakeSuffocationDamage(uid, respirator);

View File

@@ -88,7 +88,7 @@ namespace Content.Server.Botany.Systems
{ {
// Pick up pollen // Pick up pollen
args.Swab.SeedData = args.Plant.Seed; 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 else
{ {
@@ -97,7 +97,7 @@ namespace Content.Server.Botany.Systems
return; return;
args.Plant.Seed = _mutationSystem.Cross(args.Swab.SeedData, old); // Cross-pollenate args.Plant.Seed = _mutationSystem.Cross(args.Swab.SeedData, old); // Cross-pollenate
args.Swab.SeedData = old; // Transfer old plant pollen to swab 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) if (args.Swab.CancelToken != null)

View File

@@ -119,13 +119,11 @@ public sealed partial class BotanySystem : EntitySystem
{ {
if (proto.ProductPrototypes.Count == 0 || proto.Yield <= 0) if (proto.ProductPrototypes.Count == 0 || proto.Yield <= 0)
{ {
_popupSystem.PopupCursor(Loc.GetString("botany-harvest-fail-message"), _popupSystem.PopupCursor(Loc.GetString("botany-harvest-fail-message"), user, PopupType.Medium);
Filter.Entities(user), PopupType.Medium);
return Enumerable.Empty<EntityUid>(); return Enumerable.Empty<EntityUid>();
} }
_popupSystem.PopupCursor(Loc.GetString("botany-harvest-success-message", ("name", proto.DisplayName)), _popupSystem.PopupCursor(Loc.GetString("botany-harvest-success-message", ("name", proto.DisplayName)), user, PopupType.Medium);
Filter.Entities(user), PopupType.Medium);
return GenerateProduct(proto, Transform(user).Coordinates, yieldMod); return GenerateProduct(proto, Transform(user).Coordinates, yieldMod);
} }

View File

@@ -136,7 +136,7 @@ namespace Content.Server.Botany.Systems
_popupSystem.PopupCursor(Loc.GetString("plant-holder-component-plant-success-message", _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-plant-success-message",
("seedName", seed.Name), ("seedName", seed.Name),
("seedNoun", seed.Noun)), Filter.Entities(args.User), PopupType.Medium); ("seedNoun", seed.Noun)), args.User, PopupType.Medium);
component.Seed = seed; component.Seed = seed;
component.Dead = false; component.Dead = false;
@@ -153,7 +153,7 @@ namespace Content.Server.Botany.Systems
} }
_popupSystem.PopupCursor(Loc.GetString("plant-holder-component-already-seeded-message", _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-already-seeded-message",
("name", Comp<MetaDataComponent>(uid).EntityName)), Filter.Entities(args.User), PopupType.Medium); ("name", Comp<MetaDataComponent>(uid).EntityName)), args.User, PopupType.Medium);
return; return;
} }
@@ -162,15 +162,15 @@ namespace Content.Server.Botany.Systems
if (component.WeedLevel > 0) if (component.WeedLevel > 0)
{ {
_popupSystem.PopupCursor(Loc.GetString("plant-holder-component-remove-weeds-message", _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-remove-weeds-message",
("name", Comp<MetaDataComponent>(uid).EntityName)), Filter.Entities(args.User), PopupType.Medium); ("name", Comp<MetaDataComponent>(uid).EntityName)), args.User, PopupType.Medium);
_popupSystem.PopupEntity(Loc.GetString("plant-holder-component-remove-weeds-others-message", _popupSystem.PopupEntity(Loc.GetString("plant-holder-component-remove-weeds-others-message",
("otherName", Comp<MetaDataComponent>(args.User).EntityName)), uid, Filter.PvsExcept(args.User)); ("otherName", Comp<MetaDataComponent>(args.User).EntityName)), uid, Filter.PvsExcept(args.User), true);
component.WeedLevel = 0; component.WeedLevel = 0;
UpdateSprite(uid, component); UpdateSprite(uid, component);
} }
else 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; return;
@@ -181,15 +181,15 @@ namespace Content.Server.Botany.Systems
if (component.Seed != null) if (component.Seed != null)
{ {
_popupSystem.PopupCursor(Loc.GetString("plant-holder-component-remove-plant-message", _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-remove-plant-message",
("name", Comp<MetaDataComponent>(uid).EntityName)), Filter.Entities(args.User), PopupType.Medium); ("name", Comp<MetaDataComponent>(uid).EntityName)), args.User, PopupType.Medium);
_popupSystem.PopupEntity(Loc.GetString("plant-holder-component-remove-plant-others-message", _popupSystem.PopupEntity(Loc.GetString("plant-holder-component-remove-plant-others-message",
("name", Comp<MetaDataComponent>(args.User).EntityName)), uid, Filter.PvsExcept(args.User)); ("name", Comp<MetaDataComponent>(args.User).EntityName)), uid, Filter.PvsExcept(args.User), true);
RemovePlant(uid, component); RemovePlant(uid, component);
} }
else else
{ {
_popupSystem.PopupCursor(Loc.GetString("plant-holder-component-no-plant-message", _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-no-plant-message",
("name", Comp<MetaDataComponent>(uid).EntityName)), Filter.Entities(args.User)); ("name", Comp<MetaDataComponent>(uid).EntityName)), args.User);
} }
return; return;
@@ -211,13 +211,13 @@ namespace Content.Server.Botany.Systems
if (split.TotalVolume == 0) if (split.TotalVolume == 0)
{ {
_popupSystem.PopupCursor(Loc.GetString("plant-holder-component-no-plant-message", _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-no-plant-message",
("owner", args.Used)), Filter.Entities(args.User)); ("owner", args.Used)), args.User);
return; return;
} }
_popupSystem.PopupCursor(Loc.GetString("plant-holder-component-spray-message", _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-spray-message",
("owner", uid), ("owner", uid),
("amount", split.TotalVolume)), Filter.Entities(args.User), PopupType.Medium); ("amount", split.TotalVolume)), args.User, PopupType.Medium);
_solutionSystem.TryAddSolution(targetEntity, targetSolution, split); _solutionSystem.TryAddSolution(targetEntity, targetSolution, split);
@@ -230,19 +230,19 @@ namespace Content.Server.Botany.Systems
{ {
if (component.Seed == null) 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; return;
} }
if (component.Sampled) 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; return;
} }
if (component.Dead) 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; return;
} }
@@ -250,7 +250,7 @@ namespace Content.Server.Botany.Systems
var seed = _botanySystem.SpawnSeedPacket(component.Seed, Transform(args.User).Coordinates); var seed = _botanySystem.SpawnSeedPacket(component.Seed, Transform(args.User).Coordinates);
seed.RandomOffset(0.25f); seed.RandomOffset(0.25f);
_popupSystem.PopupCursor(Loc.GetString("plant-holder-component-take-sample-message", _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); component.Health -= (_random.Next(3, 5) * 10);
if (_random.Prob(0.3f)) if (_random.Prob(0.3f))
@@ -270,11 +270,11 @@ namespace Content.Server.Botany.Systems
{ {
_popupSystem.PopupCursor(Loc.GetString("plant-holder-component-compost-message", _popupSystem.PopupCursor(Loc.GetString("plant-holder-component-compost-message",
("owner", uid), ("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", _popupSystem.PopupEntity(Loc.GetString("plant-holder-component-compost-others-message",
("user", Identity.Entity(args.User, EntityManager)), ("user", Identity.Entity(args.User, EntityManager)),
("usingItem", args.Used), ("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)) if (_solutionSystem.TryGetSolution(args.Used, produce.SolutionName, out var solution2))
{ {

View File

@@ -33,12 +33,12 @@ public sealed class SeedExtractorSystem : EntitySystem
if (!_botanySystem.TryGetSeed(produce, out var seed) || seed.Seedless) if (!_botanySystem.TryGetSeed(produce, out var seed) || seed.Seedless)
{ {
_popupSystem.PopupCursor(Loc.GetString("seed-extractor-component-no-seeds",("name", args.Used)), _popupSystem.PopupCursor(Loc.GetString("seed-extractor-component-no-seeds",("name", args.Used)),
Filter.Entities(args.User), PopupType.MediumCaution); args.User, PopupType.MediumCaution);
return; return;
} }
_popupSystem.PopupCursor(Loc.GetString("seed-extractor-component-interact-message",("name", args.Used)), _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); QueueDel(args.Used);

View File

@@ -187,7 +187,7 @@ public sealed partial class BuckleSystem
if (!HasComp<SharedHandsComponent>(user)) if (!HasComp<SharedHandsComponent>(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; return false;
} }
@@ -197,7 +197,7 @@ public sealed partial class BuckleSystem
? "buckle-component-already-buckled-message" ? "buckle-component-already-buckled-message"
: "buckle-component-other-already-buckled-message", : "buckle-component-other-already-buckled-message",
("owner", Identity.Entity(buckleId, EntityManager))); ("owner", Identity.Entity(buckleId, EntityManager)));
_popups.PopupEntity(message, user, Filter.Entities(user)); _popups.PopupEntity(message, user, user);
return false; return false;
} }
@@ -210,7 +210,7 @@ public sealed partial class BuckleSystem
var message = Loc.GetString(buckleId == user var message = Loc.GetString(buckleId == user
? "buckle-component-cannot-buckle-message" ? "buckle-component-cannot-buckle-message"
: "buckle-component-other-cannot-buckle-message", ("owner", Identity.Entity(buckleId, EntityManager))); : "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; return false;
} }
@@ -223,7 +223,7 @@ public sealed partial class BuckleSystem
var message = Loc.GetString(buckleId == user var message = Loc.GetString(buckleId == user
? "buckle-component-cannot-fit-message" ? "buckle-component-cannot-fit-message"
: "buckle-component-other-cannot-fit-message", ("owner", Identity.Entity(buckleId, EntityManager))); : "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; return false;
} }
@@ -246,7 +246,7 @@ public sealed partial class BuckleSystem
var message = Loc.GetString(buckleId == user var message = Loc.GetString(buckleId == user
? "buckle-component-cannot-buckle-message" ? "buckle-component-cannot-buckle-message"
: "buckle-component-other-cannot-buckle-message", ("owner", Identity.Entity(buckleId, EntityManager))); : "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; return false;
} }

View File

@@ -229,10 +229,7 @@ namespace Content.Server.Cargo.Systems
_uiSystem.GetUiOrNull(component.Owner, CargoConsoleUiKey.Orders)?.SetState(state); _uiSystem.GetUiOrNull(component.Owner, CargoConsoleUiKey.Orders)?.SetState(state);
} }
private void ConsolePopup(ICommonSession session, string text) private void ConsolePopup(ICommonSession session, string text) => _popup.PopupCursor(text, session);
{
_popup.PopupCursor(text, Filter.SinglePlayer(session));
}
private void PlayDenySound(EntityUid uid, CargoOrderConsoleComponent component) private void PlayDenySound(EntityUid uid, CargoOrderConsoleComponent component)
{ {

View File

@@ -499,19 +499,19 @@ public sealed partial class CargoSystem
if (!TryComp<CargoShuttleComponent>(orderDatabase.Shuttle, out var shuttle)) if (!TryComp<CargoShuttleComponent>(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; return;
} }
if (!_shuttle.CanFTL(shuttle.Owner, out var reason)) 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; return;
} }
if (IsBlocked(shuttle)) 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); SoundSystem.Play(component.DenySound.GetSound(), Filter.Pvs(uid, entityManager: EntityManager), uid);
return; return;
}; };

View File

@@ -39,7 +39,7 @@ public sealed class PriceGunSystem : EntitySystem
{ {
Act = () => 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); _useDelay.BeginDelay(uid, useDelay);
}, },
Text = Loc.GetString("price-gun-verb-text"), Text = Loc.GetString("price-gun-verb-text"),
@@ -58,7 +58,7 @@ public sealed class PriceGunSystem : EntitySystem
var price = _pricingSystem.GetPrice(args.Target.Value); 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); _useDelay.BeginDelay(uid, useDelay);
} }
} }

View File

@@ -1,4 +1,4 @@
using Content.Server.DeviceNetwork; using Content.Server.DeviceNetwork;
using Content.Server.DeviceNetwork.Components; using Content.Server.DeviceNetwork.Components;
using Content.Shared.CartridgeLoader; using Content.Shared.CartridgeLoader;
using Content.Shared.CartridgeLoader.Cartridges; using Content.Shared.CartridgeLoader.Cartridges;
@@ -51,7 +51,7 @@ public sealed class NetProbeCartridgeSystem : EntitySystem
//Why is there no NextFloat(float min, float max)??? //Why is there no NextFloat(float min, float max)???
var audioParams = AudioParams.Default.WithVolume(-2f).WithPitchScale((float)_random.Next(12, 21) / 10); var audioParams = AudioParams.Default.WithVolume(-2f).WithPitchScale((float)_random.Next(12, 21) / 10);
_audioSystem.PlayEntity(component.SoundScan, args.InteractEvent.User, target, audioParams); _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 //Limit the amount of saved probe results to 9

View File

@@ -72,7 +72,7 @@ public sealed partial class ChatSystem
if (channel == null) 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; channel = null;
} }
@@ -83,7 +83,7 @@ public sealed partial class ChatSystem
if (!hasHeadset && !HasComp<IntrinsicRadioTransmitterComponent>(source)) if (!hasHeadset && !HasComp<IntrinsicRadioTransmitterComponent>(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); return (message, channel);

View File

@@ -288,17 +288,18 @@ namespace Content.Server.Chemistry.EntitySystems
return false; return false;
} }
var filter = user.HasValue ? Filter.Entities(user.Value) : Filter.Empty();
if (solution.TotalVolume == 0) 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; return false;
} }
// ReSharper disable once InvertIf // ReSharper disable once InvertIf
if (neededVolume > solution.CurrentVolume) 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; return false;
} }

View File

@@ -105,7 +105,7 @@ public sealed partial class ChemistrySystem
else else
{ {
_popup.PopupEntity(Loc.GetString("injector-component-cannot-transfer-message", _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) else if (component.ToggleState == SharedInjectorComponent.InjectorToggleMode.Draw)
@@ -125,7 +125,7 @@ public sealed partial class ChemistrySystem
else else
{ {
_popup.PopupEntity(Loc.GetString("injector-component-cannot-draw-message", _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(); throw new ArgumentOutOfRangeException();
} }
_popup.PopupEntity(Loc.GetString(msg), component.Owner, Filter.Entities(user)); _popup.PopupEntity(Loc.GetString(msg), component.Owner, user);
} }
/// <summary> /// <summary>
@@ -235,7 +235,7 @@ public sealed partial class ChemistrySystem
private void InjectDoAfter(InjectorComponent component, EntityUid user, EntityUid target) private void InjectDoAfter(InjectorComponent component, EntityUid user, EntityUid target)
{ {
// Create a pop-up for the user // 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)) if (!_solutions.TryGetSolution(component.Owner, InjectorComponent.SolutionName, out var solution))
return; return;
@@ -250,7 +250,7 @@ public sealed partial class ChemistrySystem
// Create a pop-up for the target // Create a pop-up for the target
var userName = Identity.Entity(user, EntityManager); var userName = Identity.Entity(user, EntityManager);
_popup.PopupEntity(Loc.GetString("injector-component-injecting-target", _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. // Check if the target is incapacitated or in combat mode and modify time accordingly.
if (_mobState.IsIncapacitated(target)) if (_mobState.IsIncapacitated(target))
@@ -311,7 +311,7 @@ public sealed partial class ChemistrySystem
if (realTransferAmount <= 0) if (realTransferAmount <= 0)
{ {
_popup.PopupEntity(Loc.GetString("injector-component-cannot-inject-message", ("target", Identity.Entity(targetBloodstream.Owner, EntityManager))), _popup.PopupEntity(Loc.GetString("injector-component-cannot-inject-message", ("target", Identity.Entity(targetBloodstream.Owner, EntityManager))),
component.Owner, Filter.Entities(user)); component.Owner, user);
return; return;
} }
@@ -324,7 +324,7 @@ public sealed partial class ChemistrySystem
_popup.PopupEntity(Loc.GetString("injector-component-inject-success-message", _popup.PopupEntity(Loc.GetString("injector-component-inject-success-message",
("amount", removedSolution.TotalVolume), ("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); Dirty(component);
AfterInject(component); AfterInject(component);
@@ -344,7 +344,7 @@ public sealed partial class ChemistrySystem
if (realTransferAmount <= 0) if (realTransferAmount <= 0)
{ {
_popup.PopupEntity(Loc.GetString("injector-component-target-already-full-message", ("target", Identity.Entity(targetEntity, EntityManager))), _popup.PopupEntity(Loc.GetString("injector-component-target-already-full-message", ("target", Identity.Entity(targetEntity, EntityManager))),
component.Owner, Filter.Entities(user)); component.Owner, user);
return; return;
} }
@@ -364,7 +364,7 @@ public sealed partial class ChemistrySystem
_popup.PopupEntity(Loc.GetString("injector-component-transfer-success-message", _popup.PopupEntity(Loc.GetString("injector-component-transfer-success-message",
("amount", removedSolution.TotalVolume), ("amount", removedSolution.TotalVolume),
("target", Identity.Entity(targetEntity, EntityManager))), component.Owner, Filter.Entities(user)); ("target", Identity.Entity(targetEntity, EntityManager))), component.Owner, user);
Dirty(component); Dirty(component);
AfterInject(component); AfterInject(component);
@@ -404,7 +404,7 @@ public sealed partial class ChemistrySystem
if (realTransferAmount <= 0) if (realTransferAmount <= 0)
{ {
_popup.PopupEntity(Loc.GetString("injector-component-target-is-empty-message", ("target", Identity.Entity(targetEntity, EntityManager))), _popup.PopupEntity(Loc.GetString("injector-component-target-is-empty-message", ("target", Identity.Entity(targetEntity, EntityManager))),
component.Owner, Filter.Entities(user)); component.Owner, user);
return; return;
} }
@@ -425,7 +425,7 @@ public sealed partial class ChemistrySystem
_popup.PopupEntity(Loc.GetString("injector-component-draw-success-message", _popup.PopupEntity(Loc.GetString("injector-component-draw-success-message",
("amount", removedSolution.TotalVolume), ("amount", removedSolution.TotalVolume),
("target", Identity.Entity(targetEntity, EntityManager))), component.Owner, Filter.Entities(user)); ("target", Identity.Entity(targetEntity, EntityManager))), component.Owner, user);
Dirty(component); Dirty(component);
AfterDraw(component); AfterDraw(component);
@@ -450,7 +450,7 @@ public sealed partial class ChemistrySystem
_popup.PopupEntity(Loc.GetString("injector-component-draw-success-message", _popup.PopupEntity(Loc.GetString("injector-component-draw-success-message",
("amount", transferAmount), ("amount", transferAmount),
("target", Identity.Entity(target, EntityManager))), component.Owner, Filter.Entities(user)); ("target", Identity.Entity(target, EntityManager))), component.Owner, user);
Dirty(component); Dirty(component);
AfterDraw(component); AfterDraw(component);

View File

@@ -79,21 +79,21 @@ namespace Content.Server.Chemistry.EntitySystems
if (hypoSpraySolution == null || hypoSpraySolution.CurrentVolume == 0) 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; return true;
} }
if (!_solutions.TryGetInjectableSolution(target.Value, out var targetSolution)) 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; 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) 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<MeleeWeaponSystem>(); var meleeSys = EntitySystem.Get<MeleeWeaponSystem>();
var angle = Angle.FromWorldVec(_entMan.GetComponent<TransformComponent>(target.Value).WorldPosition - _entMan.GetComponent<TransformComponent>(user).WorldPosition); var angle = Angle.FromWorldVec(_entMan.GetComponent<TransformComponent>(target.Value).WorldPosition - _entMan.GetComponent<TransformComponent>(user).WorldPosition);
// TODO: This should just be using melee attacks... // TODO: This should just be using melee attacks...
@@ -107,7 +107,7 @@ namespace Content.Server.Chemistry.EntitySystems
if (realTransferAmount <= 0) 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; return true;
} }

View File

@@ -56,7 +56,7 @@ public sealed class SolutionSpikableSystem : EntitySystem
if (targetSolution.CurrentVolume == 0 && !spikableSource.IgnoreEmpty) 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; return;
} }
@@ -71,7 +71,7 @@ public sealed class SolutionSpikableSystem : EntitySystem
RaiseLocalEvent(target, new SolutionSpikeOverflowEvent(overflow)); 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(); sourceSolution.RemoveAllSolution();

View File

@@ -1,4 +1,4 @@
using Content.Shared.Chemistry.Reagent; using Content.Shared.Chemistry.Reagent;
using Content.Shared.Popups; using Content.Shared.Popups;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Random; using Robust.Shared.Random;
@@ -27,9 +27,9 @@ namespace Content.Server.Chemistry.ReagentEffects
("organ", args.OrganEntity.GetValueOrDefault()), ("organ", args.OrganEntity.GetValueOrDefault()),
}; };
if (Type == PopupRecipients.Local) 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) 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);
} }
} }

View File

@@ -79,7 +79,7 @@ public sealed class ClimbSystem : SharedClimbSystem
: CanVault(component, args.User, args.Dragged, args.Target, out reason); : CanVault(component, args.User, args.Dragged, args.Target, out reason);
if (!canVault) if (!canVault)
_popupSystem.PopupEntity(reason, args.User, Filter.Entities(args.User)); _popupSystem.PopupEntity(reason, args.User, args.User);
args.CanDrop = canVault; args.CanDrop = canVault;
args.Handled = true; 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 // Not shown to the user, since they already get a 'you climb on the glass table' popup
_popupSystem.PopupEntity( _popupSystem.PopupEntity(
Loc.GetString("glass-table-shattered-others", ("table", uid), ("climber", Identity.Entity(args.Climber, EntityManager))), 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)); Filter.PvsExcept(args.Climber), true);
} }
/// <summary> /// <summary>

View File

@@ -59,9 +59,9 @@ namespace Content.Server.Clothing
_identity.QueueIdentityUpdate(args.Performer); _identity.QueueIdentityUpdate(args.Performer);
if (mask.IsToggled) 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 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); ToggleMaskComponents(uid, mask, args.Performer);
} }

View File

@@ -208,7 +208,7 @@ namespace Content.Server.Communications
if (message.Session.AttachedEntity is not {Valid: true} mob) return; if (message.Session.AttachedEntity is not {Valid: true} mob) return;
if (!CanUse(mob, uid)) 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; return;
} }
@@ -233,7 +233,7 @@ namespace Content.Server.Communications
if (!CanUse(mob, uid)) 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; return;
} }
@@ -272,7 +272,7 @@ namespace Content.Server.Communications
if (message.Session.AttachedEntity is not {Valid: true} mob) return; if (message.Session.AttachedEntity is not {Valid: true} mob) return;
if (!CanUse(mob, uid)) 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; return;
} }
_roundEndSystem.RequestRoundEnd(uid); _roundEndSystem.RequestRoundEnd(uid);
@@ -285,7 +285,7 @@ namespace Content.Server.Communications
if (message.Session.AttachedEntity is not {Valid: true} mob) return; if (message.Session.AttachedEntity is not {Valid: true} mob) return;
if (!CanUse(mob, uid)) 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; return;
} }

View File

@@ -56,7 +56,7 @@ namespace Content.Server.Construction
xform.Anchored = false; xform.Anchored = false;
RaiseLocalEvent(uid, new UserUnanchoredEvent(args.User, args.Using)); 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( _adminLogger.Add(
LogType.Unanchor, LogType.Unanchor,
@@ -77,7 +77,7 @@ namespace Content.Server.Construction
if (TryComp<PhysicsComponent>(uid, out var anchorBody) && if (TryComp<PhysicsComponent>(uid, out var anchorBody) &&
!TileFree(xform.Coordinates, 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; return;
} }
@@ -98,7 +98,7 @@ namespace Content.Server.Construction
xform.Anchored = true; xform.Anchored = true;
RaiseLocalEvent(uid, new UserAnchoredEvent(args.User, args.Using)); 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( _adminLogger.Add(
LogType.Anchor, LogType.Anchor,
@@ -190,7 +190,7 @@ namespace Content.Server.Construction
if (TryComp<PhysicsComponent>(uid, out var anchorBody) && if (TryComp<PhysicsComponent>(uid, out var anchorBody) &&
!TileFree(transform.Coordinates, anchorBody)) !TileFree(transform.Coordinates, anchorBody))
{ {
_popup.PopupEntity(Loc.GetString("anchorable-occupied"), uid, Filter.Entities(userUid)); _popup.PopupEntity(Loc.GetString("anchorable-occupied"), uid, userUid);
return; return;
} }

View File

@@ -12,7 +12,7 @@ namespace Content.Server.Construction.Completions
public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager)
{ {
entityManager.EntitySysManager.GetEntitySystem<PopupSystem>() entityManager.EntitySysManager.GetEntitySystem<PopupSystem>()
.PopupEntity(Loc.GetString(Text), uid, Filter.Pvs(uid, entityManager:entityManager)); .PopupEntity(Loc.GetString(Text), uid);
} }
} }
} }

View File

@@ -1,4 +1,4 @@
using Content.Server.Popups; using Content.Server.Popups;
using Content.Shared.Construction; using Content.Shared.Construction;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.Player; using Robust.Shared.Player;
@@ -20,9 +20,9 @@ namespace Content.Server.Construction.Completions
var popupSystem = entityManager.EntitySysManager.GetEntitySystem<PopupSystem>(); var popupSystem = entityManager.EntitySysManager.GetEntitySystem<PopupSystem>();
if(Cursor) if(Cursor)
popupSystem.PopupCursor(Loc.GetString(Text), Filter.Entities(userUid.Value)); popupSystem.PopupCursor(Loc.GetString(Text), userUid.Value);
else else
popupSystem.PopupEntity(Loc.GetString(Text), uid, Filter.Entities(userUid.Value)); popupSystem.PopupEntity(Loc.GetString(Text), uid, userUid.Value);
} }
} }
} }

View File

@@ -52,11 +52,11 @@ namespace Content.Server.Construction
if (component.TargetNode == null) 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? // 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 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);
} }
}; };

View File

@@ -96,7 +96,7 @@ namespace Content.Server.Construction
if (existed) 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; return null;
} }
@@ -221,7 +221,7 @@ namespace Content.Server.Construction
if (failed) 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(); FailCleanup();
return null; return null;
} }
@@ -379,7 +379,7 @@ namespace Content.Server.Construction
if (_container.IsEntityInContainer(user)) 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; return;
} }
@@ -392,7 +392,7 @@ namespace Content.Server.Construction
{ {
if (!set.Add(ev.Ack)) 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; return;
} }
} }

View File

@@ -1,4 +1,4 @@
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using Content.Server.Construction.Components; using Content.Server.Construction.Components;
using Content.Server.DoAfter; using Content.Server.DoAfter;
@@ -109,7 +109,7 @@ public sealed class PartExchangerSystem : EntitySystem
if (TryComp<WiresComponent>(args.Target, out var wires) && !wires.IsPanelOpen) if (TryComp<WiresComponent>(args.Target, out var wires) && !wires.IsPanelOpen)
{ {
_popup.PopupEntity(Loc.GetString("construction-step-condition-wire-panel-open"), _popup.PopupEntity(Loc.GetString("construction-step-condition-wire-panel-open"),
args.Target.Value, Filter.Pvs(args.Target.Value, entityManager: EntityManager)); args.Target.Value);
return; return;
} }

View File

@@ -51,7 +51,7 @@ public sealed class CrayonSystem : SharedCrayonSystem
if (component.DeleteEmpty) if (component.DeleteEmpty)
UseUpCrayon(uid, args.User); UseUpCrayon(uid, args.User);
else 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; args.Handled = true;
return; return;
@@ -59,7 +59,7 @@ public sealed class CrayonSystem : SharedCrayonSystem
if (!args.ClickLocation.IsValid(EntityManager)) 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; args.Handled = true;
return; return;
} }
@@ -139,7 +139,7 @@ public sealed class CrayonSystem : SharedCrayonSystem
private void UseUpCrayon(EntityUid uid, EntityUid user) 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); EntityManager.QueueDeleteEntity(uid);
} }
} }

View File

@@ -70,10 +70,10 @@ namespace Content.Server.Cuffs
{ {
if (args.Target is not {Valid: true} target) if (args.Target is not {Valid: true} target)
return; return;
if (!args.CanReach) 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; return;
} }
@@ -88,31 +88,31 @@ namespace Content.Server.Cuffs
if (component.Broken) 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; return;
} }
if (!EntityManager.TryGetComponent<HandsComponent?>(target, out var hands)) if (!EntityManager.TryGetComponent<HandsComponent?>(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; return;
} }
if (cuffed.CuffedHandCount >= hands.Count) 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; return;
} }
// TODO these messages really need third-party variants. I.e., "{$user} starts cuffing {$target}!" // TODO these messages really need third-party variants. I.e., "{$user} starts cuffing {$target}!"
if (target == user) 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 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-target-message",("targetName", target)), user, 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-by-other-message",("otherName", user)), target, target);
} }
_audio.PlayPvs(component.StartCuffSound, handcuff); _audio.PlayPvs(component.StartCuffSound, handcuff);
@@ -121,7 +121,7 @@ namespace Content.Server.Cuffs
} }
private void OnCuffMeleeHit(EntityUid uid, HandcuffComponent component, MeleeHitEvent args) private void OnCuffMeleeHit(EntityUid uid, HandcuffComponent component, MeleeHitEvent args)
{ {
if (!args.HitEntities.Any()) if (!args.HitEntities.Any())
return; return;
@@ -166,7 +166,7 @@ namespace Content.Server.Cuffs
} }
if (args.Cancelled) 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);
} }
} }

View File

@@ -1,4 +1,4 @@
using Content.Server.Damage.Components; using Content.Server.Damage.Components;
using Content.Server.Popups; using Content.Server.Popups;
using Content.Shared.Damage; using Content.Shared.Damage;
using Robust.Shared.Player; using Robust.Shared.Player;
@@ -30,7 +30,7 @@ public sealed class DamagePopupSystem : EntitySystem
DamagePopupType.Hit => "!", DamagePopupType.Hit => "!",
_ => "Invalid type", _ => "Invalid type",
}; };
_popupSystem.PopupEntity(msg, uid, Filter.Pvs(uid, 2F, EntityManager)); _popupSystem.PopupEntity(msg, uid);
} }
} }
} }

View File

@@ -1,4 +1,4 @@
using System.Linq; using System.Linq;
using Content.Server.DeviceNetwork.Components; using Content.Server.DeviceNetwork.Components;
using Content.Server.UserInterface; using Content.Server.UserInterface;
using Content.Shared.Access.Components; using Content.Shared.Access.Components;
@@ -102,7 +102,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
if (MetaData(targetUid.Value).EntityLifeStage == EntityLifeStage.MapInitialized) if (MetaData(targetUid.Value).EntityLifeStage == EntityLifeStage.MapInitialized)
{ {
_popupSystem.PopupCursor(Loc.GetString("network-configurator-device-failed", ("device", targetUid)), _popupSystem.PopupCursor(Loc.GetString("network-configurator-device-failed", ("device", targetUid)),
Filter.Entities(userUid)); userUid);
return; return;
} }
@@ -111,13 +111,13 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
if (configurator.Devices.ContainsValue(targetUid.Value)) 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; return;
} }
configurator.Devices.Add(address, targetUid.Value); configurator.Devices.Add(address, targetUid.Value);
_popupSystem.PopupCursor(Loc.GetString("network-configurator-device-saved", ("address", device.Address), ("device", targetUid)), _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); UpdateUiState(configurator.Owner, configurator);
} }
@@ -131,7 +131,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
return true; return true;
SoundSystem.Play(component.SoundNoAccess.GetSound(), Filter.Pvs(user.Value), target, AudioParams.Default.WithVolume(-2f).WithPitchScale(1.2f)); 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; return false;
} }
@@ -321,7 +321,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
_ => "error" _ => "error"
}; };
_popupSystem.PopupCursor(Loc.GetString(resultText), Filter.SinglePlayer(args.Session), PopupType.Medium); _popupSystem.PopupCursor(Loc.GetString(resultText), args.Session, PopupType.Medium);
_uiSystem.TrySetUiState( _uiSystem.TrySetUiState(
component.Owner, component.Owner,
NetworkConfiguratorUiKey.Configure, NetworkConfiguratorUiKey.Configure,

View File

@@ -113,7 +113,7 @@ namespace Content.Server.Disease
if (swab.Used) 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; return;
} }
@@ -121,7 +121,7 @@ namespace Content.Server.Disease
EntityManager.TryGetComponent<IngestionBlockerComponent>(maskUid, out var blocker) && EntityManager.TryGetComponent<IngestionBlockerComponent>(maskUid, out var blocker) &&
blocker.Enabled) 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; return;
} }
@@ -156,10 +156,10 @@ namespace Content.Server.Disease
if (!TryComp<DiseaseSwabComponent>(args.Used, out var swab)) if (!TryComp<DiseaseSwabComponent>(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; 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; machine.Disease = swab.Disease;
@@ -188,10 +188,10 @@ namespace Content.Server.Disease
if (!TryComp<DiseaseSwabComponent>(args.Used, out var swab) || swab.Disease == null || !swab.Disease.Infectious) if (!TryComp<DiseaseSwabComponent>(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; 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<DiseaseMachineComponent>(uid); var machine = Comp<DiseaseMachineComponent>(uid);
machine.Disease = swab.Disease; machine.Disease = swab.Disease;
EntityManager.DeleteEntity(args.Used); EntityManager.DeleteEntity(args.Used);
@@ -321,7 +321,7 @@ namespace Content.Server.Disease
return; return;
args.Swab.Used = true; 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) if (args.Swab.Disease != null || args.Carrier.Diseases.Count == 0)
return; return;

View File

@@ -242,7 +242,7 @@ namespace Content.Server.Disease
{ {
var CureTuple = (carrier, disease); var CureTuple = (carrier, disease);
CureQueue.Enqueue(CureTuple); 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) public void CureAllDiseases(EntityUid uid, DiseaseCarrierComponent? carrier = null)
@@ -298,7 +298,7 @@ namespace Content.Server.Disease
if (vaxx.Used) 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; return;
} }
@@ -450,7 +450,7 @@ namespace Content.Server.Disease
if (attemptSneezeCoughEvent.Cancelled) return false; if (attemptSneezeCoughEvent.Cancelled) return false;
if (!string.IsNullOrEmpty(snoughMessage)) 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) if (snoughSound != null)
_audioSystem.PlayPvs(snoughSound, uid); _audioSystem.PlayPvs(snoughSound, uid);

View File

@@ -33,7 +33,7 @@ namespace Content.Server.Disease.Effects
SoundSystem.Play(PolymorphSound.GetSound(), Filter.Pvs(polyUid.Value), polyUid.Value, AudioHelpers.WithVariation(0.2f)); SoundSystem.Play(PolymorphSound.GetSound(), Filter.Pvs(polyUid.Value), polyUid.Value, AudioHelpers.WithVariation(0.2f));
if (PolymorphMessage != null && polyUid != null) if (PolymorphMessage != null && polyUid != null)
EntitySystem.Get<SharedPopupSystem>().PopupEntity(Loc.GetString(PolymorphMessage), polyUid.Value, Filter.Entities(polyUid.Value), Shared.Popups.PopupType.Large); EntitySystem.Get<SharedPopupSystem>().PopupEntity(Loc.GetString(PolymorphMessage), polyUid.Value, polyUid.Value, Shared.Popups.PopupType.Large);
} }
} }
} }

View File

@@ -28,9 +28,9 @@ namespace Content.Server.Disease.Effects
var popupSys = args.EntityManager.EntitySysManager.GetEntitySystem<SharedPopupSystem>(); var popupSys = args.EntityManager.EntitySysManager.GetEntitySystem<SharedPopupSystem>();
if (Type == PopupRecipients.Local) 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) 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);
} }
} }

View File

@@ -287,7 +287,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
_robustRandom.NextDouble() > 0.75 || _robustRandom.NextDouble() > 0.75 ||
!component.Container.Insert(args.Thrown)) !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; return;
} }
@@ -461,7 +461,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
if (userId.HasValue && !HasComp<SharedHandsComponent>(userId) && toInsertId != userId) // Mobs like mouse can Jump inside even with no hands if (userId.HasValue && !HasComp<SharedHandsComponent>(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; return false;
} }

View File

@@ -144,12 +144,12 @@ namespace Content.Server.Doors.Systems
if (state.Fire) if (state.Fire)
{ {
_popupSystem.PopupEntity(Loc.GetString("firelock-component-is-holding-fire-message"), _popupSystem.PopupEntity(Loc.GetString("firelock-component-is-holding-fire-message"),
uid, Filter.Pvs(uid, entityManager: EntityManager)); uid);
} }
else if (state.Pressure) else if (state.Pressure)
{ {
_popupSystem.PopupEntity(Loc.GetString("firelock-component-is-holding-pressure-message"), _popupSystem.PopupEntity(Loc.GetString("firelock-component-is-holding-pressure-message"),
uid, Filter.Pvs(uid, entityManager: EntityManager)); uid);
} }
if (state.Fire || state.Pressure) if (state.Fire || state.Pressure)

View File

@@ -188,7 +188,7 @@ namespace Content.Server.Dragon
// We can't predict the rift being destroyed anyway so no point adding weakened to shared. // We can't predict the rift being destroyed anyway so no point adding weakened to shared.
dragon.WeakenedAccumulator = dragon.WeakenedDuration; dragon.WeakenedAccumulator = dragon.WeakenedDuration;
_movement.RefreshMovementSpeedModifiers(component.Dragon); _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) if (component.Weakened)
{ {
_popupSystem.PopupEntity(Loc.GetString("carp-rift-weakened"), uid, Filter.Entities(uid)); _popupSystem.PopupEntity(Loc.GetString("carp-rift-weakened"), uid, uid);
return; return;
} }
if (component.Rifts.Count >= RiftsAllowed) 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; return;
} }
if (component.Rifts.Count > 0 && TryComp<DragonRiftComponent>(component.Rifts[^1], out var rift) && rift.State != DragonRiftState.Finished) if (component.Rifts.Count > 0 && TryComp<DragonRiftComponent>(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; return;
} }
@@ -233,7 +233,7 @@ namespace Content.Server.Dragon
// Have to be on a grid fam // Have to be on a grid fam
if (!_mapManager.TryGetGrid(xform.GridUid, out var grid)) 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; return;
} }
@@ -241,7 +241,7 @@ namespace Content.Server.Dragon
{ {
if (riftXform.Coordinates.InRange(EntityManager, xform.Coordinates, RiftRange)) 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; return;
} }
} }
@@ -251,7 +251,7 @@ namespace Content.Server.Dragon
if (!tile.IsSpace(_tileDef)) if (!tile.IsSpace(_tileDef))
continue; 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; return;
} }
@@ -379,14 +379,14 @@ namespace Content.Server.Dragon
}); });
break; break;
default: 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; break;
} }
return; 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) if (component.SoundStructureDevour != null)
_audioSystem.PlayPvs(component.SoundStructureDevour, uid, component.SoundStructureDevour.Params); _audioSystem.PlayPvs(component.SoundStructureDevour, uid, component.SoundStructureDevour.Params);

View File

@@ -94,8 +94,7 @@ namespace Content.Server.Drone
private void OnMindAdded(EntityUid uid, DroneComponent drone, MindAddedMessage args) private void OnMindAdded(EntityUid uid, DroneComponent drone, MindAddedMessage args)
{ {
UpdateDroneAppearance(uid, DroneStatus.On); UpdateDroneAppearance(uid, DroneStatus.On);
_popupSystem.PopupEntity(Loc.GetString("drone-activated"), uid, _popupSystem.PopupEntity(Loc.GetString("drone-activated"), uid, PopupType.Large);
Filter.Pvs(uid), PopupType.Large);
} }
private void OnMindRemoved(EntityUid uid, DroneComponent drone, MindRemovedMessage args) private void OnMindRemoved(EntityUid uid, DroneComponent drone, MindRemovedMessage args)
@@ -135,7 +134,7 @@ namespace Content.Server.Drone
if ((TryComp<MobStateComponent>(entity, out var entityMobState) && HasComp<GhostTakeoverAvailableComponent>(entity) && entityMobState.IsDead())) if ((TryComp<MobStateComponent>(entity, out var entityMobState) && HasComp<GhostTakeoverAvailableComponent>(entity) && entityMobState.IsDead()))
continue; continue;
if (_gameTiming.IsFirstTimePredicted) 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; return true;
} }
} }

View File

@@ -383,23 +383,21 @@ namespace Content.Server.Electrocution
_jitteringSystem.DoJitter(uid, time * JitterTimeMultiplier, refresh, JitterAmplitude, JitterFrequency, true, _jitteringSystem.DoJitter(uid, time * JitterTimeMultiplier, refresh, JitterAmplitude, JitterFrequency, true,
statusEffects); statusEffects);
_popupSystem.PopupEntity(Loc.GetString("electrocuted-component-mob-shocked-popup-player"), uid, _popupSystem.PopupEntity(Loc.GetString("electrocuted-component-mob-shocked-popup-player"), uid, uid);
Filter.Entities(uid).Unpredicted());
var filter = Filter.Pvs(uid, 2f, EntityManager).RemoveWhereAttachedEntity(puid => puid == uid) var filter = Filter.PvsExcept(uid, entityManager: EntityManager);
.Unpredicted();
// TODO: Allow being able to pass EntityUid to Loc... // TODO: Allow being able to pass EntityUid to Loc...
if (sourceUid != null) if (sourceUid != null)
{ {
_popupSystem.PopupEntity(Loc.GetString("electrocuted-component-mob-shocked-by-source-popup-others", _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); PlayElectrocutionSound(uid, sourceUid.Value);
} }
else else
{ {
_popupSystem.PopupEntity(Loc.GetString("electrocuted-component-mob-shocked-popup-others", _popupSystem.PopupEntity(Loc.GetString("electrocuted-component-mob-shocked-popup-others",
("mob", uid)), uid, filter); ("mob", uid)), uid, filter, true);
} }
return true; return true;

View File

@@ -58,7 +58,7 @@ namespace Content.Server.Emag
if (component.Charges <= 0) 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; return;
} }
@@ -66,7 +66,7 @@ namespace Content.Server.Emag
if (handled) if (handled)
{ {
_popupSystem.PopupEntity(Loc.GetString("emag-success", ("target", Identity.Entity(args.Target.Value, EntityManager))), args.User, _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}"); _adminLogger.Add(LogType.Emag, LogImpact.High, $"{ToPrettyString(args.User):player} emagged {ToPrettyString(args.Target.Value):target}");
component.Charges--; component.Charges--;
return; return;

View File

@@ -110,11 +110,11 @@ public sealed partial class EnsnareableSystem
_doAfter.DoAfter(doAfterEventArgs); _doAfter.DoAfter(doAfterEventArgs);
if (isOwner) 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) 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);
} }
} }

View File

@@ -41,7 +41,7 @@ public sealed partial class EnsnareableSystem : SharedEnsnareableSystem
ensnaring.Ensnared = null; ensnaring.Ensnared = null;
_popup.PopupEntity(Loc.GetString("ensnare-component-try-free-complete", ("ensnare", args.EnsnaringEntity)), _popup.PopupEntity(Loc.GetString("ensnare-component-try-free-complete", ("ensnare", args.EnsnaringEntity)),
uid, Filter.Entities(uid), PopupType.Large); uid, uid, PopupType.Large);
UpdateAlert(component); UpdateAlert(component);
var ev = new EnsnareRemoveEvent(); var ev = new EnsnareRemoveEvent();
@@ -58,6 +58,6 @@ public sealed partial class EnsnareableSystem : SharedEnsnareableSystem
ensnaring.CancelToken = null; ensnaring.CancelToken = null;
_popup.PopupEntity(Loc.GetString("ensnare-component-try-free-fail", ("ensnare", args.EnsnaringEntity)), _popup.PopupEntity(Loc.GetString("ensnare-component-try-free-fail", ("ensnare", args.EnsnaringEntity)),
uid, Filter.Entities(uid), PopupType.Large); uid, uid, PopupType.Large);
} }
} }

View File

@@ -43,7 +43,7 @@ public sealed partial class TriggerSystem
if (component.PreventSuicide) 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); args.BlockSuicideAttempt(component.PreventSuicide);
} }
} }

View File

@@ -83,7 +83,7 @@ public sealed partial class TriggerSystem
Act = () => Act = () =>
{ {
component.Delay = option; 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) if (component.DelayOptions[^1] <= component.Delay)
{ {
component.Delay = component.DelayOptions[0]; 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; return;
} }
@@ -119,7 +119,7 @@ public sealed partial class TriggerSystem
if (option > component.Delay) if (option > component.Delay)
{ {
component.Delay = option; 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; return;
} }
} }
@@ -130,12 +130,12 @@ public sealed partial class TriggerSystem
if (comp.StartOnStick) if (comp.StartOnStick)
{ {
comp.StartOnStick = false; 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 else
{ {
comp.StartOnStick = true; 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);
} }
} }

View File

@@ -86,7 +86,7 @@ namespace Content.Server.Explosion.EntitySystems
_adminLogger.Add(LogType.Trigger, LogImpact.Low, _adminLogger.Add(LogType.Trigger, LogImpact.Low,
$"A voice-trigger on {ToPrettyString(component.Owner):entity} has started recording. User: {ToPrettyString(user):user}"); $"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) public void StopRecording(TriggerOnVoiceComponent component)
@@ -95,7 +95,7 @@ namespace Content.Server.Explosion.EntitySystems
if (string.IsNullOrWhiteSpace(component.KeyPhrase)) if (string.IsNullOrWhiteSpace(component.KeyPhrase))
RemComp<ActiveListenerComponent>(component.Owner); RemComp<ActiveListenerComponent>(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) public void FinishRecording(TriggerOnVoiceComponent component, EntityUid source, string message)
@@ -106,7 +106,7 @@ namespace Content.Server.Explosion.EntitySystems
_adminLogger.Add(LogType.Trigger, LogImpact.Low, _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}"); $"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) private void OnVoiceExamine(EntityUid uid, TriggerOnVoiceComponent component, ExaminedEvent args)

View File

@@ -62,7 +62,7 @@ public sealed class FireExtinguisherSystem : EntitySystem
if (component.HasSafety && component.Safety) if (component.HasSafety && component.Safety)
{ {
_popupSystem.PopupEntity(Loc.GetString("fire-extinguisher-component-safety-on-message"), uid, _popupSystem.PopupEntity(Loc.GetString("fire-extinguisher-component-safety-on-message"), uid,
Filter.Entities(args.User)); args.User);
return; return;
} }
@@ -87,7 +87,7 @@ public sealed class FireExtinguisherSystem : EntitySystem
SoundSystem.Play(component.RefillSound.GetSound(), Filter.Pvs(uid), uid); SoundSystem.Play(component.RefillSound.GetSound(), Filter.Pvs(uid), uid);
_popupSystem.PopupEntity(Loc.GetString("fire-extinguisher-component-after-interact-refilled-message", ("owner", 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) if (component.HasSafety && component.Safety)
{ {
_popupSystem.PopupEntity(Loc.GetString("fire-extinguisher-component-safety-on-message"), uid, _popupSystem.PopupEntity(Loc.GetString("fire-extinguisher-component-safety-on-message"), uid,
Filter.Entities(args.User)); args.User);
args.Cancel(); args.Cancel();
} }
} }

View File

@@ -26,7 +26,7 @@ namespace Content.Server.Eye.Blinding
if (TryComp<BlindableComponent>(args.User, out var blindable) && blindable.Sources > 0) if (TryComp<BlindableComponent>(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(); args.Cancel();
} }
} }

View File

@@ -42,21 +42,21 @@ public sealed class FaxSystem : EntitySystem
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
// Hooks // Hooks
SubscribeLocalEvent<FaxMachineComponent, ComponentInit>(OnComponentInit); SubscribeLocalEvent<FaxMachineComponent, ComponentInit>(OnComponentInit);
SubscribeLocalEvent<FaxMachineComponent, MapInitEvent>(OnMapInit); SubscribeLocalEvent<FaxMachineComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<FaxMachineComponent, ComponentRemove>(OnComponentRemove); SubscribeLocalEvent<FaxMachineComponent, ComponentRemove>(OnComponentRemove);
SubscribeLocalEvent<FaxMachineComponent, EntInsertedIntoContainerMessage>(OnItemSlotChanged); SubscribeLocalEvent<FaxMachineComponent, EntInsertedIntoContainerMessage>(OnItemSlotChanged);
SubscribeLocalEvent<FaxMachineComponent, EntRemovedFromContainerMessage>(OnItemSlotChanged); SubscribeLocalEvent<FaxMachineComponent, EntRemovedFromContainerMessage>(OnItemSlotChanged);
SubscribeLocalEvent<FaxMachineComponent, PowerChangedEvent>(OnPowerChanged); SubscribeLocalEvent<FaxMachineComponent, PowerChangedEvent>(OnPowerChanged);
SubscribeLocalEvent<FaxMachineComponent, DeviceNetworkPacketEvent>(OnPacketReceived); SubscribeLocalEvent<FaxMachineComponent, DeviceNetworkPacketEvent>(OnPacketReceived);
// Interaction // Interaction
SubscribeLocalEvent<FaxMachineComponent, InteractUsingEvent>(OnInteractUsing); SubscribeLocalEvent<FaxMachineComponent, InteractUsingEvent>(OnInteractUsing);
SubscribeLocalEvent<FaxMachineComponent, GotEmaggedEvent>(OnEmagged); SubscribeLocalEvent<FaxMachineComponent, GotEmaggedEvent>(OnEmagged);
// UI // UI
SubscribeLocalEvent<FaxMachineComponent, AfterActivatableUIOpenEvent>(OnToggleInterface); SubscribeLocalEvent<FaxMachineComponent, AfterActivatableUIOpenEvent>(OnToggleInterface);
SubscribeLocalEvent<FaxMachineComponent, FaxSendMessage>(OnSendButtonPressed); SubscribeLocalEvent<FaxMachineComponent, FaxSendMessage>(OnSendButtonPressed);
@@ -92,7 +92,7 @@ public sealed class FaxSystem : EntitySystem
SpawnPaperFromQueue(comp.Owner, comp); SpawnPaperFromQueue(comp.Owner, comp);
UpdateUserInterface(comp.Owner, comp); UpdateUserInterface(comp.Owner, comp);
} }
return; return;
} }
@@ -182,13 +182,13 @@ public sealed class FaxSystem : EntitySystem
{ {
component.PrintingTimeRemaining = 0f; // Reset animation component.PrintingTimeRemaining = 0f; // Reset animation
} }
if (isInsertInterrupted || isPrintInterrupted) if (isInsertInterrupted || isPrintInterrupted)
UpdateAppearance(component.Owner, component); UpdateAppearance(component.Owner, component);
_itemSlotsSystem.SetLock(uid, component.PaperSlot, !args.Powered); // Lock slot when power is off _itemSlotsSystem.SetLock(uid, component.PaperSlot, !args.Powered); // Lock slot when power is off
} }
private void OnInteractUsing(EntityUid uid, FaxMachineComponent component, InteractUsingEvent args) private void OnInteractUsing(EntityUid uid, FaxMachineComponent component, InteractUsingEvent args)
{ {
if (args.Handled || if (args.Handled ||
@@ -206,26 +206,26 @@ public sealed class FaxSystem : EntitySystem
if (newName.Length > 20) 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; return;
} }
if (component.KnownFaxes.ContainsValue(newName) && !component.Emagged) // Allow exist names if emagged for fun 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; return;
} }
_adminLogger.Add(LogType.Action, LogImpact.Low, _adminLogger.Add(LogType.Action, LogImpact.Low,
$"{ToPrettyString(args.User):user} renamed {ToPrettyString(uid)} from \"{component.FaxName}\" to \"{newName}\""); $"{ToPrettyString(args.User):user} renamed {ToPrettyString(uid)} from \"{component.FaxName}\" to \"{newName}\"");
component.FaxName = 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); UpdateUserInterface(uid, component);
}); });
args.Handled = true; args.Handled = true;
} }
private void OnEmagged(EntityUid uid, FaxMachineComponent component, GotEmaggedEvent args) private void OnEmagged(EntityUid uid, FaxMachineComponent component, GotEmaggedEvent args)
{ {
if (component.Emagged) if (component.Emagged)
@@ -280,22 +280,22 @@ public sealed class FaxSystem : EntitySystem
} }
} }
} }
private void OnToggleInterface(EntityUid uid, FaxMachineComponent component, AfterActivatableUIOpenEvent args) private void OnToggleInterface(EntityUid uid, FaxMachineComponent component, AfterActivatableUIOpenEvent args)
{ {
UpdateUserInterface(uid, component); UpdateUserInterface(uid, component);
} }
private void OnSendButtonPressed(EntityUid uid, FaxMachineComponent component, FaxSendMessage args) private void OnSendButtonPressed(EntityUid uid, FaxMachineComponent component, FaxSendMessage args)
{ {
Send(uid, component, args.Session.AttachedEntity); Send(uid, component, args.Session.AttachedEntity);
} }
private void OnRefreshButtonPressed(EntityUid uid, FaxMachineComponent component, FaxRefreshMessage args) private void OnRefreshButtonPressed(EntityUid uid, FaxMachineComponent component, FaxRefreshMessage args)
{ {
Refresh(uid, component); Refresh(uid, component);
} }
private void OnDestinationSelected(EntityUid uid, FaxMachineComponent component, FaxDestinationMessage args) private void OnDestinationSelected(EntityUid uid, FaxMachineComponent component, FaxDestinationMessage args)
{ {
SetDestination(uid, args.Address, component); SetDestination(uid, args.Address, component);
@@ -352,7 +352,7 @@ public sealed class FaxSystem : EntitySystem
component.DestinationFaxAddress = null; component.DestinationFaxAddress = null;
component.KnownFaxes.Clear(); component.KnownFaxes.Clear();
var payload = new NetworkPayload() var payload = new NetworkPayload()
{ {
{ DeviceNetworkConstants.Command, FaxConstants.FaxPingCommand } { DeviceNetworkConstants.Command, FaxConstants.FaxPingCommand }
@@ -379,7 +379,7 @@ public sealed class FaxSystem : EntitySystem
if (component.DestinationFaxAddress == null) if (component.DestinationFaxAddress == null)
return; return;
if (!component.KnownFaxes.TryGetValue(component.DestinationFaxAddress, out var faxName)) if (!component.KnownFaxes.TryGetValue(component.DestinationFaxAddress, out var faxName))
return; 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}"); _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; component.SendTimeoutRemaining += component.SendTimeout;
_audioSystem.PlayPvs(component.SendSound, uid); _audioSystem.PlayPvs(component.SendSound, uid);
UpdateUserInterface(uid, component); 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 if (fromAddress != null && component.KnownFaxes.ContainsKey(fromAddress)) // If message received from unknown for fax address
faxName = component.KnownFaxes[fromAddress]; 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); _appearanceSystem.SetData(uid, FaxMachineVisuals.VisualState, FaxMachineVisualState.Printing);
if (component.NotifyAdmins) if (component.NotifyAdmins)

View File

@@ -53,7 +53,7 @@ public sealed class SpraySystem : EntitySystem
if (solution.CurrentVolume <= 0) if (solution.CurrentVolume <= 0)
{ {
_popupSystem.PopupEntity(Loc.GetString("spray-component-is-empty-message"), uid, _popupSystem.PopupEntity(Loc.GetString("spray-component-is-empty-message"), uid,
Filter.Entities(args.User)); args.User);
return; return;
} }

View File

@@ -54,13 +54,13 @@ namespace Content.Server.Forensics
if (component.Used) 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; return;
} }
if (_inventory.TryGetSlotEntity(args.Target.Value, "gloves", out var gloves)) 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; return;
} }
@@ -68,8 +68,8 @@ namespace Content.Server.Forensics
{ {
if (args.User != args.Target) 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-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, Filter.Entities(args.Target.Value)); _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); StartScan(args.User, args.Target.Value, component, fingerprint.Fingerprint);
return; return;

View File

@@ -145,7 +145,7 @@ namespace Content.Server.Forensics
if (fiber == pad.Sample) if (fiber == pad.Sample)
{ {
_audioSystem.PlayPvs(component.SoundMatch, uid); _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; return;
} }
} }
@@ -155,13 +155,13 @@ namespace Content.Server.Forensics
if (fingerprint == pad.Sample) if (fingerprint == pad.Sample)
{ {
_audioSystem.PlayPvs(component.SoundMatch, uid); _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; return;
} }
} }
_audioSystem.PlayPvs(component.SoundNoMatch, uid); _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) 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 // This shouldn't occur due to the UI guarding against it, but
// if it does, tell the user why nothing happened. // 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; return;
} }

View File

@@ -152,7 +152,7 @@ public sealed class ZombieRuleSystem : GameRuleSystem
var percent = GetInfectedPercentage(out var num); var percent = GetInfectedPercentage(out var num);
if (num.Count == 1) //only one human left. spooky 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 if (percent >= 1) //oops, all zombies
_roundEndSystem.EndRound(); _roundEndSystem.EndRound();
} }

View File

@@ -81,7 +81,7 @@ namespace Content.Server.Guardian
if (!HasComp<GuardianHostComponent>(host)) return; if (!HasComp<GuardianHostComponent>(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) private void OnHostInit(EntityUid uid, GuardianHostComponent component, ComponentInit args)
@@ -102,7 +102,8 @@ namespace Content.Server.Guardian
if (args.Cancelled || args.Target != component.Host) if (args.Cancelled || args.Target != component.Host)
return; 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(); args.Cancel();
} }
@@ -147,22 +148,21 @@ namespace Content.Server.Guardian
{ {
if (component.Used) 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; return;
} }
// Can only inject things with the component... // Can only inject things with the component...
if (!HasComp<CanHostGuardianComponent>(target)) if (!HasComp<CanHostGuardianComponent>(target))
{ {
_popupSystem.PopupEntity(Loc.GetString("guardian-activator-invalid-target"), user, Filter.Entities(user)); _popupSystem.PopupEntity(Loc.GetString("guardian-activator-invalid-target"), user, user);
return; return;
} }
// If user is already a host don't duplicate. // If user is already a host don't duplicate.
if (HasComp<GuardianHostComponent>(target)) if (HasComp<GuardianHostComponent>(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; return;
} }
@@ -204,9 +204,9 @@ namespace Content.Server.Guardian
{ {
guardianComponent.Host = ev.Target; 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 // Exhaust the activator
comp.Used = true; comp.Used = true;
} }
@@ -226,8 +226,8 @@ namespace Content.Server.Guardian
if (args.CurrentMobState.IsCritical()) if (args.CurrentMobState.IsCritical())
{ {
_popupSystem.PopupEntity(Loc.GetString("guardian-critical-warn"), component.HostedGuardian.Value, Filter.Entities(component.HostedGuardian.Value)); _popupSystem.PopupEntity(Loc.GetString("guardian-critical-warn"), component.HostedGuardian.Value, component.HostedGuardian.Value);
SoundSystem.Play("/Audio/Effects/guardian_warn.ogg", Filter.Entities(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()) else if (args.CurrentMobState.IsDead())
{ {
@@ -244,7 +244,7 @@ namespace Content.Server.Guardian
if (args.DamageDelta == null) return; if (args.DamageDelta == null) return;
_damageSystem.TryChangeDamage(component.Host, args.DamageDelta * component.DamageShare, origin: args.Origin); _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)) 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; return;
} }
@@ -342,7 +342,7 @@ namespace Content.Server.Guardian
hostComponent.GuardianContainer.Insert(guardianComponent.Owner); hostComponent.GuardianContainer.Insert(guardianComponent.Owner);
DebugTools.Assert(hostComponent.GuardianContainer.Contains(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; guardianComponent.GuardianLoose = false;
} }

View File

@@ -250,7 +250,7 @@ namespace Content.Server.Hands.Systems
if (!_inventorySystem.TryGetSlotEntity(plyEnt, equipmentSlot, out var slotEntity) || if (!_inventorySystem.TryGetSlotEntity(plyEnt, equipmentSlot, out var slotEntity) ||
!TryComp(slotEntity, out ServerStorageComponent? storageComponent)) !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; return;
} }
@@ -262,7 +262,7 @@ namespace Content.Server.Hands.Systems
{ {
if (storageComponent.StoredEntities.Count == 0) 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 else
{ {

View File

@@ -81,8 +81,7 @@ public sealed class ImmovableRodSystem : EntitySystem
{ {
// oh god. // oh god.
var coords = Transform(uid).Coordinates; var coords = Transform(uid).Coordinates;
_popup.PopupCoordinates(Loc.GetString("immovable-rod-collided-rod-not-good"), coords, _popup.PopupCoordinates(Loc.GetString("immovable-rod-collided-rod-not-good"), coords, PopupType.LargeCaution);
Filter.Pvs(uid), PopupType.LargeCaution);
Del(uid); Del(uid);
Del(ent); Del(ent);
@@ -96,8 +95,7 @@ public sealed class ImmovableRodSystem : EntitySystem
{ {
component.MobCount++; component.MobCount++;
_popup.PopupEntity(Loc.GetString("immovable-rod-penetrated-mob", ("rod", uid), ("mob", ent)), uid, _popup.PopupEntity(Loc.GetString("immovable-rod-penetrated-mob", ("rod", uid), ("mob", ent)), uid, PopupType.LargeCaution);
Filter.Pvs(uid), PopupType.LargeCaution);
_bodySystem.GibBody(ent, body: body); _bodySystem.GibBody(ent, body: body);
} }

View File

@@ -1,4 +1,4 @@
using System.Threading; using System.Threading;
using Content.Server.DoAfter; using Content.Server.DoAfter;
using Content.Server.Guardian; using Content.Server.Guardian;
using Content.Server.Popups; using Content.Server.Popups;
@@ -84,10 +84,10 @@ public sealed partial class ImplanterSystem : SharedImplanterSystem
/// <param name="implanter">The implanter being used</param> /// <param name="implanter">The implanter being used</param>
public void TryImplant(ImplanterComponent component, EntityUid user, EntityUid target, EntityUid implanter) 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); 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?.Cancel();
component.CancelToken = new CancellationTokenSource(); component.CancelToken = new CancellationTokenSource();
@@ -113,7 +113,7 @@ public sealed partial class ImplanterSystem : SharedImplanterSystem
//TODO: Remove when surgery is in //TODO: Remove when surgery is in
public void TryDraw(ImplanterComponent component, EntityUid user, EntityUid target, EntityUid implanter) 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?.Cancel();
component.CancelToken = new CancellationTokenSource(); component.CancelToken = new CancellationTokenSource();

View File

@@ -37,7 +37,7 @@ public sealed class SwappableInstrumentSystem : EntitySystem
{ {
_sharedInstrument.SetInstrumentProgram(instrument, entry.Value.Item1, entry.Value.Item2); _sharedInstrument.SetInstrumentProgram(instrument, entry.Value.Item1, entry.Value.Item2);
_popup.PopupEntity(Loc.GetString("swappable-instrument-component-style-set", ("style", entry.Key)), _popup.PopupEntity(Loc.GetString("swappable-instrument-component-style-set", ("style", entry.Key)),
args.User, Filter.Entities(args.User)); args.User, args.User);
} }
}; };

View File

@@ -68,11 +68,11 @@ public sealed class InteractionPopupSystem : EntitySystem
{ {
string msgOthers = Loc.GetString(component.MessagePerceivedByOthers, string msgOthers = Loc.GetString(component.MessagePerceivedByOthers,
("user", Identity.Entity(args.User, EntityManager)), ("target", Identity.Entity(uid, EntityManager))); ("user", Identity.Entity(args.User, EntityManager)), ("target", Identity.Entity(uid, EntityManager)));
_popupSystem.PopupEntity(msg, uid, Filter.Entities(args.User)); _popupSystem.PopupEntity(msg, uid, args.User);
_popupSystem.PopupEntity(msgOthers, uid, Filter.Pvs(uid, 2F, EntityManager).RemoveWhereAttachedEntity(puid => puid == args.User)); _popupSystem.PopupEntity(msgOthers, uid, Filter.PvsExcept(args.User, entityManager: EntityManager), true);
} }
else 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. if (sfx is not null) //not all cases will have sound.
{ {

View File

@@ -92,7 +92,7 @@ namespace Content.Server.Kitchen.EntitySystems
return; return;
if (component.PrototypesToSpawn?.Count > 0) { 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; args.Handled = true;
} }
} }
@@ -124,8 +124,7 @@ namespace Content.Server.Kitchen.EntitySystems
UpdateAppearance(uid, null, component); UpdateAppearance(uid, null, component);
_popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-kill", ("user", Identity.Entity(userUid, EntityManager)), ("victim", victimUid)), uid, _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-kill", ("user", Identity.Entity(userUid, EntityManager)), ("victim", victimUid)), uid, PopupType.LargeCaution);
Filter.Pvs(userUid), PopupType.LargeCaution);
// THE WHAT? // THE WHAT?
// TODO: Need to be able to leave them on the spike to do DoT, see ss13. // 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) if (component.PrototypesToSpawn.Count != 0)
{ {
_popupSystem.PopupEntity(component.MeatSource1p, uid, Filter.Entities(user), PopupType.MediumCaution); _popupSystem.PopupEntity(component.MeatSource1p, uid, user, PopupType.MediumCaution);
} }
else else
{ {
UpdateAppearance(uid, null, component); UpdateAppearance(uid, null, component);
_popupSystem.PopupEntity(component.MeatSource0, uid, Filter.Entities(user), PopupType.MediumCaution); _popupSystem.PopupEntity(component.MeatSource0, uid, user, PopupType.MediumCaution);
} }
return true; return true;
@@ -181,13 +180,13 @@ namespace Content.Server.Kitchen.EntitySystems
if (component.PrototypesToSpawn?.Count > 0) 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; return false;
} }
if (!Resolve(victimUid, ref butcherable, 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; return false;
} }
@@ -196,10 +195,10 @@ namespace Content.Server.Kitchen.EntitySystems
case ButcheringType.Spike: case ButcheringType.Spike:
return true; return true;
case ButcheringType.Knife: 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; return false;
default: 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; return false;
} }
} }
@@ -217,14 +216,13 @@ namespace Content.Server.Kitchen.EntitySystems
!mobState.IsDead()) !mobState.IsDead())
{ {
_popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-not-dead", ("victim", Identity.Entity(victimUid, EntityManager))), _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-not-dead", ("victim", Identity.Entity(victimUid, EntityManager))),
victimUid, Filter.Entities(userUid)); victimUid, userUid);
return true; return true;
} }
if (userUid != victimUid) if (userUid != victimUid)
{ {
_popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-begin-hook-victim", ("user", Identity.Entity(userUid, EntityManager)), ("this", uid)), victimUid, _popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-begin-hook-victim", ("user", Identity.Entity(userUid, EntityManager)), ("this", uid)), victimUid, victimUid, PopupType.LargeCaution);
Filter.Entities(victimUid), PopupType.LargeCaution);
} }
// TODO: make it work when SuicideEvent is implemented // TODO: make it work when SuicideEvent is implemented
// else // else

View File

@@ -210,8 +210,8 @@ namespace Content.Server.Kitchen.EntitySystems
? Loc.GetString("microwave-component-suicide-multi-head-message") ? Loc.GetString("microwave-component-suicide-multi-head-message")
: Loc.GetString("microwave-component-suicide-message"); : Loc.GetString("microwave-component-suicide-message");
_popupSystem.PopupEntity(othersMessage, victim, Filter.PvsExcept(victim)); _popupSystem.PopupEntity(othersMessage, victim, Filter.PvsExcept(victim), true);
_popupSystem.PopupEntity(selfMessage, victim, Filter.Entities(victim)); _popupSystem.PopupEntity(selfMessage, victim, victim);
_audio.PlayPvs(component.ClickSound, uid, AudioParams.Default.WithVolume(-2)); _audio.PlayPvs(component.ClickSound, uid, AudioParams.Default.WithVolume(-2));
component.CurrentCookTimerTime = 10; component.CurrentCookTimerTime = 10;
@@ -230,19 +230,19 @@ namespace Content.Server.Kitchen.EntitySystems
return; return;
if (!(TryComp<ApcPowerReceiverComponent>(uid, out var apc) && apc.Powered)) if (!(TryComp<ApcPowerReceiverComponent>(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; return;
} }
if (component.Broken) 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; return;
} }
if (!HasComp<ItemComponent>(args.Used)) if (!HasComp<ItemComponent>(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; return;
} }

View File

@@ -141,7 +141,7 @@ namespace Content.Server.Kitchen.EntitySystems
if (!HasComp<FitsInDispenserComponent>(heldEnt)) if (!HasComp<FitsInDispenserComponent>(heldEnt))
{ {
// This is ugly but we can't use whitelistFailPopup because there are 2 containers with different whitelists. // 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. // Entity did NOT pass the whitelist for grind/juice.

View File

@@ -107,7 +107,7 @@ public sealed class SharpSystem : EntitySystem
popupType = PopupType.LargeCaution; popupType = PopupType.LargeCaution;
_popupSystem.PopupEntity(Loc.GetString("butcherable-knife-butchered-success", ("target", ev.Entity), ("knife", ev.Sharp)), _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) if (hasBody)
_bodySystem.GibBody(body!.Owner, body: body); _bodySystem.GibBody(body!.Owner, body: body);

View File

@@ -45,9 +45,9 @@ namespace Content.Server.Labels
{ {
Act = () => Act = () =>
{ {
AddLabelTo(uid, handLabeler, target, out string? result); AddLabelTo(uid, handLabeler, target, out var result);
if (result != null) if (result != null)
_popupSystem.PopupEntity(result, args.User, Filter.Entities(args.User)); _popupSystem.PopupEntity(result, args.User, args.User);
}, },
Text = labelerText Text = labelerText
}; };
@@ -62,7 +62,7 @@ namespace Content.Server.Labels
AddLabelTo(uid, handLabeler, target, out string? result); AddLabelTo(uid, handLabeler, target, out string? result);
if (result == null) if (result == null)
return; return;
_popupSystem.PopupEntity(result, args.User, Filter.Entities(args.User)); _popupSystem.PopupEntity(result, args.User, args.User);
// Log labeling // Log labeling
_adminLogger.Add(LogType.Action, LogImpact.Low, _adminLogger.Add(LogType.Action, LogImpact.Low,

View File

@@ -35,7 +35,7 @@ public sealed class LandMineSystem : EntitySystem
_popupSystem.PopupCoordinates( _popupSystem.PopupCoordinates(
Loc.GetString("land-mine-triggered", ("mine", uid)), Loc.GetString("land-mine-triggered", ("mine", uid)),
Transform(uid).Coordinates, Transform(uid).Coordinates,
Filter.Entities(args.Tripper), args.Tripper,
PopupType.LargeCaution); PopupType.LargeCaution);
} }
} }

View File

@@ -210,7 +210,7 @@ namespace Content.Server.Light.EntitySystems
!TryComp(component.Owner, out battery)) !TryComp(component.Owner, out battery))
{ {
SoundSystem.Play(component.TurnOnFailSound.GetSound(), Filter.Pvs(component.Owner, entityManager: EntityManager), component.Owner); 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; return false;
} }
@@ -220,7 +220,7 @@ namespace Content.Server.Light.EntitySystems
if (component.Wattage > battery.CurrentCharge) if (component.Wattage > battery.CurrentCharge)
{ {
SoundSystem.Play(component.TurnOnFailSound.GetSound(), Filter.Pvs(component.Owner, entityManager: EntityManager), component.Owner); 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; return false;
} }

View File

@@ -121,7 +121,7 @@ namespace Content.Server.Light.EntitySystems
{ {
var msg = Loc.GetString("comp-light-replacer-missing-light", var msg = Loc.GetString("comp-light-replacer-missing-light",
("light-replacer", replacer.Owner)); ("light-replacer", replacer.Owner));
_popupSystem.PopupEntity(msg, replacerUid, Filter.Entities(userUid.Value)); _popupSystem.PopupEntity(msg, replacerUid, userUid.Value);
} }
return false; return false;
} }
@@ -157,7 +157,7 @@ namespace Content.Server.Light.EntitySystems
if (showTooltip && userUid != null) if (showTooltip && userUid != null)
{ {
var msg = Loc.GetString("comp-light-replacer-insert-broken-light"); 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; return false;
@@ -169,7 +169,7 @@ namespace Content.Server.Light.EntitySystems
{ {
var msg = Loc.GetString("comp-light-replacer-insert-light", var msg = Loc.GetString("comp-light-replacer-insert-light",
("light-replacer", replacer.Owner), ("bulb", bulb.Owner)); ("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; return hasInsert;
@@ -208,7 +208,7 @@ namespace Content.Server.Light.EntitySystems
if (insertedBulbs > 0 && userUid != null) if (insertedBulbs > 0 && userUid != null)
{ {
var msg = Loc.GetString("comp-light-replacer-refill-from-storage", ("light-replacer", storage.Owner)); 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; return insertedBulbs > 0;

View File

@@ -115,7 +115,7 @@ namespace Content.Server.Light.EntitySystems
{ {
// apply damage to users hands and show message with sound // apply damage to users hands and show message with sound
var burnMsg = Loc.GetString("powered-light-component-burn-hand"); 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); var damage = _damageableSystem.TryChangeDamage(userUid, light.Damage, origin: userUid);

View File

@@ -66,7 +66,7 @@ namespace Content.Server.Lock
if (component.Locked) if (component.Locked)
{ {
if (!args.Silent) 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(); args.Cancel();
} }

View File

@@ -12,6 +12,7 @@ using Robust.Shared.Player;
using Content.Shared.Verbs; using Content.Shared.Verbs;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Content.Shared.MachineLinking.Events; using Content.Shared.MachineLinking.Events;
using Content.Server.Database;
namespace Content.Server.MachineLinking.System namespace Content.Server.MachineLinking.System
{ {
@@ -89,7 +90,7 @@ namespace Content.Server.MachineLinking.System
var msg = TryLinkDefaults(uid, linker.SavedTransmitter.Value, args.User, component) 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-success", ("machine", linker.SavedTransmitter.Value))
: Loc.GetString("signal-linking-verb-fail", ("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; return;
} }
@@ -121,7 +122,7 @@ namespace Content.Server.MachineLinking.System
var msg = TryLinkDefaults(linker.SavedReceiver.Value, uid, args.User, null, component) 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-success", ("machine", linker.SavedReceiver.Value))
: Loc.GetString("signal-linking-verb-fail", ("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; return;
} }
@@ -213,7 +214,7 @@ namespace Content.Server.MachineLinking.System
if (!TryComp(linker.SavedReceiver, out SignalReceiverComponent? receiver)) if (!TryComp(linker.SavedReceiver, out SignalReceiverComponent? receiver))
{ {
_popupSystem.PopupCursor(Loc.GetString("signal-linker-component-saved", ("machine", uid)), _popupSystem.PopupCursor(Loc.GetString("signal-linker-component-saved", ("machine", uid)),
Filter.Entities(args.User), PopupType.Medium); args.User, PopupType.Medium);
args.Handled = true; args.Handled = true;
return; return;
} }
@@ -239,7 +240,7 @@ namespace Content.Server.MachineLinking.System
if (!TryComp(linker.SavedTransmitter, out SignalTransmitterComponent? transmitter)) if (!TryComp(linker.SavedTransmitter, out SignalTransmitterComponent? transmitter))
{ {
_popupSystem.PopupCursor(Loc.GetString("signal-linker-component-saved", ("machine", uid)), _popupSystem.PopupCursor(Loc.GetString("signal-linker-component-saved", ("machine", uid)),
Filter.Entities(args.User), PopupType.Medium); args.User, PopupType.Medium);
args.Handled = true; args.Handled = true;
return; return;
} }
@@ -287,8 +288,7 @@ namespace Content.Server.MachineLinking.System
!receiver.Inputs.TryGetValue(args.ReceiverPort, out var linkedTransmitters)) !receiver.Inputs.TryGetValue(args.ReceiverPort, out var linkedTransmitters))
return false; return false;
// Accounts for possibly missing user & the quiet option. quiet |= !user.HasValue;
var alertFilter = (!quiet && user != null) ? Filter.Entities(user.Value) : null;
// Does the link already exist? Under the assumption that nothing has broken, lets only check the // Does the link already exist? Under the assumption that nothing has broken, lets only check the
// transmitter ports. // transmitter ports.
@@ -300,9 +300,8 @@ namespace Content.Server.MachineLinking.System
if (checkRange && !IsInRange(transmitter, receiver)) if (checkRange && !IsInRange(transmitter, receiver))
{ {
if (alertFilter != null) if (!quiet)
_popupSystem.PopupCursor(Loc.GetString("signal-linker-component-out-of-range"), _popupSystem.PopupCursor(Loc.GetString("signal-linker-component-out-of-range"), user!.Value);
alertFilter);
return false; return false;
} }
@@ -311,27 +310,25 @@ namespace Content.Server.MachineLinking.System
RaiseLocalEvent(transmitter.Owner, linkAttempt, true); RaiseLocalEvent(transmitter.Owner, linkAttempt, true);
if (linkAttempt.Cancelled) if (linkAttempt.Cancelled)
{ {
if (alertFilter != null) if (!quiet)
_popupSystem.PopupCursor(Loc.GetString("signal-linker-component-connection-refused", ("machine", transmitter.Owner)), _popupSystem.PopupCursor(Loc.GetString("signal-linker-component-connection-refused", ("machine", transmitter.Owner)), user!.Value);
alertFilter);
return false; return false;
} }
RaiseLocalEvent(receiver.Owner, linkAttempt, true); RaiseLocalEvent(receiver.Owner, linkAttempt, true);
if (linkAttempt.Cancelled) if (linkAttempt.Cancelled)
{ {
if (alertFilter != null) if (!quiet)
_popupSystem.PopupCursor(Loc.GetString("signal-linker-component-connection-refused", ("machine", receiver.Owner)), _popupSystem.PopupCursor(Loc.GetString("signal-linker-component-connection-refused", ("machine", receiver.Owner)), user!.Value);
alertFilter);
return false; return false;
} }
linkedReceivers.Add(new(receiver.Owner, args.ReceiverPort)); linkedReceivers.Add(new(receiver.Owner, args.ReceiverPort));
linkedTransmitters.Add(new(transmitter.Owner, args.TransmitterPort)); linkedTransmitters.Add(new(transmitter.Owner, args.TransmitterPort));
if (alertFilter != null) if (!quiet)
_popupSystem.PopupCursor(Loc.GetString("signal-linker-component-linked-port", _popupSystem.PopupCursor(Loc.GetString("signal-linker-component-linked-port",
("machine1", transmitter.Owner), ("port1", PortName<TransmitterPortPrototype>(args.TransmitterPort)), ("machine1", transmitter.Owner), ("port1", PortName<TransmitterPortPrototype>(args.TransmitterPort)),
("machine2", receiver.Owner), ("port2", PortName<ReceiverPortPrototype>(args.ReceiverPort))), ("machine2", receiver.Owner), ("port2", PortName<ReceiverPortPrototype>(args.ReceiverPort))),
alertFilter, PopupType.Medium); user!.Value, PopupType.Medium);
var newLink = new NewLinkEvent(user, transmitter.Owner, args.TransmitterPort, receiver.Owner, args.ReceiverPort); var newLink = new NewLinkEvent(user, transmitter.Owner, args.TransmitterPort, receiver.Owner, args.ReceiverPort);
RaiseLocalEvent(receiver.Owner, newLink); RaiseLocalEvent(receiver.Owner, newLink);
@@ -362,7 +359,7 @@ namespace Content.Server.MachineLinking.System
_popupSystem.PopupCursor(Loc.GetString("signal-linker-component-unlinked-port", _popupSystem.PopupCursor(Loc.GetString("signal-linker-component-unlinked-port",
("machine1", transmitter.Owner), ("port1", PortName<TransmitterPortPrototype>(args.TransmitterPort)), ("machine1", transmitter.Owner), ("port1", PortName<TransmitterPortPrototype>(args.TransmitterPort)),
("machine2", receiver.Owner), ("port2", PortName<ReceiverPortPrototype>(args.ReceiverPort))), ("machine2", receiver.Owner), ("port2", PortName<ReceiverPortPrototype>(args.ReceiverPort))),
Filter.Entities(attached), PopupType.Medium); attached, PopupType.Medium);
} }
else else
{ // something weird happened { // something weird happened

View File

@@ -23,7 +23,7 @@ public sealed class MaterialStorageSystem : SharedMaterialStorageSystem
return false; return false;
_audio.PlayPvs(component.InsertingSound, component.Owner); _audio.PlayPvs(component.InsertingSound, component.Owner);
_popup.PopupEntity(Loc.GetString("machine-insert-item", ("user", user), ("machine", 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); QueueDel(toInsert);
return true; return true;
} }

View File

@@ -48,7 +48,7 @@ public sealed class MechEquipmentSystem : EntitySystem
if (mechComp.EquipmentWhitelist != null && !mechComp.EquipmentWhitelist.IsValid(uid)) if (mechComp.EquipmentWhitelist != null && !mechComp.EquipmentWhitelist.IsValid(uid))
return; 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(); component.TokenSource = new();
_doAfter.DoAfter(new DoAfterEventArgs(args.User, component.InstallDuration, component.TokenSource.Token, mech, uid) _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) private void OnFinished(EntityUid uid, MechEquipmentComponent component, MechEquipmentInstallFinished args)
{ {
component.TokenSource = null; 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); _mech.InsertEquipment(args.Mech, uid);
} }

View File

@@ -112,7 +112,7 @@ namespace Content.Server.Medical.BiomassReclaimer
if (TryComp<ApcPowerReceiverComponent>(uid, out var power) && !power.Powered) if (TryComp<ApcPowerReceiverComponent>(uid, out var power) && !power.Powered)
return; 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); StartProcessing(args.Victim, component);
args.SetHandled(SuicideKind.Blunt); args.SetHandled(SuicideKind.Blunt);
} }

View File

@@ -81,11 +81,11 @@ namespace Content.Server.Medical
if (args.User == args.Target) if (args.User == args.Target)
{ {
_popupSystem.PopupEntity(Loc.GetString("disease-scanner-gave-self", ("disease", args.Component.Disease)), _popupSystem.PopupEntity(Loc.GetString("disease-scanner-gave-self", ("disease", args.Component.Disease)),
args.User, Filter.Entities(args.User)); args.User, args.User);
return; return;
} }
_popupSystem.PopupEntity(Loc.GetString("disease-scanner-gave-other", ("target", Identity.Entity(args.Target.Value, EntityManager)), ("disease", args.Component.Disease)), _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) private void OpenUserInterface(EntityUid user, HealthAnalyzerComponent healthAnalyzer)

View File

@@ -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() /// 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<RespiratorComponent>(target) || !TryComp<MobStateComponent>(target, out var mobState) || mobState.IsDead()) if (!HasComp<RespiratorComponent>(target) || !TryComp<MobStateComponent>(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; return;
} }
@@ -149,7 +149,7 @@ namespace Content.Server.Medical
var message = GetDamageMessage(value); 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) private string GetDamageMessage(FixedPoint2 totalOxyloss)

View File

@@ -216,7 +216,7 @@ namespace Content.Server.Medical.SuitSensors
if (userUid != null) if (userUid != null)
{ {
var msg = Loc.GetString("suit-sensor-mode-state", ("mode", GetModeName(mode))); 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);
} }
} }

View File

@@ -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)); 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 // Get the solution of the puddle we spawned
if (!_solutionSystem.TryGetSolution(puddle, puddleComp.SolutionName, out var puddleSolution)) if (!_solutionSystem.TryGetSolution(puddle, puddleComp.SolutionName, out var puddleSolution))
return; return;

View File

@@ -140,13 +140,13 @@ public sealed class CrematoriumSystem : EntitySystem
if (mind.OwnedEntity is { Valid: true } entity) 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", _popup.PopupEntity(Loc.GetString("crematorium-entity-storage-component-suicide-message-others",
("victim", Identity.Entity(victim, EntityManager))), ("victim", Identity.Entity(victim, EntityManager))),
victim, Filter.PvsExcept(victim), PopupType.LargeCaution); victim, Filter.PvsExcept(victim), true, PopupType.LargeCaution);
if (_entityStorage.CanInsert(uid)) if (_entityStorage.CanInsert(uid))
{ {

View File

@@ -30,7 +30,7 @@ public sealed class MousetrapSystem : EntitySystem
? Loc.GetString("mousetrap-on-activate") ? Loc.GetString("mousetrap-on-activate")
: Loc.GetString("mousetrap-on-deactivate"), : Loc.GetString("mousetrap-on-deactivate"),
uid, uid,
Filter.Entities(args.User)); args.User);
UpdateVisuals(uid); UpdateVisuals(uid);
} }

View File

@@ -68,7 +68,7 @@ public sealed class MedibotInjectOperator : HTNOperator
if (damage.TotalDamage >= MedibotComponent.EmergencyMedDamageThreshold) if (damage.TotalDamage >= MedibotComponent.EmergencyMedDamageThreshold)
{ {
_solutionSystem.TryAddReagent(target, injectable, botComp.EmergencyMed, botComp.EmergencyMedInjectAmount, out var accepted); _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); SoundSystem.Play("/Audio/Items/hypospray.ogg", Filter.Pvs(target), target);
_chat.TrySendInGameICMessage(owner, Loc.GetString("medibot-finish-inject"), InGameICChatType.Speak, hideChat: false, hideGlobalGhostChat: true); _chat.TrySendInGameICMessage(owner, Loc.GetString("medibot-finish-inject"), InGameICChatType.Speak, hideChat: false, hideGlobalGhostChat: true);
return HTNOperatorStatus.Finished; return HTNOperatorStatus.Finished;
@@ -77,7 +77,7 @@ public sealed class MedibotInjectOperator : HTNOperator
if (damage.TotalDamage >= MedibotComponent.StandardMedDamageThreshold) if (damage.TotalDamage >= MedibotComponent.StandardMedDamageThreshold)
{ {
_solutionSystem.TryAddReagent(target, injectable, botComp.StandardMed, botComp.StandardMedInjectAmount, out var accepted); _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); SoundSystem.Play("/Audio/Items/hypospray.ogg", Filter.Pvs(target), target);
_chat.TrySendInGameICMessage(owner, Loc.GetString("medibot-finish-inject"), InGameICChatType.Speak, hideChat: false, hideGlobalGhostChat: true); _chat.TrySendInGameICMessage(owner, Loc.GetString("medibot-finish-inject"), InGameICChatType.Speak, hideChat: false, hideGlobalGhostChat: true);
return HTNOperatorStatus.Finished; return HTNOperatorStatus.Finished;

View File

@@ -151,7 +151,7 @@ namespace Content.Server.Nuke
if (component.Status == NukeStatus.ARMED) if (component.Status == NukeStatus.ARMED)
{ {
var msg = Loc.GetString("nuke-component-cant-anchor"); var msg = Loc.GetString("nuke-component-cant-anchor");
_popups.PopupEntity(msg, uid, Filter.Entities(args.User)); _popups.PopupEntity(msg, uid, args.User);
args.Cancel(); args.Cancel();
} }
@@ -591,7 +591,7 @@ namespace Content.Server.Nuke
_doAfterSystem.DoAfter(doafter); _doAfterSystem.DoAfter(doafter);
_popups.PopupEntity(Loc.GetString("nuke-component-doafter-warning"), user, _popups.PopupEntity(Loc.GetString("nuke-component-doafter-warning"), user,
Filter.Entities(user), PopupType.LargeCaution); user, PopupType.LargeCaution);
} }
private void NukeArmedAudio(NukeComponent component) private void NukeArmedAudio(NukeComponent component)

View File

@@ -231,7 +231,7 @@ namespace Content.Server.Nutrition.EntitySystems
if (!drink.Opened) if (!drink.Opened)
{ {
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-not-open", _popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-not-open",
("owner", EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), drink.Owner, Filter.Entities(user)); ("owner", EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), drink.Owner, user);
return true; return true;
} }
@@ -239,7 +239,7 @@ namespace Content.Server.Nutrition.EntitySystems
drinkSolution.DrainAvailable <= 0) drinkSolution.DrainAvailable <= 0)
{ {
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty", _popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty",
("entity", EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), drink.Owner, Filter.Entities(user)); ("entity", EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), drink.Owner, user);
return true; return true;
} }
@@ -256,7 +256,7 @@ namespace Content.Server.Nutrition.EntitySystems
var userName = Identity.Entity(user, EntityManager); var userName = Identity.Entity(user, EntityManager);
_popupSystem.PopupEntity(Loc.GetString("drink-component-force-feed", ("user", userName)), _popupSystem.PopupEntity(Loc.GetString("drink-component-force-feed", ("user", userName)),
user, Filter.Entities(target)); user, target);
// logging // logging
_adminLogger.Add(LogType.ForceFeed, LogImpact.Medium, $"{ToPrettyString(user):user} is forcing {ToPrettyString(target):target} to drink {ToPrettyString(drink.Owner):drink} {SolutionContainerSystem.ToPrettyString(drinkSolution)}"); _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 ? forceDrink ?
Loc.GetString("drink-component-try-use-drink-cannot-drink-other") : Loc.GetString("drink-component-try-use-drink-cannot-drink-other") :
Loc.GetString("drink-component-try-use-drink-had-enough"), Loc.GetString("drink-component-try-use-drink-had-enough"),
uid, Filter.Entities(args.User)); uid, args.User);
if (EntityManager.HasComponent<RefillableSolutionComponent>(uid)) if (EntityManager.HasComponent<RefillableSolutionComponent>(uid))
{ {
@@ -327,12 +327,12 @@ namespace Content.Server.Nutrition.EntitySystems
if (firstStomach == null) if (firstStomach == null)
{ {
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-had-enough"), _popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-had-enough"),
uid, Filter.Entities(uid)); uid, uid);
if (forceDrink) if (forceDrink)
{ {
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-had-enough-other"), _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"); _spillableSystem.SpillAt(uid, drained, "PuddleSmear");
} }
else else
@@ -351,11 +351,11 @@ namespace Content.Server.Nutrition.EntitySystems
var userName = Identity.Entity(args.User, EntityManager); var userName = Identity.Entity(args.User, EntityManager);
_popupSystem.PopupEntity( _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( _popupSystem.PopupEntity(
Loc.GetString("drink-component-force-feed-success-user", ("target", targetName)), Loc.GetString("drink-component-force-feed-success-user", ("target", targetName)),
args.User, Filter.Entities(args.User)); args.User, args.User);
// log successful forced drinking // 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}"); _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( _popupSystem.PopupEntity(
Loc.GetString("drink-component-try-use-drink-success-slurp-taste", ("flavors", flavors)), args.User, Loc.GetString("drink-component-try-use-drink-success-slurp-taste", ("flavors", flavors)), args.User,
Filter.Entities(args.User)); args.User);
_popupSystem.PopupEntity( _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 // log successful voluntary drinking
_adminLogger.Add(LogType.Ingestion, LogImpact.Low, $"{ToPrettyString(args.User):target} drank {ToPrettyString(args.Drink.Owner):drink}"); _adminLogger.Add(LogType.Ingestion, LogImpact.Low, $"{ToPrettyString(args.User):target} drank {ToPrettyString(args.Drink.Owner):drink}");

Some files were not shown because too many files have changed in this diff Show More