Add native reactive client state access

This commit is contained in:
Meta Vens 2026-06-29 04:18:22 +01:00
commit 296a0b6de8
26 changed files with 258 additions and 244 deletions

View file

@ -965,7 +965,7 @@ public class InventoryMenu : MonoBehaviour
try
{
_currentEntity = ResolveClient()
.State.Document<AetheriaRuntimeCurrentEntityDocument>().Reactive();
.State.Reactive<AetheriaRuntimeCurrentEntityDocument>();
}
catch (Exception ex)
{
@ -983,7 +983,7 @@ public class InventoryMenu : MonoBehaviour
try
{
_stationRefit = ResolveClient()
.State.Document<AetheriaRuntimeStationRefitDocument>().Reactive();
.State.Reactive<AetheriaRuntimeStationRefitDocument>();
}
catch (Exception ex)
{
@ -1001,9 +1001,7 @@ public class InventoryMenu : MonoBehaviour
try
{
var nextInventory = ResolveClient()
.State
.Document<AetheriaRuntimeInventoryDocument>(entityIndex)
.Reactive();
.State.Reactive<AetheriaRuntimeInventoryDocument>(entityIndex);
_inventory?.Dispose();
_inventoryEntityIndex = entityIndex;
_inventory = nextInventory;
@ -1075,7 +1073,7 @@ public class InventoryMenu : MonoBehaviour
try
{
_catalog = ResolveClient().State.Document<AetheriaRuntimeCatalogSnapshot>().Reactive();
_catalog = ResolveClient().State.Reactive<AetheriaRuntimeCatalogSnapshot>();
}
catch (Exception ex)
{
@ -1093,7 +1091,7 @@ public class InventoryMenu : MonoBehaviour
try
{
_playerSettings = ResolveClient()
.State.Document<AetheriaRuntimePlayerSettingsDocument>().Reactive();
.State.Reactive<AetheriaRuntimePlayerSettingsDocument>();
}
catch (Exception ex)
{

View file

@ -1504,7 +1504,7 @@ private void Update()
try
{
_currentEntity = ResolveClient()
.State.Document<AetheriaRuntimeCurrentEntityDocument>().Reactive();
.State.Reactive<AetheriaRuntimeCurrentEntityDocument>();
}
catch (Exception ex)
{
@ -1522,7 +1522,7 @@ private void Update()
try
{
_stationRefit = ResolveClient()
.State.Document<AetheriaRuntimeStationRefitDocument>().Reactive();
.State.Reactive<AetheriaRuntimeStationRefitDocument>();
}
catch (Exception ex)
{
@ -1547,7 +1547,7 @@ private void Update()
try
{
_loadoutFrame = ResolveClient()
.State.Document<AetheriaRuntimeDaemonFrameDocument>().Reactive();
.State.Reactive<AetheriaRuntimeDaemonFrameDocument>();
}
catch (Exception ex)
{
@ -1565,9 +1565,7 @@ private void Update()
try
{
var nextInventory = ResolveClient()
.State
.Document<AetheriaRuntimeInventoryDocument>(entityIndex)
.Reactive();
.State.Reactive<AetheriaRuntimeInventoryDocument>(entityIndex);
_inventory?.Dispose();
_inventoryEntityIndex = entityIndex;
_inventory = nextInventory;
@ -1587,7 +1585,7 @@ private void Update()
try
{
_catalog = ResolveClient().State.Document<AetheriaRuntimeCatalogSnapshot>().Reactive();
_catalog = ResolveClient().State.Reactive<AetheriaRuntimeCatalogSnapshot>();
}
catch (Exception ex)
{
@ -1605,7 +1603,7 @@ private void Update()
try
{
_playerSettings = ResolveClient()
.State.Document<AetheriaRuntimePlayerSettingsDocument>().Reactive();
.State.Reactive<AetheriaRuntimePlayerSettingsDocument>();
}
catch (Exception ex)
{

View file

@ -129,14 +129,8 @@ public class MapRenderer : MonoBehaviour
var client = ResolveClient();
var viewport = ResolveViewportBounds();
ClearViewportCaches();
_objectsViewport = client
.State
.Document<AetheriaRuntimeObjectsViewportDocument>(viewport)
.Reactive();
_renderSplatsViewport = client
.State
.Document<AetheriaRuntimeRenderSplatsViewportDocument>(viewport)
.Reactive();
_objectsViewport = client.State.Reactive<AetheriaRuntimeObjectsViewportDocument>(viewport);
_renderSplatsViewport = client.State.Reactive<AetheriaRuntimeRenderSplatsViewportDocument>(viewport);
var objectsViewport = _objectsViewport?.Current;
var zoneName = string.IsNullOrWhiteSpace(objectsViewport?.ZoneName)
@ -319,7 +313,7 @@ public class MapRenderer : MonoBehaviour
try
{
_playerSettings ??= ResolveClient()
.State.Document<AetheriaRuntimePlayerSettingsDocument>().Reactive();
.State.Reactive<AetheriaRuntimePlayerSettingsDocument>();
return _playerSettings?.Current?.ShowAsteroidsInMinimap ?? false;
}
catch (Exception ex)

View file

@ -180,7 +180,7 @@ public class MenuPanel : MonoBehaviour
docking = null;
try
{
_currentDocking ??= ResolveClient().State.Document<AetheriaRuntimeCurrentDockingDocument>().Reactive();
_currentDocking ??= ResolveClient().State.Reactive<AetheriaRuntimeCurrentDockingDocument>();
docking = _currentDocking.Current;
return docking != null;
}

View file

@ -222,7 +222,7 @@ public class SectorMap : MonoBehaviour
private void EnsureSectorMapLoaded()
{
_sectorMapDocument ??= ResolveClient()
.State.Document<AetheriaRuntimeSectorMapDocument>().Reactive();
.State.Reactive<AetheriaRuntimeSectorMapDocument>();
_sectorMap = _sectorMapDocument?.Current;
if (_sectorMapLoaded)

View file

@ -175,7 +175,7 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
try
{
_sectorMap ??= ResolveClient()
.State.Document<AetheriaRuntimeSectorMapDocument>().Reactive();
.State.Reactive<AetheriaRuntimeSectorMapDocument>();
var sectorMap = _sectorMap?.Current;
return (sectorMap?.Zones ?? Array.Empty<AetheriaRuntimeSectorMapZone>())
.FirstOrDefault(zone => zone.ZoneIndex == zoneIndex);
@ -203,9 +203,7 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
try
{
var nextZoneDetails = ResolveClient()
.State
.Document<AetheriaRuntimeZoneDetailsDocument>(zoneIndex)
.Reactive();
.State.Reactive<AetheriaRuntimeZoneDetailsDocument>(zoneIndex);
_zoneDetails?.Dispose();
_zoneDetailsIndex = zoneIndex;
_zoneDetails = nextZoneDetails;
@ -231,7 +229,7 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
try
{
_catalog = ResolveClient().State.Document<AetheriaRuntimeCatalogSnapshot>().Reactive();
_catalog = ResolveClient().State.Reactive<AetheriaRuntimeCatalogSnapshot>();
}
catch (Exception ex)
{
@ -249,7 +247,7 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
try
{
_playerSettings = ResolveClient()
.State.Document<AetheriaRuntimePlayerSettingsDocument>().Reactive();
.State.Reactive<AetheriaRuntimePlayerSettingsDocument>();
}
catch (Exception ex)
{
@ -320,7 +318,7 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
try
{
_currentZone ??= ResolveClient()
.State.Document<AetheriaRuntimeCurrentZoneDocument>().Reactive();
.State.Reactive<AetheriaRuntimeCurrentZoneDocument>();
}
catch (Exception ex)
{

View file

@ -518,7 +518,7 @@ public class TradeMenu : MonoBehaviour
try
{
_stationRefit = ResolveClient().State.Document<AetheriaRuntimeStationRefitDocument>().Reactive();
_stationRefit = ResolveClient().State.Reactive<AetheriaRuntimeStationRefitDocument>();
}
catch (Exception ex)
{
@ -533,7 +533,7 @@ public class TradeMenu : MonoBehaviour
docking = null;
try
{
_currentDocking ??= ResolveClient().State.Document<AetheriaRuntimeCurrentDockingDocument>().Reactive();
_currentDocking ??= ResolveClient().State.Reactive<AetheriaRuntimeCurrentDockingDocument>();
docking = _currentDocking.Current;
return docking != null;
}
@ -627,7 +627,7 @@ public class TradeMenu : MonoBehaviour
try
{
_catalog = ResolveClient().State.Document<AetheriaRuntimeCatalogSnapshot>().Reactive();
_catalog = ResolveClient().State.Reactive<AetheriaRuntimeCatalogSnapshot>();
}
catch (Exception ex)
{
@ -645,7 +645,7 @@ public class TradeMenu : MonoBehaviour
try
{
_playerSettings = ResolveClient()
.State.Document<AetheriaRuntimePlayerSettingsDocument>().Reactive();
.State.Reactive<AetheriaRuntimePlayerSettingsDocument>();
}
catch (Exception ex)
{