Wizard Recall shows Disappearing text at Coordinate (#35272)

* Add prediction for coordinate based popups

* Remove use of deprecated EntityCoordinates.ToMap

* RecallItem displays disppearing text at entity coordinates

* Update Content.Shared/ItemRecall/SharedItemRecallSystem.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Shared/Popups/SharedPopupSystem.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Add ItemRecall message for witnesses

* Update Content.Shared/ItemRecall/SharedItemRecallSystem.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Resources/Locale/en-US/item-recall/item-recall.ftl

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Fix namespace issues

* Fix Loc string

* Dont fixstuff tired..

* Prefix THE

* Filter around the entity, and remove recipient if needed

* Alphabetical imports

* Update Content.Client/Popups/PopupSystem.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* fixup

* Better handling.

---------

Co-authored-by: Cooper Wallace <CooperWallace@users.noreply.github.com>
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
Cooper Wallace
2025-02-18 18:47:10 -07:00
committed by GitHub
parent 543b4825f6
commit e0d911bc47
5 changed files with 38 additions and 5 deletions

View File

@@ -11,7 +11,7 @@ namespace Content.Server.Popups
{
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly TransformSystem _xform = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
public override void PopupCursor(string? message, PopupType type = PopupType.Small)
{
@@ -47,8 +47,7 @@ namespace Content.Server.Popups
{
if (message == null)
return;
var mapPos = coordinates.ToMap(EntityManager, _xform);
var mapPos = _transform.ToMapCoordinates(coordinates);
var filter = Filter.Empty().AddPlayersByPvs(mapPos, entManager: EntityManager, playerMan: _player, cfgMan: _cfg);
RaiseNetworkEvent(new PopupCoordinatesEvent(message, type, GetNetCoordinates(coordinates)), filter);
}
@@ -70,6 +69,21 @@ namespace Content.Server.Popups
RaiseNetworkEvent(new PopupCoordinatesEvent(message, type, GetNetCoordinates(coordinates)), actor.PlayerSession);
}
public override void PopupPredictedCoordinates(string? message, EntityCoordinates coordinates, EntityUid? recipient, PopupType type = PopupType.Small)
{
if (message == null)
return;
var mapPos = _transform.ToMapCoordinates(coordinates);
var filter = Filter.Empty().AddPlayersByPvs(mapPos, entManager: EntityManager, playerMan: _player, cfgMan: _cfg);
if (recipient != null)
{
// Don't send to recipient, since they predicted it locally
filter = filter.RemovePlayerByAttachedEntity(recipient.Value);
}
RaiseNetworkEvent(new PopupCoordinatesEvent(message, type, GetNetCoordinates(coordinates)), filter);
}
public override void PopupEntity(string? message, EntityUid uid, PopupType type = PopupType.Small)
{
if (message == null)