Use typed behavior kinds for weapon articulation
This commit is contained in:
parent
6a92564f94
commit
7084b8137e
3 changed files with 24 additions and 4 deletions
Binary file not shown.
|
|
@ -28,6 +28,15 @@ using Random = UnityEngine.Random;
|
|||
|
||||
public class ActionGameManager : MonoBehaviour
|
||||
{
|
||||
private static readonly HashSet<string> ArticulatedWeaponBehaviorKinds = new HashSet<string>(StringComparer.Ordinal)
|
||||
{
|
||||
"GuidedWeapon",
|
||||
"InstantWeapon",
|
||||
"ConstantWeapon",
|
||||
"ChargedWeapon",
|
||||
"AutoWeapon"
|
||||
};
|
||||
|
||||
// Always check for null if accessing from anywhere that might not be in-game (e.g. menu UI)
|
||||
public static ActionGameManager Instance { get; private set; }
|
||||
private static DirectoryInfo _gameDataDirectory;
|
||||
|
|
@ -1253,7 +1262,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
FollowCamera.LookAt = ZoneRenderer.EntityInstances[CurrentEntity].LookAtPoint;
|
||||
FollowCamera.Follow = ZoneRenderer.EntityInstances[CurrentEntity].transform;
|
||||
_articulationGroups = CurrentEntity.Equipment
|
||||
.Where(item => item.Behaviors.Any(x => x.Data is WeaponData && !(x.Data is LauncherData)))
|
||||
.Where(HasArticulatedWeaponBehavior)
|
||||
.GroupBy(item => ZoneRenderer.EntityInstances[CurrentEntity]
|
||||
.GetBarrel(CurrentEntity.Hardpoints[item.Position.x, item.Position.y])
|
||||
.GetComponentInParent<ArticulationPoint>()?.Group ?? -1)
|
||||
|
|
@ -1353,6 +1362,12 @@ public class ActionGameManager : MonoBehaviour
|
|||
}).ToArray();
|
||||
}
|
||||
|
||||
private bool HasArticulatedWeaponBehavior(EquippedItem item)
|
||||
{
|
||||
var typedItem = ItemManager.GetRuntimeItem(item.EquippableItem);
|
||||
return typedItem?.BehaviorKinds.Any(ArticulatedWeaponBehaviorKinds.Contains) == true;
|
||||
}
|
||||
|
||||
private void UpdatePlayerPanel()
|
||||
{
|
||||
ShipPanel.Display(CurrentEntity, true);
|
||||
|
|
|
|||
|
|
@ -89,9 +89,11 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted.
|
|||
Gear action-bar bindings use typed weapon and hardpoint facets for fallback
|
||||
icon selection and fall back to a generic tool icon when typed facets are
|
||||
incomplete; legacy custom action-bar icon paths remain fallback projection
|
||||
data because typed icon fields are not yet present. Unity boot reads typed
|
||||
player settings back through the package-owned CultCache reader before falling
|
||||
back to defaults.
|
||||
data because typed icon fields are not yet present. Player camera articulation
|
||||
grouping now classifies equipped non-launcher weapons through typed behavior
|
||||
kind rows instead of inspecting runtime `BehaviorData` subclasses. Unity boot
|
||||
reads typed player settings back through the package-owned CultCache reader
|
||||
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`.
|
||||
|
|
@ -684,6 +686,9 @@ First Aetheria surfaces to publish:
|
|||
- Done: move action-bar consumable drop binding onto typed catalog rows;
|
||||
legacy `ConsumableItemData` resolution is lazy and bounded to activation
|
||||
and active-duration fill until typed consumable effect execution exists.
|
||||
- Done: move player camera articulation grouping for equipped non-launcher
|
||||
weapons onto typed behavior-kind rows instead of runtime `BehaviorData`
|
||||
type inspection.
|
||||
- Done: import typed thermal bounds and move schematic HUD heat-fill ranges
|
||||
onto typed catalog rows.
|
||||
- Done: import typed item specific heat and move `ItemManager` generic mass,
|
||||
|
|
|
|||
Loading…
Reference in a new issue