diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 636d18fb1..d6c673a77 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Assets/Scripts/Zone Display/ZoneRenderer.cs b/Assets/Scripts/Zone Display/ZoneRenderer.cs index ac7fe35b4..b66d0027a 100644 --- a/Assets/Scripts/Zone Display/ZoneRenderer.cs +++ b/Assets/Scripts/Zone Display/ZoneRenderer.cs @@ -7,6 +7,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using Cinemachine; +using GameCult.Aetheria.State.Unity; using UniRx; using UnityEngine; using UnityEngine.Serialization; @@ -568,11 +569,12 @@ public class ZoneRenderer : MonoBehaviour public void DropItem(Vector3 position, Vector3 velocity, ItemInstance item) { + var typedItem = FindTypedPickupItem(item); var gridObject = item switch { SimpleCommodity _ => Instantiate(SimpleCommodityPickup), CompoundCommodity _ => Instantiate(CompoundCommodityPickup), - EquippableItem equippableItem when ItemManager.GetData(equippableItem) is WeaponItemData => Instantiate(WeaponPickup), + EquippableItem equippableItem when IsWeaponPickup(equippableItem, typedItem) => Instantiate(WeaponPickup), EquippableItem _ => Instantiate(GearPickup), _ => throw new NotImplementedException() }; @@ -584,7 +586,7 @@ public class ZoneRenderer : MonoBehaviour var itemPickup = gridObject.gameObject.GetComponent(); itemPickup.Item = item; itemPickup.ZoneRenderer = this; - itemPickup.ScanLabel.text = ItemManager.GetData(item).Name; + itemPickup.ScanLabel.text = typedItem?.Name ?? ItemManager.GetData(item).Name; if (item is CraftedItemInstance craftedItemInstance) { var c = ItemManager.GetTier(craftedItemInstance).tier.Color.ToColor(); @@ -595,6 +597,22 @@ public class ZoneRenderer : MonoBehaviour gridObject.gameObject.AddComponent().Duration = Settings.PickupLifetime; _loot.Add(itemPickup); } + + private bool IsWeaponPickup(EquippableItem item, AetheriaRuntimeCatalogItem typedItem) + { + if (typedItem != null) + return string.Equals(typedItem.Category, nameof(WeaponItemData), StringComparison.Ordinal); + + return ItemManager.GetData(item) is WeaponItemData; + } + + private static AetheriaRuntimeCatalogItem FindTypedPickupItem(ItemInstance item) + { + var itemId = item?.Data?.ItemId ?? Guid.Empty; + return itemId == Guid.Empty + ? null + : ActionGameManager.RuntimeCatalog?.FindItemByLegacyId(itemId.ToString("D")); + } } diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 66791db88..fec131cf9 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -135,7 +135,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. hydrating `ItemData` projections for legacy commodity filters, columns, and buy actions. The sector properties UI also resolves station/turret/ship counts through typed hull classifications from the runtime catalog before - falling back to legacy `HullData` projection for missing rows. + 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. - `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