diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index c77ef92c6..e206fcc37 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -7714,15 +7714,6 @@ static void RequireUnitySharedDocumentAccessorErgonomics(string root) "InventoryPanel.cs")); var requiredInventoryPanelSharedDocumentSymbols = new[] { - "AetheriaRuntimeCatalogSession _catalog", - "AetheriaRuntimePlayerSettingsSession _playerSettings", - "ResolveClient().State.ObserveCatalog()", - ".Settings", - ".ObservePlayer()", - "_catalog?.Dispose()", - "_playerSettings?.Dispose()", - "_catalog?.Current", - "_playerSettings?.Current", "private void OnDestroy()" }; var missingInventoryPanelSharedDocumentSymbols = requiredInventoryPanelSharedDocumentSymbols @@ -7735,22 +7726,22 @@ static void RequireUnitySharedDocumentAccessorErgonomics(string root) string.Join(", ", missingInventoryPanelSharedDocumentSymbols)); } - var forbiddenInventoryPanelSharedDocumentSymbols = new[] - { - "CultMeshReactiveDocument _catalog", - "CultMeshReactiveDocument _playerSettings", + RequireReactiveTypedDocumentAccess( + inventoryPanel, + "InventoryPanel", + "AetheriaRuntimeCatalogSnapshot", + "_catalog", "ResolveClient().State.ReactiveCatalog()", - ".ReactivePlayer()" - }; - var inventoryPanelRawDocumentHits = forbiddenInventoryPanelSharedDocumentSymbols - .Where(symbol => inventoryPanel.Contains(symbol, StringComparison.Ordinal)) - .ToArray(); - if (inventoryPanelRawDocumentHits.Length > 0) - { - throw new InvalidOperationException( - "InventoryPanel still owns raw catalog/settings CultMesh documents instead of managed sessions: " + - string.Join(", ", inventoryPanelRawDocumentHits)); - } + "AetheriaRuntimeCatalogSession", + "ResolveClient().State.ObserveCatalog()"); + RequireReactiveTypedDocumentAccess( + inventoryPanel, + "InventoryPanel", + "AetheriaRuntimePlayerSettingsDocument", + "_playerSettings", + ".ReactivePlayer()", + "AetheriaRuntimePlayerSettingsSession", + ".ObservePlayer()"); var sectorRenderer = File.ReadAllText(Path.Combine( root, diff --git a/Assets/Scripts/UI/Menu/InventoryPanel.cs b/Assets/Scripts/UI/Menu/InventoryPanel.cs index a6170a73a..b8b13b068 100644 --- a/Assets/Scripts/UI/Menu/InventoryPanel.cs +++ b/Assets/Scripts/UI/Menu/InventoryPanel.cs @@ -10,6 +10,7 @@ using System.Linq; using GameCult.Aetheria.EveRuntime; using GameCult.Aetheria.State.Verse; using GameCult.Eve.Surface; +using GameCult.Mesh; using TMPro; using UniRx; using UniRx.Triggers; @@ -108,8 +109,8 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler private InventoryCell _clickCell; private float _clickTime; private string _clientStatePath = ""; - private AetheriaRuntimeCatalogSession _catalog; - private AetheriaRuntimePlayerSettingsSession _playerSettings; + private CultMeshReactiveDocument _catalog; + private CultMeshReactiveDocument _playerSettings; private AetheriaRuntimeCurrentEntitySession _currentEntity; private AetheriaRuntimeStationRefitSession _stationRefit; private AetheriaRuntimeDaemonFrameSession _loadoutFrame; @@ -1591,7 +1592,7 @@ private void Update() try { - _catalog = ResolveClient().State.ObserveCatalog(); + _catalog = ResolveClient().State.ReactiveCatalog(); } catch (Exception ex) { @@ -1611,7 +1612,7 @@ private void Update() _playerSettings = ResolveClient() .State .Settings - .ObservePlayer(); + .ReactivePlayer(); } catch (Exception ex) {