Gate action bar consumables with typed catalog
This commit is contained in:
parent
87f9adf4d9
commit
ca18aa24d3
3 changed files with 22 additions and 3 deletions
Binary file not shown.
|
|
@ -729,6 +729,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
slot.Binding = new ActionBarGearBinding(CurrentEntity, slot, equippedItemDragAction.EquippedItem, trigger);
|
||||
return true;
|
||||
case ItemInstanceDragObject itemInstanceDragAction:
|
||||
if (!IsTypedConsumable(itemInstanceDragAction.Item)) return false;
|
||||
if (!(ItemManager.GetData(itemInstanceDragAction.Item) is ConsumableItemData consumable)) return false;
|
||||
slot.Binding = new ActionBarConsumableBinding(CurrentEntity, slot, consumable);
|
||||
return true;
|
||||
|
|
@ -748,6 +749,21 @@ public class ActionGameManager : MonoBehaviour
|
|||
return slot;
|
||||
}
|
||||
|
||||
bool IsTypedConsumable(ItemInstance item)
|
||||
{
|
||||
var typedItem = FindTypedActionBarItem(item);
|
||||
return typedItem == null ||
|
||||
string.Equals(typedItem.Category, nameof(ConsumableItemData), StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
AetheriaRuntimeCatalogItem FindTypedActionBarItem(ItemInstance item)
|
||||
{
|
||||
var itemId = item?.Data?.ItemId ?? Guid.Empty;
|
||||
return itemId == Guid.Empty
|
||||
? null
|
||||
: RuntimeCatalog?.FindItemByLegacyId(itemId.ToString("D"));
|
||||
}
|
||||
|
||||
var bindings = RuntimePlayerSettings.InputSettings.ActionBarInputs.OrderBy(i => i)
|
||||
.Select(createBinding).ToList();
|
||||
|
||||
|
|
|
|||
|
|
@ -77,9 +77,12 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted.
|
|||
that calls Unity's InputSystem at the binding/action layer; Unity's generated
|
||||
`AetheriaInput` class is the edge consumer of typed binding overrides, not
|
||||
the durable owner. Binding drag/drop and action-bar remapping both queue the
|
||||
same typed player-settings commit after mutating the runtime projection.
|
||||
Unity boot reads typed player settings back through the package-owned
|
||||
CultCache reader before falling back to defaults.
|
||||
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.
|
||||
- `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
|
||||
|
|
|
|||
Loading…
Reference in a new issue