Use reactive shared documents in inventory panel
This commit is contained in:
parent
20fdf19245
commit
bf9c3fa501
2 changed files with 20 additions and 28 deletions
|
|
@ -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<AetheriaRuntimeCatalogSnapshot> _catalog",
|
||||
"CultMeshReactiveDocument<AetheriaRuntimePlayerSettingsDocument> _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,
|
||||
|
|
|
|||
|
|
@ -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<AetheriaRuntimeCatalogSnapshot> _catalog;
|
||||
private CultMeshReactiveDocument<AetheriaRuntimePlayerSettingsDocument> _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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue