Project current zone from daemon run

This commit is contained in:
Meta Vens 2026-06-21 17:10:27 +01:00
commit 0a21e44f54
4 changed files with 38 additions and 10 deletions

View file

@ -7932,6 +7932,7 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root)
"ApplyLatestAuthoritativeDaemonFrame()",
"ResolveDaemonObserver()",
"public AetheriaRuntimeZoneSnapshotCommit FindDaemonZoneSnapshot(GalaxyZone zone)",
"public GalaxyZone CurrentDaemonGalaxyZone",
"observed.IsAuthoritative",
"TryRestoreEntityGraphFromDaemonRun(observed.Run)",
"CreateDaemonZoneConstructionBlueprint(daemonZone)",
@ -7962,6 +7963,23 @@ static void RequireUnityObserverDoesNotTickLocalSimulation(string root)
string.Join(", ", missingGameplaySymbols));
}
var mapRendererPath = Path.Combine(root, "Assets", "Scripts", "UI", "Menu", "MapRenderer.cs");
var mapRenderer = File.Exists(mapRendererPath)
? File.ReadAllText(mapRendererPath)
: throw new InvalidOperationException("Cannot verify daemon current-zone UI projection; MapRenderer.cs is missing.");
var sectorRendererPath = Path.Combine(root, "Assets", "Scripts", "UI", "Menu", "SectorRenderer.cs");
var sectorRenderer = File.Exists(sectorRendererPath)
? File.ReadAllText(sectorRendererPath)
: throw new InvalidOperationException("Cannot verify daemon current-zone UI projection; SectorRenderer.cs is missing.");
if (mapRenderer.Contains("GameManager.Zone.GalaxyZone", StringComparison.Ordinal) ||
sectorRenderer.Contains("GameManager.Zone.GalaxyZone", StringComparison.Ordinal) ||
sectorRenderer.Contains("GameManager.CurrentEntity.Zone.GalaxyZone", StringComparison.Ordinal))
{
throw new InvalidOperationException(
"Map and sector UI must read current-zone identity from the daemon-observed run, not Unity's mirrored Zone hierarchy.");
}
var requiredDaemonControlValidationSymbols = new[]
{
"case AetheriaRuntimeDaemonCommandKinds.SetTractorPower:",

View file

@ -861,6 +861,19 @@ public class ActionGameManager : MonoBehaviour
.FirstOrDefault(snapshot => snapshot != null && snapshot.ZoneIndex == zoneIndex);
}
public GalaxyZone CurrentDaemonGalaxyZone
{
get
{
var run = ResolveDaemonObserver()?.LastObservedState?.Run;
return run?.CurrentZoneIndex >= 0 &&
ObservedGalaxy?.Zones != null &&
run.CurrentZoneIndex < ObservedGalaxy.Zones.Length
? ObservedGalaxy.Zones[run.CurrentZoneIndex]
: null;
}
}
private static int FactionIndex(Faction faction)
{
return ObservedGalaxy?.Factions == null || faction == null ? -1 : Array.IndexOf(ObservedGalaxy.Factions, faction);
@ -3117,13 +3130,7 @@ public class ActionGameManager : MonoBehaviour
private AetheriaRuntimeZoneSnapshotCommit FindCurrentDaemonZoneSnapshot()
{
var run = ResolveDaemonObserver()?.LastObservedState?.Run;
var zone = run?.CurrentZoneIndex >= 0 &&
ActionGameManager.ObservedGalaxy?.Zones != null &&
run.CurrentZoneIndex < ActionGameManager.ObservedGalaxy.Zones.Length
? ActionGameManager.ObservedGalaxy.Zones[run.CurrentZoneIndex]
: null;
return FindDaemonZoneSnapshot(zone);
return FindDaemonZoneSnapshot(CurrentDaemonGalaxyZone);
}
public void RequestTowToStation()

View file

@ -49,7 +49,8 @@ public class MapRenderer : MonoBehaviour
GravityCamera.gameObject.SetActive(true);
TintCamera.gameObject.SetActive(true);
InfluenceCamera.gameObject.SetActive(true);
Title.text = $"Zone: {GameManager.Zone.GalaxyZone.Name}";
var currentZone = GameManager.CurrentDaemonGalaxyZone;
Title.text = $"Zone: {currentZone?.Name ?? "Unknown"}";
// If hiding minimap asteroids, turn them back on for the map screen
if (!ActionGameManager.RuntimePlayerSettings.GraphicsSettings.ShowAsteroidsInMinimap)

View file

@ -223,11 +223,13 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
{
_init = true;
SectorCamera.gameObject.SetActive(true);
_position = GameManager.Zone.GalaxyZone.Position;
var currentZone = GameManager.CurrentDaemonGalaxyZone;
_position = currentZone?.Position ?? float2.zero;
_viewSize = .25f;
Map.StartReveal(LinkAnimationDuration, IconAnimationDuration);
Map.MarkPlayerLocation(GameManager.CurrentEntity.Zone.GalaxyZone);
if (currentZone != null)
Map.MarkPlayerLocation(currentZone);
}
private void OnDisable()