Add named catalog and settings document access
This commit is contained in:
parent
baac952fe3
commit
a3d6df3bfd
17 changed files with 108 additions and 56 deletions
|
|
@ -101,7 +101,7 @@ public abstract class ActionBarBinding : IDisposable
|
|||
try
|
||||
{
|
||||
_catalog ??= AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeCatalogSnapshot>("unity-action-bar");
|
||||
.ReactiveCatalogSnapshot("unity-action-bar");
|
||||
return _catalog?.Current?.FindItem(item, x => x.ItemKey);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public sealed class AetheriaUnityGameplayBootShell
|
|||
}
|
||||
|
||||
var runtimeState = AetheriaUnityRuntimeClientProvider.RuntimeState(stateBoot, stateBoot.RuntimeId);
|
||||
using var runtimeCatalogDocument = runtimeState.Reactive<AetheriaRuntimeCatalogSnapshot>();
|
||||
using var runtimeCatalogDocument = runtimeState.ReactiveCatalogSnapshot();
|
||||
var runtimeCatalog = runtimeCatalogDocument.Current;
|
||||
if (runtimeCatalog == null)
|
||||
throw new InvalidOperationException("Aetheria typed runtime catalog is required before gameplay boot.");
|
||||
|
|
|
|||
|
|
@ -150,6 +150,32 @@ public static class AetheriaUnityRuntimeClientProvider
|
|||
return RuntimeState(stateBoot, runtimeId).ReactiveStationRefit();
|
||||
}
|
||||
|
||||
public static CultMeshReactiveDocument<AetheriaRuntimeCatalogSnapshot> ReactiveCatalogSnapshot(
|
||||
string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).ReactiveCatalogSnapshot();
|
||||
}
|
||||
|
||||
public static CultMeshReactiveDocument<AetheriaRuntimeCatalogSnapshot> ReactiveCatalogSnapshot(
|
||||
AetheriaRuntimeStateBootReport stateBoot,
|
||||
string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(stateBoot, runtimeId).ReactiveCatalogSnapshot();
|
||||
}
|
||||
|
||||
public static CultMeshReactiveDocument<AetheriaRuntimePlayerSettingsDocument> ReactivePlayerSettingsDocument(
|
||||
string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).ReactivePlayerSettingsDocument();
|
||||
}
|
||||
|
||||
public static CultMeshReactiveDocument<AetheriaRuntimePlayerSettingsDocument> ReactivePlayerSettingsDocument(
|
||||
AetheriaRuntimeStateBootReport stateBoot,
|
||||
string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(stateBoot, runtimeId).ReactivePlayerSettingsDocument();
|
||||
}
|
||||
|
||||
public static CultMeshReactiveDocument<TDocument> Reactive<TDocument>(
|
||||
AetheriaRuntimeStateBootReport stateBoot,
|
||||
string runtimeId = "")
|
||||
|
|
@ -257,7 +283,7 @@ public static class AetheriaUnityRuntimeClientProvider
|
|||
{
|
||||
try
|
||||
{
|
||||
_playerSettingsDocument ??= Reactive<AetheriaRuntimePlayerSettingsDocument>();
|
||||
_playerSettingsDocument ??= ReactivePlayerSettingsDocument();
|
||||
|
||||
var stored = _playerSettingsDocument.Current;
|
||||
if (stored == null)
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ public class DaemonRuntimeDocumentTests
|
|||
.GetResult();
|
||||
using var zoneRenderReactive = client.State.Reactive<AetheriaRuntimeZoneRenderDocument>();
|
||||
var observedAuthoritativeFrame = ReadLatest(client.State.Document<AetheriaRuntimeDaemonFrameDocument>());
|
||||
using var catalogReactive = client.State.Reactive<AetheriaRuntimeCatalogSnapshot>();
|
||||
using var catalogReactive = client.State.ReactiveCatalogSnapshot();
|
||||
using var daemonFrameReactive = client.State.Reactive<AetheriaRuntimeDaemonFrameDocument>();
|
||||
using var daemonSoaViewReactive = client.State.Reactive<AetheriaRuntimeDaemonSoaViewDocument>();
|
||||
Assert.IsTrue(AetheriaRuntimeDaemonRenderView.TryCreateCurrent(
|
||||
|
|
@ -213,7 +213,7 @@ public class DaemonRuntimeDocumentTests
|
|||
out var observed));
|
||||
using var loadoutTemplatesReactive = client.State.Reactive<AetheriaRuntimeLoadoutTemplatesDocument>();
|
||||
using var sectorMapReactive = client.State.Reactive<AetheriaRuntimeSectorMapDocument>();
|
||||
using var playerSettingsReactive = client.State.Reactive<AetheriaRuntimePlayerSettingsDocument>();
|
||||
using var playerSettingsReactive = client.State.ReactivePlayerSettingsDocument();
|
||||
using var verseHostSettingsReactive = client.State.Reactive<AetheriaRuntimeVerseHostSettingsDocument>();
|
||||
using var zoneContactsReactive = client.State.Reactive<AetheriaRuntimeZoneContactsDocument>();
|
||||
using var currentZoneReactive = client.State.Reactive<AetheriaRuntimeCurrentZoneDocument>();
|
||||
|
|
@ -227,8 +227,8 @@ public class DaemonRuntimeDocumentTests
|
|||
using var objectsViewportReactive = client.State.Reactive<AetheriaRuntimeObjectsViewportDocument>(viewport);
|
||||
using var gravityViewportReactive = client.State.Reactive<AetheriaRuntimeGravityViewportDocument>(viewport);
|
||||
using var renderSplatsViewportReactive = client.State.Reactive<AetheriaRuntimeRenderSplatsViewportDocument>(viewport);
|
||||
using var playerHudCatalog = client.State.Reactive<AetheriaRuntimeCatalogSnapshot>();
|
||||
using var playerHudSettings = client.State.Reactive<AetheriaRuntimePlayerSettingsDocument>();
|
||||
using var playerHudCatalog = client.State.ReactiveCatalogSnapshot();
|
||||
using var playerHudSettings = client.State.ReactivePlayerSettingsDocument();
|
||||
using var playerHudEntity = client.State.ReactiveCurrentEntity();
|
||||
var gameSurface = ReadLatest(client.State.Document<global::Aetheria.State.Documents.EveSurfaceState>(AetheriaClientEveSurface.Game));
|
||||
var gameTuiSurface = ReadLatest(client.State.Document<global::Aetheria.State.Documents.EveSurfaceState>(AetheriaClientEveSurface.GameTui));
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ public class SchematicDisplay : MonoBehaviour
|
|||
try
|
||||
{
|
||||
_catalog = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeCatalogSnapshot>("unity-schematic-display");
|
||||
.ReactiveCatalogSnapshot("unity-schematic-display");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -343,7 +343,7 @@ public class SchematicDisplay : MonoBehaviour
|
|||
try
|
||||
{
|
||||
_playerSettings = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimePlayerSettingsDocument>("unity-schematic-display");
|
||||
.ReactivePlayerSettingsDocument("unity-schematic-display");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ public class InputDisplayLayout : MonoBehaviour
|
|||
try
|
||||
{
|
||||
_playerSettings = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimePlayerSettingsDocument>(
|
||||
.ReactivePlayerSettingsDocument(
|
||||
RequireLocalStateBoot(),
|
||||
"unity-input-screen");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ public class MainMenu : MonoBehaviour
|
|||
{
|
||||
PrepareDocumentAccess(stateBoot);
|
||||
_playerSettings ??= AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimePlayerSettingsDocument>(stateBoot, "unity-main-menu");
|
||||
.ReactivePlayerSettingsDocument(stateBoot, "unity-main-menu");
|
||||
return _playerSettings?.Current;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
|
|
@ -1042,7 +1042,7 @@ public class InventoryMenu : MonoBehaviour
|
|||
try
|
||||
{
|
||||
_catalog = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeCatalogSnapshot>("unity-inventory-menu");
|
||||
.ReactiveCatalogSnapshot("unity-inventory-menu");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -1060,7 +1060,7 @@ public class InventoryMenu : MonoBehaviour
|
|||
try
|
||||
{
|
||||
_playerSettings = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimePlayerSettingsDocument>("unity-inventory-menu");
|
||||
.ReactivePlayerSettingsDocument("unity-inventory-menu");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1574,7 +1574,7 @@ private void Update()
|
|||
try
|
||||
{
|
||||
_catalog = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeCatalogSnapshot>("unity-inventory");
|
||||
.ReactiveCatalogSnapshot("unity-inventory");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -1592,7 +1592,7 @@ private void Update()
|
|||
try
|
||||
{
|
||||
_playerSettings = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimePlayerSettingsDocument>("unity-inventory");
|
||||
.ReactivePlayerSettingsDocument("unity-inventory");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -313,7 +313,7 @@ public class MapRenderer : MonoBehaviour
|
|||
try
|
||||
{
|
||||
_playerSettings ??= AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimePlayerSettingsDocument>("unity-map-renderer");
|
||||
.ReactivePlayerSettingsDocument("unity-map-renderer");
|
||||
return _playerSettings?.Current?.ShowAsteroidsInMinimap ?? false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
try
|
||||
{
|
||||
_catalog = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeCatalogSnapshot>("unity-sector-renderer");
|
||||
.ReactiveCatalogSnapshot("unity-sector-renderer");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -242,7 +242,7 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
try
|
||||
{
|
||||
_playerSettings = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimePlayerSettingsDocument>("unity-sector-renderer");
|
||||
.ReactivePlayerSettingsDocument("unity-sector-renderer");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -617,7 +617,7 @@ public class TradeMenu : MonoBehaviour
|
|||
try
|
||||
{
|
||||
_catalog = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeCatalogSnapshot>("unity-trade");
|
||||
.ReactiveCatalogSnapshot("unity-trade");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -635,7 +635,7 @@ public class TradeMenu : MonoBehaviour
|
|||
try
|
||||
{
|
||||
_playerSettings = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimePlayerSettingsDocument>("unity-trade");
|
||||
.ReactivePlayerSettingsDocument("unity-trade");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ public class VolumeCloudRenderer : EffectBase
|
|||
try
|
||||
{
|
||||
_playerSettings = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimePlayerSettingsDocument>("unity-volume-cloud-renderer");
|
||||
.ReactivePlayerSettingsDocument("unity-volume-cloud-renderer");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1208,7 +1208,7 @@ public class ZoneRenderer : MonoBehaviour
|
|||
try
|
||||
{
|
||||
_catalog = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeCatalogSnapshot>("unity-zone-renderer");
|
||||
.ReactiveCatalogSnapshot("unity-zone-renderer");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue