Use typed hardpoints for cargo tint

This commit is contained in:
Meta Vens 2026-06-14 00:54:19 +01:00
commit 4c7da3b3d6
3 changed files with 23 additions and 1 deletions

Binary file not shown.

View file

@ -6,6 +6,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using GameCult.Aetheria.State.Unity;
using TMPro;
using UniRx;
using UniRx.Triggers;
@ -851,7 +852,9 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
return Color.white * .25f;
var c = float3(1);
if (GameManager.ItemManager.GetData(item) is EquippableItemData equippable)
if (TryGetTypedHardpointType(item, out var typedHardpoint))
c = HardpointData.GetColor(typedHardpoint);
else if (GameManager.ItemManager.GetData(item) is EquippableItemData equippable)
c = HardpointData.GetColor(equippable.HardpointType);
if(!highlight)
@ -861,6 +864,23 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
}
}
private static bool TryGetTypedHardpointType(ItemInstance item, out HardpointType hardpointType)
{
hardpointType = HardpointType.Hull;
var typedItem = FindTypedInventoryItem(item);
return typedItem != null &&
!string.IsNullOrWhiteSpace(typedItem.HardpointType) &&
Enum.TryParse(typedItem.HardpointType, true, out hardpointType);
}
private static AetheriaRuntimeCatalogItem FindTypedInventoryItem(ItemInstance item)
{
var itemId = item?.Data?.ItemId ?? Guid.Empty;
return itemId == Guid.Empty
? null
: ActionGameManager.RuntimeCatalog?.FindItemByLegacyId(itemId.ToString("D"));
}
public bool CanDropItem(ItemInstance item)
{
if (_displayedEntity != null && item is EquippableItem equippableItem)

View file

@ -150,6 +150,8 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted.
reflection, thermal curves, and durability math that have not yet moved to
typed behavior surfaces. Inventory selection highlighting now uses typed item
shape cells for UI tint geometry before falling back to legacy `ItemData.Shape`.
Inventory cargo cell tint now uses typed hardpoint facets before falling back
to legacy `EquippableItemData.HardpointType`.
- `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