From e3ae2ecbeb42c44ca163e074ae73d8269df0991a Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 14 Jun 2026 00:22:50 +0100 Subject: [PATCH] Use typed facets for action bar gear icons --- .voidbot/state/aetheria.cc | Bin 54483 -> 54621 bytes Assets/Scripts/Gameplay/ActionBarSlot.cs | 32 ++++++++++++++++++++--- docs/aetheria-perfect-machine-map.md | 8 +++--- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index dfe48b88ef372b740da3d4c412cb5f9ea6073370..64a01e6fa13962c04a003d83c99c7b6bdd6cb86a 100644 GIT binary patch delta 999 zcmZuw&r4K69B*AU7oq47k|})gQc$jD>yPS`X|<=YtiVpQ@6GO;oSk{j%+n-j!$bF& zjuAzPB^Akb=@3B>lwO1&G79<+s{f$xy!X~0(e2Hb_nGVwbayh;$)#e zUlJ+iDdiXO%&HsG z-g?wg+eWkEXgfOp0AMbl0=WaH72?f<7ioiRPsajBi7GlsNK61sL#U{x!sM3>6&hdL zSUB^)-?d?!1822assZ8Y)#Eb}3qw-kbW?-Vt!R~?)GgCOC9l)?eej)7XBh{Ex}9EB z>&zjFCYI(`5|zbj$Ws$G?wyTHq-ZSx#RwFJC>_X%`%sm$7(qhadD4fvWTZSAD|OBr znFiJf3e6rzkdBl~2ecuE9tGpf^C_nW*#zj&4i~$7W5XM5$S)It1yL7iS%2TvRiAm> z-=4W*Pc0s>g0~*o7FG(2Ti`6(aVw@+|MhaE#b&M@w7+lfZNZc-ars3s^&>PN04JC@RZLJ=gyns!o-n7m?r?bqb z!lO=9{l)9f+`eSDhK8q}7*au@J@v0|*E8+QF2L9jU4Qy+PcGfTp<%n8?Mx1X$477> qzoffYuzzs(WVY3Q`xI`?vK=;9T}T(UFya=r-nRBWmre!;rv3t=ZE-6A delta 914 zcmZXTF;5gh6vu@_3=OWw9mI%*4VsV`xfqO*%DLTlccZg2o0(b2h2o4x zd)Sy5wGs_Vfs)n2#t>s86q;C(=r_-Y-wm(Y}w*rykEW5xB(= zBCR6SmZO1)NfaQ}B4}iR0o#f&03A!qLj<2$CR8K2^d8zZW)MPV4Aii$G(w#T!DRz# z%)bj(fxrgyTQEZk(^ThF?x1hElHMy{Fdptco$LHP`zvU*Xh1DWFqT>F=ibnubO9wv z!nX#vgsN`mmaES3#awNAZq|_XkWmu3B5zH$!0Di|F1qStV4J8zCcuyN0-7;kGJqh~ zti}bmEo#a(y)}!{kml}+!*qxcZyTayp&kp-f+(i`TWCqnXEAZffSu*iM5M}U0{5*% ztR<9#>vVH3Gyw7&GU*fMjxWN%g#f`95UBSIr)$vLWPbAS#qsvDE3tLb2khOLp>l#` znkp6ngo>*7AVm5AOd3&ly8G9ev2&NH$i$j()04=?8=yez=1Yz5r|HJ# z(RAd)Xz@gM0m`NMmzFh1V(`#N%u9Z#tc58XySeBZ6D-65ygjXpg te+xsjHe1~dsf>?zHbfQrlVCf_lEynp|F-XEN#)L7r7Jt1i+SYy{D0!aQTzY^ diff --git a/Assets/Scripts/Gameplay/ActionBarSlot.cs b/Assets/Scripts/Gameplay/ActionBarSlot.cs index 0c6f29c76..69f3bd713 100644 --- a/Assets/Scripts/Gameplay/ActionBarSlot.cs +++ b/Assets/Scripts/Gameplay/ActionBarSlot.cs @@ -1,4 +1,6 @@ +using System; using System.Linq; +using GameCult.Aetheria.State.Unity; using TMPro; using UniRx.Triggers; using UnityEngine; @@ -99,16 +101,38 @@ public class ActionBarGearBinding : ActionBarBinding public ActionBarGearBinding(Entity entity, ActionBarSlot slot, EquippedItem item, IActivatedBehavior behavior) : base(entity, slot) { Item = item; - var data = entity.ItemManager.GetData(item.EquippableItem); Behavior = behavior; Slot.QuantityRemaining.gameObject.SetActive(false); Slot.Icon.gameObject.SetActive(true); Slot.Label.gameObject.SetActive(false); if (!string.IsNullOrEmpty(Item.Data.ActionBarIcon)) Slot.Icon.texture = Resources.Load(Item.Data.ActionBarIcon.Substring("Assets/Resources/".Length).Split('.').First()); - else if (data is WeaponItemData weaponItemData) - Slot.Icon.texture = ActionGameManager.Instance.Settings.GetIcon(weaponItemData.WeaponType).texture; - else Slot.Icon.texture = ActionGameManager.Instance.Settings.GetIcon(data.HardpointType).texture; + else Slot.Icon.texture = ResolveIconTexture(); + } + + private Texture2D ResolveIconTexture() + { + var typedItem = FindTypedGearItem(Item.EquippableItem); + if (typedItem != null) + { + if (Enum.TryParse(typedItem.WeaponType, out var weaponType)) + return ActionGameManager.Instance.Settings.GetIcon(weaponType).texture; + + if (Enum.TryParse(typedItem.HardpointType, out var hardpointType)) + return ActionGameManager.Instance.Settings.GetIcon(hardpointType).texture; + } + + return Item.Data is WeaponItemData weaponItemData + ? ActionGameManager.Instance.Settings.GetIcon(weaponItemData.WeaponType).texture + : ActionGameManager.Instance.Settings.GetIcon(Item.Data.HardpointType).texture; + } + + private static AetheriaRuntimeCatalogItem FindTypedGearItem(ItemInstance item) + { + var itemId = item?.Data?.ItemId ?? Guid.Empty; + return itemId == Guid.Empty + ? null + : ActionGameManager.RuntimeCatalog?.FindItemByLegacyId(itemId.ToString("D")); } public override void Activate() diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 907eb1bd9..656de04cd 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -80,9 +80,11 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. same typed player-settings commit after mutating the runtime projection. The action bar also uses typed runtime catalog category rows to reject non-consumable inventory drops before hydrating the legacy consumable DTO - still required by activation APIs. Unity boot reads typed player settings - back through the package-owned CultCache reader before falling back to - defaults. + still required by activation APIs. Gear action-bar bindings use typed weapon + and hardpoint facets for fallback icon selection instead of hydrating item + DTOs to classify the icon; legacy custom action-bar icon paths remain fallback + projection data. Unity boot reads typed player settings back through the + package-owned CultCache reader before falling back to defaults. - `Aetheria.State` now exposes typed node put/get ports for run state, zone state, and entity snapshots. The state smoke writes a run referencing a zone, a zone referencing an entity snapshot, and an entity snapshot carrying