From 718f2fb8dba2bbd3a41b0b1ea5d47242c3f004f2 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 21 Jun 2026 11:55:19 +0100 Subject: [PATCH] Restore action bar bindings only from daemon state --- Aetheria.State.Verify/Program.cs | 6 +- Assets/Scripts/Gameplay/ActionGameManager.cs | 64 +------------------- 2 files changed, 6 insertions(+), 64 deletions(-) diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 4a011a2bb..0ad5c4f9d 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -8671,7 +8671,11 @@ static void RequireActionBarBindingRequestAuthority(string root) { "var newbinds = Enumerable.Range(0, 64)", ".Zip(\r\n bindings,", - "groupIndex >= CurrentEntity.WeaponGroups.Length" + "groupIndex >= CurrentEntity.WeaponGroups.Length", + "ApplyDefaultActionBarBindings", + "ProjectActionBarBindings", + "ProjectActionBarBinding(slot, slot?.Binding)", + "Enumerable.Range(0, CurrentEntity.WeaponGroups.Length)" }; var legacyHits = forbiddenSymbols diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index 02f41616c..bf54bd066 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -585,53 +585,6 @@ public class ActionGameManager : MonoBehaviour }; } - private AetheriaRuntimeActionBarBindingCommit[] ProjectActionBarBindings() - { - return _actionBarSlots? - .Select(ProjectActionBarBinding) - .Where(binding => binding != null) - .ToArray() ?? Array.Empty(); - } - - private static AetheriaRuntimeActionBarBindingCommit ProjectActionBarBinding(ActionBarSlot slot) - { - return ProjectActionBarBinding(slot, slot?.Binding); - } - - private static AetheriaRuntimeActionBarBindingCommit ProjectActionBarBinding( - ActionBarSlot slot, - ActionBarBinding binding) - { - switch (binding) - { - case ActionBarConsumableBinding consumable: - return new AetheriaRuntimeActionBarBindingCommit - { - ControlPath = slot.ControlPath ?? "", - Kind = "consumable", - ItemKey = consumable.TargetItemKey - }; - case ActionBarGearBinding gear: - return new AetheriaRuntimeActionBarBindingCommit - { - ControlPath = slot.ControlPath ?? "", - Kind = "gear", - ItemKey = gear.TargetItemKey, - EquipmentIndex = gear.EquipmentIndex, - BehaviorIndex = gear.BehaviorIndex - }; - case ActionBarWeaponGroupBinding weaponGroup: - return new AetheriaRuntimeActionBarBindingCommit - { - ControlPath = slot.ControlPath ?? "", - Kind = "weapon_group", - WeaponGroup = weaponGroup.Group - }; - default: - return null; - } - } - private static AetheriaRuntimeActionBarBindingCommit ToActionBarBindingCommit( AetheriaRuntimeActionBarBindingSnapshot binding) { @@ -751,10 +704,7 @@ public class ActionGameManager : MonoBehaviour return; if (bindings == null || bindings.Count == 0) - { - ApplyDefaultActionBarBindings(); return; - } var slotsByControlPath = _actionBarSlots .Where(slot => !string.IsNullOrWhiteSpace(slot?.ControlPath)) @@ -776,18 +726,6 @@ public class ActionGameManager : MonoBehaviour } } - private void ApplyDefaultActionBarBindings() - { - if (CurrentEntity?.WeaponGroups == null || _actionBarSlots == null) - return; - - foreach (var pair in Enumerable.Range(0, CurrentEntity.WeaponGroups.Length) - .Zip(_actionBarSlots, (groupIndex, slot) => (groupIndex, slot))) - { - pair.slot.Binding = new ActionBarWeaponGroupBinding(CurrentEntity, pair.slot, pair.groupIndex); - } - } - private ActionBarBinding CreateActionBarBinding(ActionBarSlot slot, Entity entity, DragObject dragAction) { var binding = CreateActionBarBindingCommit(slot, entity, dragAction); @@ -3321,7 +3259,7 @@ public class ActionGameManager : MonoBehaviour return; } - var resolvedActionBarBindings = actionBarBindings ?? ProjectActionBarBindings(); + var resolvedActionBarBindings = actionBarBindings ?? Array.Empty(); CurrentEntity = entity; DeathPost.weight = 0; ZoneRenderer.PerspectiveEntity = CurrentEntity;