From 8f531401962ad94f12f10eb744d4fed4a7ea32d9 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 14 Jun 2026 00:58:13 +0100 Subject: [PATCH] Use typed durability for inventory HUD tint --- .voidbot/state/aetheria.cc | Bin 56262 -> 56357 bytes Assets/Scripts/UI/Menu/InventoryPanel.cs | 11 ++++++++++- docs/aetheria-perfect-machine-map.md | 3 ++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 665e6ed4b995bdc392dcc0c05688c68c5304b2d3..447805bd6b243012f9da4ce2ca1da7df60255388 100644 GIT binary patch delta 935 zcmZ9L&r4KM6vs&g#~|B8KP2oxfg2r0E1j|JPz@+aX$xE3dGE};+uV2WR$ic{b8dkH9nac zO=ojswtjHl?smOM47uyE;j%T|=E#t{*@{T@44(S2HPo~6<=T@1uOin%*5K}39(*H7 zkus`lpefhD#R3@nb7|mo$75ekU9@L*dTp3Z75{mWUiTQGVe{!+0V0XYr6rmQ4k6J2 zs6ZIzgC-ROms!h^G}O;{`yJ3tjvtBb1~F?XRT^R_ydHF9gVeR0(CI$S}R3 zkt>(J`F0A+#H&HUrOOjdAgK8=sVp%hlq=xqp;E*_mV^XFL&K7QA_k;Ng&c;W(O?wi zWhbj06)^+{<0BU#z0HYhlY$Cjq#!?g&q0dE=(P|_gehb-AVvp5(ipso>AGWc3JYPx zsMjjktlRhBt_-xuPxL5hgBCIEa)2yCsfK}}Q|BZdqcI^WCIZ1-E!Pi;&?W#}M9;Lu z#E1cj5K2_LDV9NL%9z6l3HO!bOK%eHIi2^hq+YG8N-Q<6dLj&|o{W(D_Iabyo0x~} za^uo$VEmEJ{MRa!`>SQDHCxe{Bk$Oa*s%5IaHp>?Nide3{|hgxBLseda~wYtB$`kBcPjUVeg9H2)odwJ*VZAm@!Qn>Lb5pj%NNo_~bGCFK*dlE%-^zIn^ z9x9R$8?xLCozMzws1xbuv4BkWXZ`d>fovhr1_UDkgIFs9;gugy`QVt4gJB;CQ{Plc z3kV7$@|mENUG&!KtiXW_Y1o$xVB$h;gi9Mcj+A8{NAHIuH`0=&b%HGj(SoHu8I({7 zJ#K45jHwP`B4r)?#9&uQ#;ik5u}dNL1#8H?vr7;pE-?gN;ux^hyhap*PmyMyd(2Q< z;_4+X2cfLvf1m?E-_O$z+E=XbiJurdGPdy%z1+Zd6wAt*qrL3mkBb|=u(8CHkv)-1 zv*0wiG-gjsqMV4R9GsTf+4qoE<%oQTq#Q$04_5N`;NK8J`JZ&7(XgH;ObR(5{xX*RvTy0UVU z+;uIvVY!7}lUMOit7Sj`S*ZBGg!vn~>5xdVF74&)=l)=_Sp9|8V&{#+o_&?Q9<+A< z4o*yzH^GVQpmwgjht}0*aSyi+zLnWlv&k2;S!J6GMfS_#vno&?*ly?7_lYVpJJb0G DTI5UI 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