-using System.Numerics;
+using System.Numerics;
using Content.Shared.CardboardBox;
using Content.Shared.CardboardBox.Components;
using Content.Shared.Examine;
{
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
[Dependency] private readonly TransformSystem _transform = default!;
+ [Dependency] private readonly ExamineSystemShared _examine = default!;
public override void Initialize()
{
foreach (var mob in mobMoverEntities)
{
var mapPos = _transform.GetMapCoordinates(mob);
- if (!ExamineSystemShared.InRangeUnOccluded(sourcePos, mapPos, box.Distance, null))
+ if (!_examine.InRangeUnOccluded(sourcePos, mapPos, box.Distance, null))
continue;
var ent = Spawn(box.Effect, mapPos);
private readonly IUserInterfaceManager _uiManager;
private readonly PopupSystem _popup;
private readonly PopupUIController _controller;
+ private readonly ExamineSystemShared _examine;
private readonly ShaderInstance _shader;
IPrototypeManager protoManager,
IUserInterfaceManager uiManager,
PopupUIController controller,
+ ExamineSystemShared examine,
PopupSystem popup)
{
_configManager = configManager;
_entManager = entManager;
_playerMgr = playerMgr;
_uiManager = uiManager;
+ _examine = examine;
_popup = popup;
_controller = controller;
var distance = (mapPos.Position - args.WorldBounds.Center).Length();
// Should handle fade here too wyci.
- if (!args.WorldBounds.Contains(mapPos.Position) || !ExamineSystemShared.InRangeUnOccluded(viewPos, mapPos, distance,
+ if (!args.WorldBounds.Contains(mapPos.Position) || !_examine.InRangeUnOccluded(viewPos, mapPos, distance,
e => e == popup.InitialPos.EntityId || e == ourEntity, entMan: _entManager))
continue;
using System.Linq;
+using Content.Shared.Examine;
using Content.Shared.GameTicking;
using Content.Shared.Popups;
using Robust.Client.Graphics;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IUserInterfaceManager _uiManager = default!;
[Dependency] private readonly IReplayRecordingManager _replayRecording = default!;
+ [Dependency] private readonly ExamineSystemShared _examine = default!;
public IReadOnlyList<WorldPopupLabel> WorldLabels => _aliveWorldLabels;
public IReadOnlyList<CursorPopupLabel> CursorLabels => _aliveCursorLabels;
_prototype,
_uiManager,
_uiManager.GetUIController<PopupUIController>(),
+ _examine,
this));
}
var otherPos = EntityManager.GetComponent<TransformComponent>(ent).MapPosition;
- if (occluded && !ExamineSystemShared.InRangeUnOccluded(
+ if (occluded && !_examine.InRangeUnOccluded(
playerPos,
otherPos, 0f,
(ent, player), predicate))
public sealed class VerbSystem : SharedVerbSystem
{
[Dependency] private readonly PopupSystem _popupSystem = default!;
- [Dependency] private readonly ExamineSystem _examineSystem = default!;
+ [Dependency] private readonly ExamineSystem _examine = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
[Dependency] private readonly IStateManager _stateManager = default!;
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
bool Predicate(EntityUid e) => e == player || entitiesUnderMouse.Contains(e);
// first check the general location.
- if (!_examineSystem.CanExamine(player.Value, targetPos, Predicate))
+ if (!_examine.CanExamine(player.Value, targetPos, Predicate))
return false;
TryComp(player.Value, out ExaminerComponent? examiner);
entities = new();
foreach (var ent in _entityLookup.GetEntitiesInRange(targetPos, EntityMenuLookupSize))
{
- if (_examineSystem.CanExamine(player.Value, targetPos, Predicate, ent, examiner))
+ if (_examine.CanExamine(player.Value, targetPos, Predicate, ent, examiner))
entities.Add(ent);
}
}
{
var entity = entities[i];
- if (!ExamineSystemShared.InRangeUnOccluded(
+ if (!_examine.InRangeUnOccluded(
playerPos,
xformQuery.GetComponent(entity).MapPosition,
ExamineSystemShared.ExamineRange,
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly StationSystem _stations = default!;
[Dependency] private readonly StationSpawningSystem _spawning = default!;
+ [Dependency] private readonly ExamineSystemShared _examine = default!;
private readonly Dictionary<ICommonSession, List<EditSolutionsEui>> _openSolutionUis = new();
Act = () =>
{
- var message = ExamineSystemShared.InRangeUnOccluded(args.User, args.Target)
+ var message = _examine.InRangeUnOccluded(args.User, args.Target)
? Loc.GetString("in-range-unoccluded-verb-on-activate-not-occluded")
: Loc.GetString("in-range-unoccluded-verb-on-activate-occluded");
// Turns out: no they don't. Temporary debug checks to figure out which caller is causing problems:
if (tile == null)
{
- Logger.Error($"Encountered null-tile in {nameof(AdjustEqMovement)}. Trace: {Environment.StackTrace}");
+ Log.Error($"Encountered null-tile in {nameof(AdjustEqMovement)}. Trace: {Environment.StackTrace}");
return;
}
var adj = tile.AdjacentTiles[direction.ToIndex()];
if (adj == null)
{
var nonNull = tile.AdjacentTiles.Where(x => x != null).Count();
- Logger.Error($"Encountered null adjacent tile in {nameof(AdjustEqMovement)}. Dir: {direction}, Tile: {tile.Tile}, non-null adj count: {nonNull}, Trace: {Environment.StackTrace}");
+ Log.Error($"Encountered null adjacent tile in {nameof(AdjustEqMovement)}. Dir: {direction}, Tile: {tile.Tile}, non-null adj count: {nonNull}, Trace: {Environment.StackTrace}");
return;
}
var uid = args.SenderSession.AttachedEntity;
if (!Exists(uid))
{
- Logger.Warning($"Client {args.SenderSession} sent TypingChangedEvent without an attached entity.");
+ Log.Warning($"Client {args.SenderSession} sent TypingChangedEvent without an attached entity.");
return;
}
if (!gridId.HasValue)
{
- Logger.ErrorS("pirates", $"Gridid was null when loading \"{map}\", aborting.");
+ Log.Error($"Gridid was null when loading \"{map}\", aborting.");
foreach (var session in ops)
{
ev.PlayerPool.Add(session);
if (spawns.Count == 0)
{
spawns.Add(Transform(pirates.PirateShip).Coordinates);
- Logger.WarningS("pirates", $"Fell back to default spawn for pirates!");
+ Log.Warning($"Fell back to default spawn for pirates!");
}
for (var i = 0; i < ops.Length; i++)
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly SolutionContainerSystem _solutions = default!;
[Dependency] private readonly WeldableSystem _weldable = default!;
+ [Dependency] private readonly ExamineSystemShared _examine = default!;
private EntityQuery<PuddleComponent> _puddleQuery;
private EntityQuery<TransformComponent> _xformQuery;
{
var radius = blackboard.GetValueOrDefault<float>(NPCBlackboard.VisionRadius, EntityManager);
- return ExamineSystemShared.InRangeUnOccluded(owner, targetUid, radius + 0.5f, null) ? 1f : 0f;
+ return _examine.InRangeUnOccluded(owner, targetUid, radius + 0.5f, null) ? 1f : 0f;
}
case TargetInLOSOrCurrentCon:
{
return 1f;
}
- return ExamineSystemShared.InRangeUnOccluded(owner, targetUid, radius + bufferRange, null) ? 1f : 0f;
+ return _examine.InRangeUnOccluded(owner, targetUid, radius + bufferRange, null) ? 1f : 0f;
}
case TargetIsAliveCon:
{
[Dependency] private readonly VisibilitySystem _visibilitySystem = default!;
[Dependency] private readonly SharedMindSystem _minds = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
+ [Dependency] private readonly ExamineSystemShared _examine = default!;
private static readonly TimeSpan PointDelay = TimeSpan.FromSeconds(0.5f);
}
else
{
- return ExamineSystemShared.InRangeUnOccluded(pointer, coordinates, 15, predicate: e => e == pointer);
+ return _examine.InRangeUnOccluded(pointer, coordinates, 15, predicate: e => e == pointer);
}
}
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
[Dependency] private readonly DoorSystem _doorSystem = default!;
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
+ [Dependency] private readonly ExamineSystemShared _examine = default!;
// I'm so sorry [Dependency] private readonly SharedAirlockSystem _sharedAirlockSystem = default!;
public override void Initialize()
|| !TryComp<DoorComponent>(args.Target, out var doorComp) // If it isn't a door we don't use it
// Only able to control doors if they are within your vision and within your max range.
// Not affected by mobs or machines anymore.
- || !ExamineSystemShared.InRangeUnOccluded(args.User, args.Target.Value, SharedInteractionSystem.MaxRaycastRange, null))
+ || !_examine.InRangeUnOccluded(args.User, args.Target.Value, SharedInteractionSystem.MaxRaycastRange, null))
{
return;
}
// Since this is the first time opening this session, set up the game
tabletop.Setup.SetupTabletop(session, EntityManager);
- Logger.Info($"Created tabletop session number {tabletop} at position {session.Position}.");
+ Log.Info($"Created tabletop session number {tabletop} at position {session.Position}.");
return session;
}
return TryComp<EyeComponent>(uid, out var eye) && eye.DrawFov;
}
- public static bool InRangeUnOccluded(MapCoordinates origin, MapCoordinates other, float range, Ignored? predicate, bool ignoreInsideBlocker = true, IEntityManager? entMan = null)
+ public bool InRangeUnOccluded(MapCoordinates origin, MapCoordinates other, float range, Ignored? predicate, bool ignoreInsideBlocker = true, IEntityManager? entMan = null)
{
// No, rider. This is better.
// ReSharper disable once ConvertToLocalFunction
return InRangeUnOccluded(origin, other, range, predicate, wrapped, ignoreInsideBlocker, entMan);
}
- public static bool InRangeUnOccluded<TState>(MapCoordinates origin, MapCoordinates other, float range,
+ public bool InRangeUnOccluded<TState>(MapCoordinates origin, MapCoordinates other, float range,
TState state, Func<EntityUid, TState, bool> predicate, bool ignoreInsideBlocker = true, IEntityManager? entMan = null)
{
if (other.MapId != origin.MapId ||
if (length > MaxRaycastRange)
{
- Logger.Warning("InRangeUnOccluded check performed over extreme range. Limiting CollisionRay size.");
+ Log.Warning("InRangeUnOccluded check performed over extreme range. Limiting CollisionRay size.");
length = MaxRaycastRange;
}
return true;
}
- public static bool InRangeUnOccluded(EntityUid origin, EntityUid other, float range = ExamineRange, Ignored? predicate = null, bool ignoreInsideBlocker = true)
+ public bool InRangeUnOccluded(EntityUid origin, EntityUid other, float range = ExamineRange, Ignored? predicate = null, bool ignoreInsideBlocker = true)
{
var entMan = IoCManager.Resolve<IEntityManager>();
var originPos = entMan.GetComponent<TransformComponent>(origin).MapPosition;
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
}
- public static bool InRangeUnOccluded(EntityUid origin, EntityCoordinates other, float range = ExamineRange, Ignored? predicate = null, bool ignoreInsideBlocker = true)
+ public bool InRangeUnOccluded(EntityUid origin, EntityCoordinates other, float range = ExamineRange, Ignored? predicate = null, bool ignoreInsideBlocker = true)
{
var entMan = IoCManager.Resolve<IEntityManager>();
var originPos = entMan.GetComponent<TransformComponent>(origin).MapPosition;
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
}
- public static bool InRangeUnOccluded(EntityUid origin, MapCoordinates other, float range = ExamineRange, Ignored? predicate = null, bool ignoreInsideBlocker = true)
+ public bool InRangeUnOccluded(EntityUid origin, MapCoordinates other, float range = ExamineRange, Ignored? predicate = null, bool ignoreInsideBlocker = true)
{
var entMan = IoCManager.Resolve<IEntityManager>();
var originPos = entMan.GetComponent<TransformComponent>(origin).MapPosition;