Use typed behavior kinds for schematic weapons

This commit is contained in:
Meta Vens 2026-06-14 06:14:51 +01:00
commit e998a8d789
3 changed files with 24 additions and 2 deletions

Binary file not shown.

View file

@ -12,6 +12,16 @@ using static Unity.Mathematics.math;
public class SchematicDisplay : MonoBehaviour
{
private static readonly HashSet<string> WeaponBehaviorKinds = new HashSet<string>(StringComparer.Ordinal)
{
"GuidedWeapon",
"Launcher",
"InstantWeapon",
"ConstantWeapon",
"ChargedWeapon",
"AutoWeapon"
};
public GameSettings Settings;
public Prototype ListElementPrototype;
@ -108,7 +118,7 @@ public class SchematicDisplay : MonoBehaviour
}
_schematicItems = entity.Equipment
.Where(x => x.Behaviors.Any(b => b.Data is WeaponData))
.Where(HasTypedWeaponBehavior)
.Select(x => new SchematicDisplayItem
{
Item = x,
@ -144,6 +154,12 @@ public class SchematicDisplay : MonoBehaviour
}
private static bool HasTypedWeaponBehavior(EquippedItem item)
{
var typedItem = FindTypedItem(item.EquippableItem);
return typedItem?.BehaviorKinds.Any(WeaponBehaviorKinds.Contains) == true;
}
void Update()
{
if (_entity != null)

View file

@ -96,7 +96,10 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted.
before falling back to defaults.
- The combat schematic HUD uses typed runtime catalog weapon facets for its
static weapon icon strip; missing typed weapon facets no longer fall back to
legacy `WeaponItemData`.
legacy `WeaponItemData`. Schematic weapon-row selection now uses typed
behavior-kind rows instead of inspecting runtime `BehaviorData` subclasses;
live weapon behavior instances still own ammo, cooldown, and active firing
values until those session facts have typed runtime surfaces.
Hull and item durability percentages use typed max durability only; incomplete
typed rows use current runtime durability as the generic denominator instead
of falling back to legacy `ItemData.Durability`.
@ -691,6 +694,9 @@ First Aetheria surfaces to publish:
type inspection.
- Done: import typed thermal bounds and move schematic HUD heat-fill ranges
onto typed catalog rows.
- Done: move schematic HUD weapon-row classification onto typed behavior-kind
rows; runtime `Weapon` instances remain the owner for live ammo/cooldown
display values.
- Done: import typed item specific heat and move `ItemManager` generic mass,
thermal-mass, and crafted-price helpers onto typed runtime catalog rows.
- Done: import typed thermal performance curve keys and move PropertiesPanel