From 95e1b44dce9cb8e33c5f58336c2d2bf14a3fb1fa Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 21 Jun 2026 20:48:43 +0100 Subject: [PATCH] Use runtime catalog for observed UI item metadata --- Aetheria.State.Verify/Program.cs | 12 +++++++++++- Assets/Scripts/Gameplay/ActionGameManager.cs | 9 +++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index eb48fb966..04c11ced7 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -8134,7 +8134,11 @@ static void RequireMainMenuContinueRunState(string root) "ObservedAvailableEntities(", "TryGetObservedCurrentEntity(out var currentEntity)", "parentSnapshot.ChildEntityIndices", - "TryGetObservedEntityFacade(childEntityIndex, out var entity)" + "TryGetObservedEntityFacade(childEntityIndex, out var entity)", + "FindTypedRuntimeItem(", + "RuntimeCatalog?.FindItem(item?.ItemKey ?? \"\")", + "var typedItem = FindTypedRuntimeItem(item?.EquippableItem)", + "var targetHull = FindTypedRuntimeItem(target.Hull)" }; if (actionGameManager.Contains("_authoritativeDaemonEntities", StringComparison.Ordinal)) @@ -8143,6 +8147,12 @@ static void RequireMainMenuContinueRunState(string root) "Unity entity wrappers are observed daemon facades, not authoritative state; keep the daemon as authority."); } + if (actionGameManager.Contains("ItemManager.GetRuntimeItem", StringComparison.Ordinal)) + { + throw new InvalidOperationException( + "ActionGameManager still resolves item metadata through Unity ItemManager instead of the runtime catalog."); + } + var missingGameplaySymbols = requiredGameplaySymbols .Where(symbol => !actionGameManager.Contains(symbol, StringComparison.Ordinal)) .ToArray(); diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index 88528534a..f11b42685 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -920,6 +920,11 @@ public class ActionGameManager : MonoBehaviour } private AetheriaRuntimeCatalogItem FindTypedActionBarItem(ItemInstance item) + { + return FindTypedRuntimeItem(item); + } + + private static AetheriaRuntimeCatalogItem FindTypedRuntimeItem(ItemInstance item) { return RuntimeCatalog?.FindItem(item?.ItemKey ?? ""); } @@ -3480,7 +3485,7 @@ public class ActionGameManager : MonoBehaviour private bool HasArticulatedWeaponBehavior(EquippedItem item) { - var typedItem = ItemManager.GetRuntimeItem(item.EquippableItem); + var typedItem = FindTypedRuntimeItem(item?.EquippableItem); return typedItem?.BehaviorKinds.Any(ArticulatedWeaponBehaviorKinds.Contains) == true; } @@ -3622,7 +3627,7 @@ public class ActionGameManager : MonoBehaviour var visibilityToTarget = GetObservedInfoGathered(target, CurrentEntity); TargetVisibilityFill.fillAmount = Mathf.Lerp(.25f, .75f, (targetInfoGathered - threshold) / (1 - threshold)); VisibilityToTargetFill.fillAmount = Mathf.Lerp(.25f, .75f, visibilityToTarget / threshold); - var targetHull = ItemManager.GetRuntimeItem(target.Hull); + var targetHull = FindTypedRuntimeItem(target.Hull); var targetMaxDurability = targetHull?.Durability > 0 ? (float)targetHull.Durability : Math.Max(target.Hull.Durability, 1f);