Ignore player ent for popup raycasts (#13485)
This commit is contained in:
@@ -4,6 +4,7 @@ using Content.Shared.Examine;
|
|||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Robust.Client.Graphics;
|
using Robust.Client.Graphics;
|
||||||
|
using Robust.Client.Player;
|
||||||
using Robust.Client.ResourceManagement;
|
using Robust.Client.ResourceManagement;
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
using Robust.Shared;
|
using Robust.Shared;
|
||||||
@@ -21,6 +22,7 @@ public sealed class PopupOverlay : Overlay
|
|||||||
{
|
{
|
||||||
private readonly IConfigurationManager _configManager;
|
private readonly IConfigurationManager _configManager;
|
||||||
private readonly IEntityManager _entManager;
|
private readonly IEntityManager _entManager;
|
||||||
|
private readonly IPlayerManager _playerMgr;
|
||||||
private readonly IUserInterfaceManager _uiManager;
|
private readonly IUserInterfaceManager _uiManager;
|
||||||
private readonly PopupSystem _popup;
|
private readonly PopupSystem _popup;
|
||||||
|
|
||||||
@@ -34,6 +36,7 @@ public sealed class PopupOverlay : Overlay
|
|||||||
public PopupOverlay(
|
public PopupOverlay(
|
||||||
IConfigurationManager configManager,
|
IConfigurationManager configManager,
|
||||||
IEntityManager entManager,
|
IEntityManager entManager,
|
||||||
|
IPlayerManager playerMgr,
|
||||||
IPrototypeManager protoManager,
|
IPrototypeManager protoManager,
|
||||||
IResourceCache cache,
|
IResourceCache cache,
|
||||||
IUserInterfaceManager uiManager,
|
IUserInterfaceManager uiManager,
|
||||||
@@ -41,6 +44,7 @@ public sealed class PopupOverlay : Overlay
|
|||||||
{
|
{
|
||||||
_configManager = configManager;
|
_configManager = configManager;
|
||||||
_entManager = entManager;
|
_entManager = entManager;
|
||||||
|
_playerMgr = playerMgr;
|
||||||
_uiManager = uiManager;
|
_uiManager = uiManager;
|
||||||
_popup = popup;
|
_popup = popup;
|
||||||
|
|
||||||
@@ -75,6 +79,7 @@ public sealed class PopupOverlay : Overlay
|
|||||||
|
|
||||||
var matrix = args.ViewportControl!.GetWorldToScreenMatrix();
|
var matrix = args.ViewportControl!.GetWorldToScreenMatrix();
|
||||||
var viewPos = new MapCoordinates(args.WorldAABB.Center, args.MapId);
|
var viewPos = new MapCoordinates(args.WorldAABB.Center, args.MapId);
|
||||||
|
var ourEntity = _playerMgr.LocalPlayer?.ControlledEntity;
|
||||||
|
|
||||||
foreach (var popup in _popup.WorldLabels)
|
foreach (var popup in _popup.WorldLabels)
|
||||||
{
|
{
|
||||||
@@ -87,7 +92,7 @@ public sealed class PopupOverlay : Overlay
|
|||||||
|
|
||||||
// Should handle fade here too wyci.
|
// Should handle fade here too wyci.
|
||||||
if (!args.WorldAABB.Contains(mapPos.Position) || !ExamineSystemShared.InRangeUnOccluded(viewPos, mapPos, distance,
|
if (!args.WorldAABB.Contains(mapPos.Position) || !ExamineSystemShared.InRangeUnOccluded(viewPos, mapPos, distance,
|
||||||
e => e == popup.InitialPos.EntityId, entMan: _entManager))
|
e => e == popup.InitialPos.EntityId || e == ourEntity, entMan: _entManager))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var pos = matrix.Transform(mapPos.Position);
|
var pos = matrix.Transform(mapPos.Position);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace Content.Client.Popups
|
|||||||
SubscribeNetworkEvent<PopupEntityEvent>(OnPopupEntityEvent);
|
SubscribeNetworkEvent<PopupEntityEvent>(OnPopupEntityEvent);
|
||||||
SubscribeNetworkEvent<RoundRestartCleanupEvent>(OnRoundRestart);
|
SubscribeNetworkEvent<RoundRestartCleanupEvent>(OnRoundRestart);
|
||||||
_overlay
|
_overlay
|
||||||
.AddOverlay(new PopupOverlay(_configManager, EntityManager, _prototype, _resource, _uiManager, this));
|
.AddOverlay(new PopupOverlay(_configManager, EntityManager, _playerManager, _prototype, _resource, _uiManager, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Shutdown()
|
public override void Shutdown()
|
||||||
|
|||||||
Reference in New Issue
Block a user