Inline UID
This commit is contained in:
@@ -51,7 +51,7 @@ namespace Content.Client.DoAfter
|
||||
var currentTime = _gameTiming.CurTime;
|
||||
|
||||
// Can't see any I guess?
|
||||
if (_attachedEntity == null || (!IoCManager.Resolve<IEntityManager>().EntityExists(_attachedEntity.Uid) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(_attachedEntity.Uid).EntityLifeStage) >= EntityLifeStage.Deleted)
|
||||
if (_attachedEntity == null || (!IoCManager.Resolve<IEntityManager>().EntityExists(_attachedEntity) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(_attachedEntity).EntityLifeStage) >= EntityLifeStage.Deleted)
|
||||
return;
|
||||
|
||||
var viewbox = _eyeManager.GetWorldViewport().Enlarged(2.0f);
|
||||
@@ -59,23 +59,23 @@ namespace Content.Client.DoAfter
|
||||
foreach (var comp in EntityManager.EntityQuery<DoAfterComponent>(true))
|
||||
{
|
||||
var doAfters = comp.DoAfters.ToList();
|
||||
var compPos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(comp.Owner.Uid).WorldPosition;
|
||||
var compPos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(comp.Owner).WorldPosition;
|
||||
|
||||
if (doAfters.Count == 0 ||
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(comp.Owner.Uid).MapID != IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_attachedEntity.Uid).MapID ||
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(comp.Owner).MapID != IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_attachedEntity).MapID ||
|
||||
!viewbox.Contains(compPos))
|
||||
{
|
||||
comp.Disable();
|
||||
continue;
|
||||
}
|
||||
|
||||
var range = (compPos - IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_attachedEntity.Uid).WorldPosition).Length +
|
||||
var range = (compPos - IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_attachedEntity).WorldPosition).Length +
|
||||
0.01f;
|
||||
|
||||
if (comp.Owner != _attachedEntity &&
|
||||
!ExamineSystemShared.InRangeUnOccluded(
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_attachedEntity.Uid).MapPosition,
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(comp.Owner.Uid).MapPosition, range,
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_attachedEntity).MapPosition,
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(comp.Owner).MapPosition, range,
|
||||
entity => entity == comp.Owner || entity == _attachedEntity))
|
||||
{
|
||||
comp.Disable();
|
||||
@@ -84,7 +84,7 @@ namespace Content.Client.DoAfter
|
||||
|
||||
comp.Enable();
|
||||
|
||||
var userGrid = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(comp.Owner.Uid).Coordinates;
|
||||
var userGrid = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(comp.Owner).Coordinates;
|
||||
|
||||
// Check cancellations / finishes
|
||||
foreach (var (id, doAfter) in doAfters)
|
||||
@@ -117,7 +117,7 @@ namespace Content.Client.DoAfter
|
||||
if (doAfter.BreakOnTargetMove)
|
||||
{
|
||||
if (EntityManager.TryGetEntity(doAfter.TargetUid, out var targetEntity) &&
|
||||
!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(targetEntity.Uid).Coordinates.InRange(EntityManager, doAfter.TargetGrid,
|
||||
!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(targetEntity).Coordinates.InRange(EntityManager, doAfter.TargetGrid,
|
||||
doAfter.MovementThreshold))
|
||||
{
|
||||
comp.Cancel(id, currentTime);
|
||||
|
||||
@@ -149,11 +149,11 @@ namespace Content.Client.DoAfter.UI
|
||||
IEntity? tempQualifier = AttachedEntity;
|
||||
if (tempQualifier != null)
|
||||
{
|
||||
IoCManager.Resolve<IEntityManager>().EntityExists(tempQualifier.Uid);
|
||||
IoCManager.Resolve<IEntityManager>().EntityExists(tempQualifier);
|
||||
}
|
||||
|
||||
if (RETURNED_VALUE != true ||
|
||||
!IoCManager.Resolve<IEntityManager>().TryGetComponent(AttachedEntity.Uid, out DoAfterComponent? doAfterComponent))
|
||||
!IoCManager.Resolve<IEntityManager>().TryGetComponent(AttachedEntity, out DoAfterComponent? doAfterComponent))
|
||||
{
|
||||
Visible = false;
|
||||
return;
|
||||
@@ -166,8 +166,8 @@ namespace Content.Client.DoAfter.UI
|
||||
return;
|
||||
}
|
||||
|
||||
if (_eyeManager.CurrentMap != IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(AttachedEntity.Uid).MapID ||
|
||||
!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(AttachedEntity.Uid).Coordinates.IsValid(_entityManager))
|
||||
if (_eyeManager.CurrentMap != IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(AttachedEntity).MapID ||
|
||||
!IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(AttachedEntity).Coordinates.IsValid(_entityManager))
|
||||
{
|
||||
Visible = false;
|
||||
return;
|
||||
@@ -217,7 +217,7 @@ namespace Content.Client.DoAfter.UI
|
||||
RemoveDoAfter(id);
|
||||
}
|
||||
|
||||
var screenCoordinates = _eyeManager.CoordinatesToScreen(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(AttachedEntity.Uid).Coordinates);
|
||||
var screenCoordinates = _eyeManager.CoordinatesToScreen(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(AttachedEntity).Coordinates);
|
||||
_playerPosition = new ScreenCoordinates(screenCoordinates.Position / UIScale, screenCoordinates.Window);
|
||||
LayoutContainer.SetPosition(this, new Vector2(_playerPosition.X - Width / 2, _playerPosition.Y - Height - 30.0f));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user