Gate current observer UI from daemon relationships

This commit is contained in:
Meta Vens 2026-06-21 18:23:30 +01:00
commit be3cb4e41a
2 changed files with 14 additions and 4 deletions

View file

@ -7784,6 +7784,7 @@ static void RequireMainMenuContinueRunState(string root)
"RestoreDroppedPickupsFromDaemonZoneState",
"TryGetDaemonEntitySnapshot(",
"TryGetDaemonParentSnapshot(",
"IsCurrentEntityObservedUndocked(",
"parentSnapshot.DockingBayAssignments",
"dockedEntitySnapshot.ChildEntityIndices",
"TryGetObservedEntityFacade(childEntityIndex, out var entity)"
@ -7825,7 +7826,10 @@ static void RequireMainMenuContinueRunState(string root)
"TargetIndicator.Target = CurrentEntity.Target.Value.Position",
"indicator.Target = CurrentEntity.Target.Value.Position",
"foreach (var bay in CurrentEntity.Parent.DockingBays)",
"foreach (var entity in DockedEntity.Children)"
"foreach (var entity in DockedEntity.Children)",
"CurrentEntity != null && CurrentEntity.Parent == null",
"CurrentEntity !=null && CurrentEntity.Parent==null",
"CurrentEntity == null || CurrentEntity.Parent != null"
};
var forbiddenGameplayHits = forbiddenGameplaySymbols

View file

@ -2170,7 +2170,7 @@ public class ActionGameManager : MonoBehaviour
if (Menu.gameObject.activeSelf && Menu.CurrentTab == tab)
{
Menu.gameObject.SetActive(false);
if (CurrentEntity != null && CurrentEntity.Parent == null)
if (IsCurrentEntityObservedUndocked())
{
EnablePlayerInput();
UpdatePlayerPanel();
@ -3192,6 +3192,12 @@ public class ActionGameManager : MonoBehaviour
return false;
}
private bool IsCurrentEntityObservedUndocked()
{
return TryGetDaemonEntitySnapshot(CurrentEntity, out _) &&
!TryGetDaemonParentSnapshot(CurrentEntity, out _, out _);
}
private bool TryQueryDaemonEntityContact(
Entity observer,
Entity target,
@ -3558,7 +3564,7 @@ public class ActionGameManager : MonoBehaviour
_hitMarkerTime -= Time.deltaTime;
if(HitMarker.activeSelf && _hitMarkerTime < 0) HitMarker.SetActive(false);
// ItemManager.Time = _time;
if(CurrentEntity !=null && CurrentEntity.Parent==null)
if(IsCurrentEntityObservedUndocked())
{
var observedTarget = GetObservedTarget(CurrentEntity);
ReconcileVisibleTargetIndicators();
@ -4163,7 +4169,7 @@ public class ActionGameManager : MonoBehaviour
private void UpdateTargetIndicators()
{
if (CurrentEntity == null || CurrentEntity.Parent != null) return;
if (!IsCurrentEntityObservedUndocked()) return;
if (!ZoneRenderer.TryGetEntityInstance(CurrentEntity, out var entityInstance))
return;