diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index bac445c60..1b8124891 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -16707,10 +16707,11 @@ static void RequireInventoryLoadoutSaveRequestAuthority(string root) { "RequestLoadoutTemplateSave(Entity entity)", "TryResolveEntityRecordKey(entity, out var targetEntityKey)", - "AetheriaRuntimeReactiveLoadoutSnapshotProjector _loadoutSnapshotProjector", - "ResolveLoadoutSnapshotProjector().ProjectLoadoutTemplate(targetEntityKey)", - ".ReactiveLoadoutSnapshotProjector()", - "_loadoutSnapshotProjector?.Dispose()", + "CultMeshReactiveDocument _loadoutFrame", + "ProjectLoadoutTemplate(targetEntityKey)", + "AetheriaRuntimeLoadoutSnapshotProjector.ProjectLoadoutTemplate(", + ".ReactiveDaemonFrame()", + "_loadoutFrame?.Dispose()", ".Ui.SaveLoadoutTemplateAsync(loadout, \"unity-inventory\")" }; var missingInventoryPanelSymbols = requiredInventoryPanelSymbols @@ -16719,15 +16720,17 @@ static void RequireInventoryLoadoutSaveRequestAuthority(string root) if (missingInventoryPanelSymbols.Length > 0) { throw new InvalidOperationException( - "InventoryPanel no longer sends a typed Eve loadout-template command: " + + "InventoryPanel no longer sends a typed Eve loadout-template command from the managed reactive daemon frame: " + string.Join(", ", missingInventoryPanelSymbols)); } if (inventoryPanel.Contains(".LoadoutTemplateAsync(", StringComparison.Ordinal) || - inventoryPanel.Contains(".ProjectLoadoutTemplateAsync(client.State, targetEntityKey)", StringComparison.Ordinal)) + inventoryPanel.Contains(".ProjectLoadoutTemplateAsync(client.State, targetEntityKey)", StringComparison.Ordinal) || + inventoryPanel.Contains("AetheriaRuntimeReactiveLoadoutSnapshotProjector", StringComparison.Ordinal) || + inventoryPanel.Contains(".ReactiveLoadoutSnapshotProjector()", StringComparison.Ordinal)) { throw new InvalidOperationException( - "InventoryPanel still asks a one-shot compatibility helper for loadout templates instead of caching the managed reactive loadout projector."); + "InventoryPanel still asks an aggregate compatibility helper for loadout templates instead of caching the managed reactive daemon frame."); } var requiredLoadoutSnapshotProjectorSymbols = new[] diff --git a/Assets/Scripts/UI/Menu/InventoryPanel.cs b/Assets/Scripts/UI/Menu/InventoryPanel.cs index 30becb8bf..8cb44a599 100644 --- a/Assets/Scripts/UI/Menu/InventoryPanel.cs +++ b/Assets/Scripts/UI/Menu/InventoryPanel.cs @@ -107,7 +107,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler private CultMeshReactiveDocument _playerSettings; private CultMeshReactiveDocument _currentEntity; private CultMeshReactiveDocument _stationRefit; - private AetheriaRuntimeReactiveLoadoutSnapshotProjector _loadoutSnapshotProjector; + private CultMeshReactiveDocument _loadoutFrame; private int _inventoryEntityIndex = -1; private CultMeshReactiveDocument _inventory; private AetheriaRuntimeStationRefitEntityOption[] _dropdownStationRefitEntities = @@ -1075,7 +1075,7 @@ private void Update() try { var client = ResolveClient(); - var loadout = ResolveLoadoutSnapshotProjector().ProjectLoadoutTemplate(targetEntityKey); + var loadout = ProjectLoadoutTemplate(targetEntityKey); if (loadout?.RootEntity == null || string.IsNullOrWhiteSpace(loadout.RootEntity.Hull?.ItemKey ?? "")) return; @@ -1475,14 +1475,14 @@ private void Update() _playerSettings?.Dispose(); _currentEntity?.Dispose(); _stationRefit?.Dispose(); - _loadoutSnapshotProjector?.Dispose(); + _loadoutFrame?.Dispose(); _observedDockingIndex?.Dispose(); _inventory?.Dispose(); _catalog = null; _playerSettings = null; _currentEntity = null; _stationRefit = null; - _loadoutSnapshotProjector = null; + _loadoutFrame = null; _observedDockingIndex = null; _inventory = null; _inventoryEntityIndex = -1; @@ -1527,15 +1527,31 @@ private void Update() return _stationRefit?.Current; } - private AetheriaRuntimeReactiveLoadoutSnapshotProjector ResolveLoadoutSnapshotProjector() + private AetheriaRuntimeLoadoutTemplateCommit ProjectLoadoutTemplate(string targetEntityKey) { - if (_loadoutSnapshotProjector != null) - return _loadoutSnapshotProjector; + var frame = ResolveLoadoutFrame(); + return AetheriaRuntimeLoadoutSnapshotProjector.ProjectLoadoutTemplate( + frame?.Run ?? new AetheriaRuntimeRunCheckpointCommit(), + targetEntityKey ?? ""); + } - _loadoutSnapshotProjector = ResolveClient() - .Aetheria() - .ReactiveLoadoutSnapshotProjector(); - return _loadoutSnapshotProjector; + private AetheriaRuntimeDaemonFrameDocument ResolveLoadoutFrame() + { + if (_loadoutFrame != null) + return _loadoutFrame.Current; + + try + { + _loadoutFrame = ResolveClient() + .Aetheria() + .ReactiveDaemonFrame(); + } + catch (Exception ex) + { + Debug.LogWarning($"Failed to bind Aetheria daemon frame for loadout template save: {ex.Message}"); + } + + return _loadoutFrame?.Current; } private AetheriaRuntimeInventoryDocument ResolveInventory(int entityIndex)