From 089266d9326fdedf44af5a7d1a31c42f7932d6c7 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 14 Jun 2026 00:14:12 +0100 Subject: [PATCH] Use typed catalog facts in properties panel --- .voidbot/state/aetheria.cc | Bin 54227 -> 54483 bytes .../UI/Properties Panel/PropertiesPanel.cs | 30 +++++++++++++++--- docs/aetheria-perfect-machine-map.md | 4 +++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index d6c673a77424369426bc3e3a6a653ad42c83fb1a..dfe48b88ef372b740da3d4c412cb5f9ea6073370 100644 GIT binary patch delta 1049 zcmaizy=xRf6u`Y)2>GxORE$L7Nr*Pdc^?TOu@a&ZEQ}HZ2AjFvcekUnJIl;$;#F5z zTj*k=A_Nnnf|#(Kh=K@y6&9%?7XAyCV&j{;&FzVW-R_&+dB692@9k{ncb?_9)_aC3 zv!&u}rBaxgEXO}S9E-p7+}_`bO_i7L<_^a)e=Chm7K-JmR;<7Gczvrt8XL~v1{;X&P+Om*A0POCH7 za4@tspHp3)R9CR3zwaAKET_D*U(;r1*h*=-wXxo(W)>^AHaqG6{C1!#IKBJ_!4H2^ delta 903 zcmZvb&ubGw6vs_dq_H9%6sst{gLtZG6Eu)|vAf7$Q zUPVM(s)G1qJqgl-7i}*>FIGJGZ+P>~Hb2_pX?MS~^WNwCer&(aZ?EUyuZ~TY=dM)e z%Cp5%wUqq%b~f1>dvtW9Rq9W2Clj52Fx1MkrA(U`KbQNOUL61Ybm8GmtsO)>SdJrz z3|dre%_@KqLKrk+M;<{G2h$=*b26RVRSm8Ei0=Tk{QKpPx8XB?d=O5&yV~4v} zLZc&(mL(eS%&4A+X|ljs=(JG*TVY(VhQQ*wLuCnLXZ4zvQit4i2iA$pdb8GXAt2B` zgwb+ndzUM~jK)r9uKPYm_AD5btj86l7ox#}WoT*xl3UAFYfwlk6OihE<;v@p%UEQF zFKH#Z5TYYuTl_#Ch_)sp!O5Nne{nr_u|Zg>?Qd2PlUv)?u?V5Jj2MB`D?TBQDXVUJj?{{vQXNaz3n 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