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

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

View File

@@ -12,7 +12,7 @@ namespace Content.Server.Construction.Completions
public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager)
{
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 JetBrains.Annotations;
using Robust.Shared.Player;
@@ -20,9 +20,9 @@ namespace Content.Server.Construction.Completions
var popupSystem = entityManager.EntitySysManager.GetEntitySystem<PopupSystem>();
if(Cursor)
popupSystem.PopupCursor(Loc.GetString(Text), Filter.Entities(userUid.Value));
popupSystem.PopupCursor(Loc.GetString(Text), userUid.Value);
else
popupSystem.PopupEntity(Loc.GetString(Text), uid, Filter.Entities(userUid.Value));
popupSystem.PopupEntity(Loc.GetString(Text), uid, userUid.Value);
}
}
}

View File

@@ -52,11 +52,11 @@ namespace Content.Server.Construction
if (component.TargetNode == null)
{
// Maybe check, but on the flip-side a better solution might be to not make it undeconstructible in the first place, no?
_popup.PopupEntity(Loc.GetString("deconstructible-verb-activate-no-target-text"), uid, Filter.Entities(uid));
_popup.PopupEntity(Loc.GetString("deconstructible-verb-activate-no-target-text"), uid, uid);
}
else
{
_popup.PopupEntity(Loc.GetString("deconstructible-verb-activate-text"), args.User, Filter.Entities(args.User));
_popup.PopupEntity(Loc.GetString("deconstructible-verb-activate-text"), args.User, args.User);
}
};

View File

@@ -96,7 +96,7 @@ namespace Content.Server.Construction
if (existed)
{
_popup.PopupCursor(Loc.GetString("construction-system-construct-cannot-start-another-construction"), Filter.Entities(user));
_popup.PopupCursor(Loc.GetString("construction-system-construct-cannot-start-another-construction"), user);
return null;
}
@@ -221,7 +221,7 @@ namespace Content.Server.Construction
if (failed)
{
_popup.PopupCursor(Loc.GetString("construction-system-construct-no-materials"), Filter.Entities(user));
_popup.PopupCursor(Loc.GetString("construction-system-construct-no-materials"), user);
FailCleanup();
return null;
}
@@ -379,7 +379,7 @@ namespace Content.Server.Construction
if (_container.IsEntityInContainer(user))
{
_popup.PopupCursor(Loc.GetString("construction-system-inside-container"), Filter.Entities(user));
_popup.PopupCursor(Loc.GetString("construction-system-inside-container"), user);
return;
}
@@ -392,7 +392,7 @@ namespace Content.Server.Construction
{
if (!set.Add(ev.Ack))
{
_popup.PopupCursor(Loc.GetString("construction-system-already-building"), Filter.Entities(user));
_popup.PopupCursor(Loc.GetString("construction-system-already-building"), user);
return;
}
}

View File

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