Read inventory loadout saves from typed daemon frame

This commit is contained in:
Meta Vens 2026-06-28 12:45:49 +01:00
commit 5d405b312a
2 changed files with 37 additions and 18 deletions

View file

@ -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<AetheriaRuntimeDaemonFrameDocument> _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[]

View file

@ -107,7 +107,7 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
private CultMeshReactiveDocument<AetheriaRuntimePlayerSettingsDocument> _playerSettings;
private CultMeshReactiveDocument<AetheriaRuntimeCurrentEntityDocument> _currentEntity;
private CultMeshReactiveDocument<AetheriaRuntimeStationRefitDocument> _stationRefit;
private AetheriaRuntimeReactiveLoadoutSnapshotProjector _loadoutSnapshotProjector;
private CultMeshReactiveDocument<AetheriaRuntimeDaemonFrameDocument> _loadoutFrame;
private int _inventoryEntityIndex = -1;
private CultMeshReactiveDocument<AetheriaRuntimeInventoryDocument> _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)