Use typed catalog facts in properties panel

This commit is contained in:
Meta Vens 2026-06-14 00:14:12 +01:00
commit 089266d932
3 changed files with 30 additions and 4 deletions

Binary file not shown.

View file

@ -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<PerformanceStat, float> statValueFunction)
{
if (item.Durability < .01f)

View file

@ -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