diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index e325b02b4..7026d82a2 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 f3b348eb7..4cc9a8f8a 100644 --- a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs +++ b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs @@ -474,7 +474,7 @@ public class PropertiesPanel : MonoBehaviour } } - var weaponPayload = typedItem?.BehaviorPayloads.FirstOrDefault(payload => TypedBehaviorMatches(payload, typeof(WeaponData))); + var weaponPayload = typedItem?.BehaviorPayloads.FirstOrDefault(payload => TypedBehaviorMatches(payload, WeaponBehaviorMatcher)); if (weaponPayload != null) { var damageCurve = ReadTypedBezierCurve(FindTypedBehaviorField(weaponPayload, 7)?.Value); @@ -561,15 +561,15 @@ public class PropertiesPanel : MonoBehaviour : fallback; } - private static bool TypedBehaviorMatches(AetheriaRuntimeBehaviorPayload payload, Type behaviorType) + private static bool TypedBehaviorMatches(AetheriaRuntimeBehaviorPayload payload, BehaviorKindMatcher matcher) { - if (string.Equals(payload.Kind, behaviorType.Name, StringComparison.Ordinal)) + if (string.Equals(payload.Kind, matcher.Kind, StringComparison.Ordinal)) { return true; } var payloadType = ResolveBehaviorType(payload.Kind); - return payloadType != null && behaviorType.IsAssignableFrom(payloadType); + return payloadType != null && matcher.MetadataType.IsAssignableFrom(payloadType); } private static Type ResolveBehaviorType(string kind) @@ -587,6 +587,22 @@ public class PropertiesPanel : MonoBehaviour .GroupBy(type => type.Name) .ToDictionary(group => group.Key, group => group.First(), StringComparer.Ordinal); + private static readonly BehaviorKindMatcher WeaponBehaviorMatcher = new BehaviorKindMatcher( + nameof(WeaponData), + typeof(WeaponData)); + + private readonly struct BehaviorKindMatcher + { + public BehaviorKindMatcher(string kind, Type metadataType) + { + Kind = string.IsNullOrWhiteSpace(kind) ? "" : kind; + MetadataType = metadataType ?? throw new ArgumentNullException(nameof(metadataType)); + } + + public string Kind { get; } + public Type MetadataType { get; } + } + private string GetTitle(EquippableItem item) { var typedItem = FindTypedPropertyItem(item); diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 8b933c254..e2a382681 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -222,7 +222,10 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. manufacturer, base mass, max durability, thermal bounds, and thermal performance curve keys for basic item presentation without hydrating legacy DTOs. Runtime behavior stat display and damage-range curves read typed - behavior payload fields by legacy payload key. The old explicit + behavior payload fields by legacy payload key. Damage-range payload selection + is keyed by typed behavior kind (`WeaponData`); legacy `BehaviorData` ancestry + is only a temporary metadata fallback while typed behavior metadata/factory + documents are missing. The old explicit `Inspect(ItemData)` DTO inspection overload is deleted; trade row clicks now inspect the typed runtime catalog row directly. Incomplete typed thermal curve rows render a neutral fallback curve instead of hydrating legacy @@ -746,6 +749,9 @@ First Aetheria surfaces to publish: curves onto typed behavior payload fields, and delete the explicit `Inspect(ItemData)` projection inspector after moving trade row inspection onto typed runtime catalog rows. + - Done: demote PropertiesPanel weapon damage-range payload matching from + `BehaviorData` `Type` authority to a typed behavior kind key; reflection + remains metadata-only until typed behavior metadata/factory documents exist. - Done: remove the loot pickup presentation fallback to legacy `ItemData`; typed category/name rows now decide pickup visuals and scan labels, and missing typed rows render generic unknown gear pickup presentation.