diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index ddfda4c06..393c9e1ad 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs index 0f134fb64..6eba1b9a2 100644 --- a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs +++ b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs @@ -399,6 +399,15 @@ public class PropertiesPanel : MonoBehaviour : (float)typedItem.Mass; } + private float GetMaxDurability(ItemInstance item) + { + var typedItem = FindTypedPropertyItem(item); + if (typedItem != null && typedItem.Durability > 0) + return (float)typedItem.Durability; + + return GameManager.ItemManager.GetData(item).Durability; + } + private static AetheriaRuntimeCatalogItem FindTypedPropertyItem(ItemInstance item) { var itemId = item?.Data?.ItemId ?? Guid.Empty; @@ -499,7 +508,7 @@ public class PropertiesPanel : MonoBehaviour var statusSheet = AddStatSheet(); if (item.EquippableItem.Durability < .01f) statusSheet.AddStat("Durability", () => "Item Destroyed!"); - else statusSheet.AddStat("Durability", () => $"{(int)(item.EquippableItem.Durability / gearData.Durability * 100)}%"); + else statusSheet.AddStat("Durability", () => $"{(int)(item.EquippableItem.Durability / GetMaxDurability(item.EquippableItem) * 100)}%"); statusSheet.AddStat("Temperature", () => ActionGameManager.RuntimePlayerSettings.FormatTemperature(item.Temperature)); var heatCurve = AddCurveField(); @@ -541,7 +550,7 @@ public class PropertiesPanel : MonoBehaviour AddSpacer(); var gearData = GameManager.ItemManager.GetData(gear); var statusSheet = AddStatSheet(); - statusSheet.AddStat("Durability", () => $"{(int)(gear.Durability / gearData.Durability * 100)}%"); + statusSheet.AddStat("Durability", () => $"{(int)(gear.Durability / GetMaxDurability(gear) * 100)}%"); var heatCurve = AddCurveField(); heatCurve.Show( "Thermal Performance", diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index e2fccabfd..859045f77 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -150,8 +150,8 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. 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 + base mass, and max durability for item presentation before hydrating legacy + DTOs for behavior reflection and thermal curves 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