Use typed catalog for trade debug rows

This commit is contained in:
Meta Vens 2026-06-13 13:38:40 +01:00
commit 0cfa9ea2df
3 changed files with 22 additions and 7 deletions

View file

@ -205,7 +205,9 @@ public class TradeMenuDebug : MonoBehaviour
data => () => $"{data.Shape.Width}x{data.Shape.Height}",
data => data.Shape.Width*data.Shape.Height));
var items = GameManager.ItemManager.GetCatalogEntries<ItemData>().Where(i=>i.Price!=0);
var items = ActionGameManager.RuntimeCatalog.TradeItems
.Select(HydrateLegacyItem)
.Where(i => i != null);
if (MinimumSizeFilter.gameObject.activeSelf)
items = items.Where(i =>
@ -351,6 +353,13 @@ public class TradeMenuDebug : MonoBehaviour
}));
}
private ItemData HydrateLegacyItem(GameCult.Aetheria.State.Unity.AetheriaRuntimeCatalogItem item)
{
return Guid.TryParse(item.LegacyId, out var legacyId)
? GameManager.ItemManager.GetCatalogEntry<ItemData>(legacyId)
: null;
}
private void Buy(HullData data)
{
if (data.Price < GameManager.Credits)