Use typed fields for properties presentation

This commit is contained in:
Meta Vens 2026-06-14 02:35:36 +01:00
commit 9cbd9eaa2a
3 changed files with 11 additions and 12 deletions

Binary file not shown.

View file

@ -372,17 +372,14 @@ public class PropertiesPanel : MonoBehaviour
private void AddItemProperties(ItemInstance item)
{
var typedItem = FindTypedPropertyItem(item);
var data = typedItem == null ? GameManager.ItemManager.GetData(item) : null;
AddProperty(typedItem?.Description ?? data.Description);
AddProperty(typedItem?.Description ?? "No typed item description is available.");
if (item is SimpleCommodity simpleCommodity)
AddProperty("Quantity", () => simpleCommodity.Quantity.ToString());
var sheet = AddStatSheet();
var manufacturer = typedItem != null
? ActionGameManager.RuntimeCatalog?.GetManufacturer(typedItem)
: ActionGameManager.RuntimeCatalog?.FindCorporationByLegacyId(data.Manufacturer.ToString());
var manufacturer = typedItem != null ? ActionGameManager.RuntimeCatalog?.GetManufacturer(typedItem) : null;
sheet.AddStat("Manufacturer", () => manufacturer?.Name ?? "GameCult");
sheet.AddStat("Mass", () => ActionGameManager.RuntimePlayerSettings.Format(GetTypedMass(item, typedItem)));
@ -392,7 +389,7 @@ public class PropertiesPanel : MonoBehaviour
private float GetTypedMass(ItemInstance item, AetheriaRuntimeCatalogItem typedItem)
{
if (typedItem == null)
return GameManager.ItemManager.GetMass(item);
return 0f;
return item is SimpleCommodity simpleCommodity
? (float)typedItem.Mass * simpleCommodity.Quantity
@ -461,10 +458,11 @@ public class PropertiesPanel : MonoBehaviour
private string GetTitle(EquippableItem item)
{
var data = GameManager.ItemManager.GetData(item);
var typedItem = FindTypedPropertyItem(item);
var (tier, upgrades) = GameManager.ItemManager.GetTier(item);
var name = typedItem?.Name ?? "Unknown Item";
return
$"<color=#{ColorUtility.ToHtmlStringRGB(tier.Color.ToColor())}>{data.Name}</color><smallcaps><size=60%> ({tier.Name}{new string('+', upgrades)})";
$"<color=#{ColorUtility.ToHtmlStringRGB(tier.Color.ToColor())}>{name}</color><smallcaps><size=60%> ({tier.Name}{new string('+', upgrades)})";
}
public void Inspect(EquippedItem item)

View file

@ -155,10 +155,11 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted.
missing typed hull rows no longer fall back to legacy `HullData`. 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,
base mass, and max durability for item presentation before hydrating legacy
DTOs for behavior reflection and thermal curves that have not yet moved to
typed behavior surfaces. Inventory selection highlighting now uses typed item
The item properties panel also reads typed catalog title names, descriptions,
manufacturer, base mass, and max durability for basic item presentation without
hydrating legacy DTOs; legacy `ItemData` hydration remains only for behavior
reflection and thermal curves that have not yet moved to typed behavior
surfaces. Inventory selection highlighting now uses typed item
shape cells only for UI tint geometry; incomplete typed rows produce no
selected-cell mask instead of falling back to legacy `ItemData.Shape`.
Inventory cargo cell tint now uses typed hardpoint facets only; incomplete