Use Aetheria state handles for current entity UI reads

This commit is contained in:
Meta Vens 2026-06-27 13:58:42 +01:00
commit 2884cef870
4 changed files with 37 additions and 10 deletions

View file

@ -66,7 +66,11 @@ Assert-NotContains $sectorMap "GalaxyZone" "SectorMap must not retain the legacy
Assert-NotContains $sectorMap "Dictionary<Faction" "SectorMap must not retain legacy Faction graph materials."
$inventoryPanel = Read-Text "Assets\Scripts\UI\Menu\InventoryPanel.cs"
Assert-Contains $inventoryPanel "CurrentEntityAsync" "InventoryPanel current-subject UI must read the typed current-entity facade."
Assert-Contains $inventoryPanel ".Aetheria()" "InventoryPanel current-subject UI must enter state through the semantic Aetheria facade."
Assert-Contains $inventoryPanel ".Current" "InventoryPanel current-subject UI must read the current-state facade."
Assert-Contains $inventoryPanel ".Entity" "InventoryPanel current-subject UI must read the typed current-entity document handle."
Assert-Contains $inventoryPanel ".LatestAsync()" "InventoryPanel current-subject UI must read a typed current-entity snapshot."
Assert-NotContains $inventoryPanel ".CurrentEntityAsync()" "InventoryPanel current-subject UI must not use the transitional current-entity helper."
Assert-Contains $inventoryPanel "CurrentDockingAsync" "InventoryPanel dropdown docking access must read the typed current-docking facade."
Assert-Contains $inventoryPanel "StationRefitAsync" "InventoryPanel dropdown entity options must read the typed station-refit facade."
Assert-Contains $inventoryPanel "LoadoutRestoreOptions" "InventoryPanel loadout dropdown must read typed station-refit restore options."
@ -97,7 +101,11 @@ Assert-Contains $inventoryDropdownSurface "public string EntityKey { get; }" "In
Assert-Contains $inventoryDropdownSurface "entityKey: entity.EntityKey" "Inventory dropdown surface builder must copy typed entity identity into selections."
$inventoryMenu = Read-Text "Assets\Scripts\UI\Menu\InventoryMenu.cs"
Assert-Contains $inventoryMenu "CurrentEntityAsync" "InventoryMenu ship-settings commands must guard against the typed current-entity facade."
Assert-Contains $inventoryMenu ".Aetheria()" "InventoryMenu ship-settings commands must enter state through the semantic Aetheria facade."
Assert-Contains $inventoryMenu ".Current" "InventoryMenu ship-settings commands must read the current-state facade."
Assert-Contains $inventoryMenu ".Entity" "InventoryMenu ship-settings commands must read the typed current-entity document handle."
Assert-Contains $inventoryMenu ".LatestAsync()" "InventoryMenu ship-settings commands must read a typed current-entity snapshot."
Assert-NotContains $inventoryMenu ".CurrentEntityAsync()" "InventoryMenu ship-settings commands must not use the transitional current-entity helper."
Assert-Contains $inventoryMenu "TryResolveCurrentEntityDocument" "InventoryMenu ship-settings state must read the typed current-entity document."
Assert-Contains $inventoryMenu "_shipSettingsCurrentEntity" "InventoryMenu ship-settings surface must retain typed current-entity state."
Assert-Contains $inventoryMenu "latestCurrentEntity.ShutdownPerformance" "InventoryMenu ship-settings surface must use typed shutdown-performance projection."
@ -212,7 +220,11 @@ Assert-Contains $schematicDisplay "public void SetRenderSettings(AetheriaRuntime
Assert-Contains $schematicDisplay "_renderSettings?.NormalizeThermalRisk(" "SchematicDisplay must normalize thermal risk through injected daemon render settings."
Assert-Contains $schematicDisplay "private AetheriaRuntimeCurrentEntityDocument _currentEntityDocument;" "SchematicDisplay must cache the typed current-entity HUD document."
Assert-Contains $schematicDisplay "ResolveCurrentEntityHudStatus()" "SchematicDisplay must read player HUD facts from typed current-entity state."
Assert-Contains $schematicDisplay ".CurrentEntityAsync()" "SchematicDisplay must read current entity HUD status through AetheriaClient."
Assert-Contains $schematicDisplay ".Aetheria()" "SchematicDisplay must enter current entity HUD state through the semantic Aetheria facade."
Assert-Contains $schematicDisplay ".Current" "SchematicDisplay must read current entity HUD state from the current-state facade."
Assert-Contains $schematicDisplay ".Entity" "SchematicDisplay must read current entity HUD state from the typed entity document handle."
Assert-Contains $schematicDisplay ".LatestAsync()" "SchematicDisplay must read current entity HUD status through a typed document handle."
Assert-NotContains $schematicDisplay ".CurrentEntityAsync()" "SchematicDisplay must not use the transitional current-entity helper."
Assert-Contains $schematicDisplay "hud.OverrideShutdown" "SchematicDisplay must render override shutdown from typed HUD state."
Assert-Contains $schematicDisplay "hud.HeatsinksEnabled" "SchematicDisplay must render heatsink status from typed HUD state."
Assert-Contains $schematicDisplay "hud.Heatstroke" "SchematicDisplay must render heatstroke from typed HUD state."

View file

@ -73,7 +73,7 @@ public class SchematicDisplay : MonoBehaviour
private string _clientStatePath = "";
private AetheriaRuntimeCatalogSnapshot _catalog;
private AetheriaRuntimePlayerSettingsSnapshot _playerSettings;
private AetheriaRuntimeDaemonRenderSettings _renderSettings;
private AetheriaRuntimeDaemonRenderSettings? _renderSettings;
private AetheriaRuntimeCurrentEntityDocument _currentEntityDocument;
private float _currentEntityDocumentReadTime = float.NegativeInfinity;
private const float CurrentEntityHudRefreshIntervalSeconds = 0.1f;
@ -210,7 +210,7 @@ public class SchematicDisplay : MonoBehaviour
HeatstrokeMeterFill.anchorMax = new Vector2((float)hud.Heatstroke, 1);
HypothermiaMeterFill.anchorMax = new Vector2((float)hud.Hypothermia, 1);
HeatstrokeLimitFill.anchorMax = new Vector2(
(float)(_renderSettings.NormalizeThermalRisk(_cockpit.Item.Temperature)),
(float)(_renderSettings?.NormalizeThermalRisk(_cockpit.Item.Temperature) ?? 0.0),
1);
}
@ -367,7 +367,10 @@ public class SchematicDisplay : MonoBehaviour
try
{
_currentEntityDocument = ResolveClient()
.CurrentEntityAsync()
.Aetheria()
.Current
.Entity
.LatestAsync()
.GetAwaiter()
.GetResult();
}

View file

@ -784,7 +784,10 @@ public class InventoryMenu : MonoBehaviour
try
{
currentEntity = ResolveClient()
.CurrentEntityAsync()
.Aetheria()
.Current
.Entity
.LatestAsync()
.GetAwaiter()
.GetResult();
}
@ -866,7 +869,10 @@ public class InventoryMenu : MonoBehaviour
try
{
var current = ResolveClient()
.CurrentEntityAsync()
.Aetheria()
.Current
.Entity
.LatestAsync()
.GetAwaiter()
.GetResult();
if (current != null && string.Equals(current.EntityKey, entityKey, StringComparison.Ordinal))

View file

@ -1136,7 +1136,10 @@ private void Update()
try
{
currentEntityKey = ResolveClient()
.CurrentEntityAsync()
.Aetheria()
.Current
.Entity
.LatestAsync()
.GetAwaiter()
.GetResult()
?.EntityKey ?? "";
@ -1287,7 +1290,10 @@ private void Update()
try
{
var current = ResolveClient()
.CurrentEntityAsync()
.Aetheria()
.Current
.Entity
.LatestAsync()
.GetAwaiter()
.GetResult();
if (current != null && string.Equals(current.EntityKey, entityKey, StringComparison.Ordinal))