Pausing content (#3061)

* Change EntityQuery to not retrieve paused by default

* GetAllComponents

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2021-02-04 00:20:48 +11:00
committed by GitHub
parent c40ac26ced
commit 684ec60be6
65 changed files with 69 additions and 71 deletions

View File

@@ -52,7 +52,7 @@ namespace Content.Client.Commands
.EnableAll = true;
var components = IoCManager.Resolve<IEntityManager>().ComponentManager
.EntityQuery<SubFloorHideComponent>();
.EntityQuery<SubFloorHideComponent>(true);
foreach (var component in components)
{

View File

@@ -17,7 +17,7 @@ namespace Content.Client.Commands
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
var componentManager = IoCManager.Resolve<IComponentManager>();
var mechanisms = componentManager.EntityQuery<IMechanism>();
var mechanisms = componentManager.EntityQuery<IMechanism>(true);
foreach (var mechanism in mechanisms)
{

View File

@@ -19,7 +19,7 @@ namespace Content.Client.Commands
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
var componentManager = IoCManager.Resolve<IComponentManager>();
var mechanisms = componentManager.EntityQuery<IMechanism>();
var mechanisms = componentManager.EntityQuery<IMechanism>(true);
foreach (var mechanism in mechanisms)
{

View File

@@ -46,7 +46,7 @@ namespace Content.Client.GameObjects.Components.Observer
private void SetGhostVisibility(bool visibility)
{
foreach (var ghost in _componentManager.GetAllComponents(typeof(GhostComponent)))
foreach (var ghost in _componentManager.GetAllComponents(typeof(GhostComponent), true))
{
if (ghost.Owner.TryGetComponent(out SpriteComponent? component))
{

View File

@@ -11,7 +11,7 @@ namespace Content.Client.GameObjects.EntitySystems
{
base.FrameUpdate(frameTime);
foreach (var recoil in EntityManager.ComponentManager.EntityQuery<CameraRecoilComponent>())
foreach (var recoil in EntityManager.ComponentManager.EntityQuery<CameraRecoilComponent>(true))
{
recoil.FrameUpdate(frameTime);
}

View File

@@ -61,7 +61,7 @@ namespace Content.Client.GameObjects.EntitySystems.DoAfter
if (_attachedEntity == null || _attachedEntity.Deleted)
return;
foreach (var comp in ComponentManager.EntityQuery<DoAfterComponent>())
foreach (var comp in ComponentManager.EntityQuery<DoAfterComponent>(true))
{
if (!_knownComponents.Contains(comp))
{

View File

@@ -44,7 +44,7 @@ namespace Content.Client.GameObjects.EntitySystems
return;
}
foreach (var instrumentComponent in EntityManager.ComponentManager.EntityQuery<InstrumentComponent>())
foreach (var instrumentComponent in EntityManager.ComponentManager.EntityQuery<InstrumentComponent>(true))
{
instrumentComponent.Update(frameTime);
}

View File

@@ -19,7 +19,7 @@ namespace Content.Client.GameObjects.EntitySystems
private void UpdateMarkers()
{
foreach (var markerComponent in EntityManager.ComponentManager.EntityQuery<MarkerComponent>())
foreach (var markerComponent in EntityManager.ComponentManager.EntityQuery<MarkerComponent>(true))
{
markerComponent.UpdateVisibility();
}

View File

@@ -11,7 +11,7 @@ namespace Content.Client.GameObjects.EntitySystems
{
base.FrameUpdate(frameTime);
foreach (var meleeLungeComponent in EntityManager.ComponentManager.EntityQuery<MeleeLungeComponent>())
foreach (var meleeLungeComponent in EntityManager.ComponentManager.EntityQuery<MeleeLungeComponent>(true))
{
meleeLungeComponent.Update(frameTime);
}

View File

@@ -34,7 +34,7 @@ namespace Content.Client.GameObjects.EntitySystems
{
base.FrameUpdate(frameTime);
foreach (var arcAnimationComponent in EntityManager.ComponentManager.EntityQuery<MeleeWeaponArcAnimationComponent>())
foreach (var arcAnimationComponent in EntityManager.ComponentManager.EntityQuery<MeleeWeaponArcAnimationComponent>(true))
{
arcAnimationComponent.Update(frameTime);
}

View File

@@ -35,7 +35,7 @@ namespace Content.Client.GameObjects.EntitySystems
private void UpdateAll()
{
foreach (var comp in EntityManager.ComponentManager.EntityQuery<SubFloorHideComponent>())
foreach (var comp in EntityManager.ComponentManager.EntityQuery<SubFloorHideComponent>(true))
{
if (!_mapManager.TryGetGrid(comp.Owner.Transform.GridID, out var grid)) return;

View File

@@ -124,7 +124,7 @@ namespace Content.Client.StationEvents
_lastTick = _gameTiming.CurTime;
var radiationPulses = _componentManager
.EntityQuery<RadiationPulseComponent>()
.EntityQuery<RadiationPulseComponent>(true)
.ToList();
var screenHandle = (DrawingHandleScreen) handle;