diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 665e6ed4b..447805bd6 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Assets/Scripts/UI/Menu/InventoryPanel.cs b/Assets/Scripts/UI/Menu/InventoryPanel.cs index e6a951c4a..cd2e17f56 100644 --- a/Assets/Scripts/UI/Menu/InventoryPanel.cs +++ b/Assets/Scripts/UI/Menu/InventoryPanel.cs @@ -817,7 +817,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler if (_displayedEntity.Armor[position.x, position.y] > .01f) return Settings.ArmorGradient.Evaluate(_displayedEntity.Armor[position.x, position.y] / _displayedEntity.MaxArmor[position.x, position.y]); - if (item != null) return Settings.DurabilityGradient.Evaluate(item.Durability / _displayedEntity.ItemManager.GetData(item).Durability); + if (item != null) return Settings.DurabilityGradient.Evaluate(item.Durability / GetMaxDurability(item)); return float3(.25f).ToColor(); } @@ -873,6 +873,15 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler Enum.TryParse(typedItem.HardpointType, true, out hardpointType); } + private float GetMaxDurability(ItemInstance item) + { + var typedItem = FindTypedInventoryItem(item); + if (typedItem != null && typedItem.Durability > 0) + return (float)typedItem.Durability; + + return _displayedEntity.ItemManager.GetData(item).Durability; + } + private static AetheriaRuntimeCatalogItem FindTypedInventoryItem(ItemInstance item) { var itemId = item?.Data?.ItemId ?? Guid.Empty; diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index f15567510..3cbc8f2c1 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -151,7 +151,8 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. 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`. + to legacy `EquippableItemData.HardpointType`. Inventory HUD durability tint + uses typed max durability before falling back to legacy `ItemData.Durability`. - `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