diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index d6c673a77..dfe48b88e 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs index eeb854261..0f134fb64 100644 --- a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs +++ b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Reflection; +using GameCult.Aetheria.State.Unity; using TMPro; using UniRx; using UnityEngine; @@ -370,21 +371,42 @@ public class PropertiesPanel : MonoBehaviour private void AddItemProperties(ItemInstance item) { - var data = GameManager.ItemManager.GetData(item); + var typedItem = FindTypedPropertyItem(item); + var data = typedItem == null ? GameManager.ItemManager.GetData(item) : null; - AddProperty(data.Description); + AddProperty(typedItem?.Description ?? data.Description); if (item is SimpleCommodity simpleCommodity) AddProperty("Quantity", () => simpleCommodity.Quantity.ToString()); var sheet = AddStatSheet(); - var manufacturer = ActionGameManager.RuntimeCatalog?.FindCorporationByLegacyId(data.Manufacturer.ToString()); + var manufacturer = typedItem != null + ? ActionGameManager.RuntimeCatalog?.GetManufacturer(typedItem) + : ActionGameManager.RuntimeCatalog?.FindCorporationByLegacyId(data.Manufacturer.ToString()); sheet.AddStat("Manufacturer", () => manufacturer?.Name ?? "GameCult"); - sheet.AddStat("Mass", () => ActionGameManager.RuntimePlayerSettings.Format(GameManager.ItemManager.GetMass(item))); + sheet.AddStat("Mass", () => ActionGameManager.RuntimePlayerSettings.Format(GetTypedMass(item, typedItem))); //AddProperty("Thermal Mass", () => Context.GetThermalMass(item).SignificantDigits(Context.GameplaySettings.SignificantDigits)); } + private float GetTypedMass(ItemInstance item, AetheriaRuntimeCatalogItem typedItem) + { + if (typedItem == null) + return GameManager.ItemManager.GetMass(item); + + return item is SimpleCommodity simpleCommodity + ? (float)typedItem.Mass * simpleCommodity.Quantity + : (float)typedItem.Mass; + } + + private static AetheriaRuntimeCatalogItem FindTypedPropertyItem(ItemInstance item) + { + var itemId = item?.Data?.ItemId ?? Guid.Empty; + return itemId == Guid.Empty + ? null + : ActionGameManager.RuntimeCatalog?.FindItemByLegacyId(itemId.ToString("D")); + } + private void AddEquippableItemProperties(EquippableItem item, Func statValueFunction) { if (item.Durability < .01f) diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index fec131cf9..907eb1bd9 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -138,6 +138,10 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. falling back to legacy `HullData` projection for missing rows. Loot pickup presentation now uses typed catalog category/name rows to choose weapon-vs-gear pickup visuals and scan labels before falling back to legacy item projections. + The item properties panel also reads typed catalog description, manufacturer, + and base mass for item presentation before hydrating legacy DTOs for behavior + reflection, thermal curves, and durability math that have not yet moved to + typed behavior surfaces. - `Galaxy` generation no longer accepts a runtime item catalog reader or `ItemManager`. Sector and tutorial generation receive the package-owned typed runtime catalog. `Galaxy` projects typed corporation v2 records into temporary legacy