Expose native Unity runtime state access
This commit is contained in:
parent
870b619157
commit
d10da01a69
10 changed files with 166 additions and 210 deletions
|
|
@ -31,7 +31,6 @@ public class InventoryMenu : MonoBehaviour
|
|||
private UIDocument _shipSettingsSurfaceDocument;
|
||||
private UIDocument _cargoItemDetailsSurfaceDocument;
|
||||
private UIDocument _equippedItemDetailsSurfaceDocument;
|
||||
private string _clientStatePath = "";
|
||||
private CultMeshReactiveDocument<AetheriaRuntimeCatalogSnapshot> _catalog;
|
||||
private CultMeshReactiveDocument<AetheriaRuntimePlayerSettingsDocument> _playerSettings;
|
||||
private CultMeshReactiveDocument<AetheriaRuntimeCurrentEntityDocument> _currentEntity;
|
||||
|
|
@ -898,7 +897,7 @@ public class InventoryMenu : MonoBehaviour
|
|||
|
||||
try
|
||||
{
|
||||
submit(ResolveClient().Control);
|
||||
submit(AetheriaUnityRuntimeClientProvider.Control("unity-inventory-menu"));
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
@ -908,18 +907,6 @@ public class InventoryMenu : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
private AetheriaClient ResolveClient()
|
||||
{
|
||||
var stateBoot = AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory);
|
||||
if (!string.Equals(_clientStatePath, stateBoot.StateFilePath, StringComparison.Ordinal))
|
||||
{
|
||||
_clientStatePath = stateBoot.StateFilePath;
|
||||
ClearClientCaches();
|
||||
}
|
||||
|
||||
return AetheriaUnityRuntimeClientProvider.ResolveClient(stateBoot, "unity-inventory-menu");
|
||||
}
|
||||
|
||||
private void ClearClientCaches()
|
||||
{
|
||||
_catalog?.Dispose();
|
||||
|
|
@ -944,8 +931,8 @@ public class InventoryMenu : MonoBehaviour
|
|||
|
||||
try
|
||||
{
|
||||
_currentEntity = ResolveClient()
|
||||
.State.Reactive<AetheriaRuntimeCurrentEntityDocument>();
|
||||
_currentEntity = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeCurrentEntityDocument>("unity-inventory-menu");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -962,8 +949,8 @@ public class InventoryMenu : MonoBehaviour
|
|||
|
||||
try
|
||||
{
|
||||
_stationRefit = ResolveClient()
|
||||
.State.Reactive<AetheriaRuntimeStationRefitDocument>();
|
||||
_stationRefit = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeStationRefitDocument>("unity-inventory-menu");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -980,8 +967,9 @@ public class InventoryMenu : MonoBehaviour
|
|||
|
||||
try
|
||||
{
|
||||
var nextInventory = ResolveClient()
|
||||
.State.Reactive<AetheriaRuntimeInventoryDocument>(entityIndex);
|
||||
var nextInventory = AetheriaUnityRuntimeClientProvider
|
||||
.RuntimeState("unity-inventory-menu")
|
||||
.Reactive<AetheriaRuntimeInventoryDocument>(entityIndex);
|
||||
_inventory?.Dispose();
|
||||
_inventoryEntityIndex = entityIndex;
|
||||
_inventory = nextInventory;
|
||||
|
|
@ -1053,7 +1041,8 @@ public class InventoryMenu : MonoBehaviour
|
|||
|
||||
try
|
||||
{
|
||||
_catalog = ResolveClient().State.Reactive<AetheriaRuntimeCatalogSnapshot>();
|
||||
_catalog = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeCatalogSnapshot>("unity-inventory-menu");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -1070,8 +1059,8 @@ public class InventoryMenu : MonoBehaviour
|
|||
|
||||
try
|
||||
{
|
||||
_playerSettings = ResolveClient()
|
||||
.State.Reactive<AetheriaRuntimePlayerSettingsDocument>();
|
||||
_playerSettings = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimePlayerSettingsDocument>("unity-inventory-menu");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -108,7 +108,6 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler
|
|||
private int _clickCount;
|
||||
private InventoryCell _clickCell;
|
||||
private float _clickTime;
|
||||
private string _clientStatePath = "";
|
||||
private CultMeshReactiveDocument<AetheriaRuntimeCatalogSnapshot> _catalog;
|
||||
private CultMeshReactiveDocument<AetheriaRuntimePlayerSettingsDocument> _playerSettings;
|
||||
private CultMeshReactiveDocument<AetheriaRuntimeCurrentEntityDocument> _currentEntity;
|
||||
|
|
@ -1080,7 +1079,7 @@ private void Update()
|
|||
|
||||
try
|
||||
{
|
||||
var client = ResolveClient();
|
||||
var client = AetheriaUnityRuntimeClientProvider.RuntimeClient("unity-inventory");
|
||||
var loadout = CreateLoadoutTemplate(targetEntityKey);
|
||||
if (loadout?.RootEntity == null || string.IsNullOrWhiteSpace(loadout.RootEntity.Hull?.ItemKey ?? ""))
|
||||
return;
|
||||
|
|
@ -1455,7 +1454,7 @@ private void Update()
|
|||
|
||||
try
|
||||
{
|
||||
submit(ResolveClient().Control);
|
||||
submit(AetheriaUnityRuntimeClientProvider.Control("unity-inventory"));
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
@ -1465,18 +1464,6 @@ private void Update()
|
|||
}
|
||||
}
|
||||
|
||||
private AetheriaClient ResolveClient()
|
||||
{
|
||||
var stateBoot = AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory);
|
||||
if (!string.Equals(_clientStatePath, stateBoot.StateFilePath, StringComparison.Ordinal))
|
||||
{
|
||||
_clientStatePath = stateBoot.StateFilePath;
|
||||
ClearClientCaches();
|
||||
}
|
||||
|
||||
return AetheriaUnityRuntimeClientProvider.ResolveClient(stateBoot, "unity-inventory");
|
||||
}
|
||||
|
||||
private void ClearClientCaches()
|
||||
{
|
||||
_catalog?.Dispose();
|
||||
|
|
@ -1503,8 +1490,8 @@ private void Update()
|
|||
|
||||
try
|
||||
{
|
||||
_currentEntity = ResolveClient()
|
||||
.State.Reactive<AetheriaRuntimeCurrentEntityDocument>();
|
||||
_currentEntity = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeCurrentEntityDocument>("unity-inventory");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -1521,8 +1508,8 @@ private void Update()
|
|||
|
||||
try
|
||||
{
|
||||
_stationRefit = ResolveClient()
|
||||
.State.Reactive<AetheriaRuntimeStationRefitDocument>();
|
||||
_stationRefit = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeStationRefitDocument>("unity-inventory");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -1546,8 +1533,8 @@ private void Update()
|
|||
|
||||
try
|
||||
{
|
||||
_loadoutFrame = ResolveClient()
|
||||
.State.Reactive<AetheriaRuntimeDaemonFrameDocument>();
|
||||
_loadoutFrame = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeDaemonFrameDocument>("unity-inventory");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -1564,8 +1551,9 @@ private void Update()
|
|||
|
||||
try
|
||||
{
|
||||
var nextInventory = ResolveClient()
|
||||
.State.Reactive<AetheriaRuntimeInventoryDocument>(entityIndex);
|
||||
var nextInventory = AetheriaUnityRuntimeClientProvider
|
||||
.RuntimeState("unity-inventory")
|
||||
.Reactive<AetheriaRuntimeInventoryDocument>(entityIndex);
|
||||
_inventory?.Dispose();
|
||||
_inventoryEntityIndex = entityIndex;
|
||||
_inventory = nextInventory;
|
||||
|
|
@ -1585,7 +1573,8 @@ private void Update()
|
|||
|
||||
try
|
||||
{
|
||||
_catalog = ResolveClient().State.Reactive<AetheriaRuntimeCatalogSnapshot>();
|
||||
_catalog = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeCatalogSnapshot>("unity-inventory");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -1602,8 +1591,8 @@ private void Update()
|
|||
|
||||
try
|
||||
{
|
||||
_playerSettings = ResolveClient()
|
||||
.State.Reactive<AetheriaRuntimePlayerSettingsDocument>();
|
||||
_playerSettings = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimePlayerSettingsDocument>("unity-inventory");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ public class LocalMenu : MonoBehaviour
|
|||
private readonly AetheriaEveUnitySurfaceChrome _surfaceChrome = new AetheriaEveUnitySurfaceChrome();
|
||||
private AetheriaUnityObservedEntityIndex _observedEntityIndex;
|
||||
private AetheriaUnityObservedDockingIndex _observedDockingIndex;
|
||||
private string _clientStatePath = "";
|
||||
|
||||
public void SetObservedEntityIndex(AetheriaUnityObservedEntityIndex observedEntityIndex)
|
||||
{
|
||||
|
|
@ -224,23 +223,12 @@ public class LocalMenu : MonoBehaviour
|
|||
if (_observedEntityIndex == null)
|
||||
return false;
|
||||
|
||||
dockingIndex = _observedDockingIndex ??= new AetheriaUnityObservedDockingIndex(ResolveClient, _observedEntityIndex);
|
||||
dockingIndex = _observedDockingIndex ??= new AetheriaUnityObservedDockingIndex(
|
||||
() => AetheriaUnityRuntimeClientProvider.RuntimeClient("unity-runtime-local-story"),
|
||||
_observedEntityIndex);
|
||||
return true;
|
||||
}
|
||||
|
||||
private AetheriaClient ResolveClient()
|
||||
{
|
||||
var stateBoot = AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory);
|
||||
if (!string.Equals(_clientStatePath, stateBoot.StateFilePath, StringComparison.Ordinal))
|
||||
{
|
||||
_clientStatePath = stateBoot.StateFilePath;
|
||||
_observedDockingIndex?.Dispose();
|
||||
_observedDockingIndex = null;
|
||||
}
|
||||
|
||||
return AetheriaUnityRuntimeClientProvider.ResolveClient(stateBoot, "unity-runtime-local-story");
|
||||
}
|
||||
|
||||
private void HideStorySurface()
|
||||
{
|
||||
if (_surfaceDocument == null)
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ public class MapRenderer : MonoBehaviour
|
|||
private CultMeshReactiveDocument<AetheriaRuntimeRenderSplatsViewportDocument> _renderSplatsViewport;
|
||||
private float _nextViewportRefreshTime;
|
||||
private readonly List<RawImage> _rtsIconPool = new List<RawImage>();
|
||||
private string _clientStatePath = "";
|
||||
private CultMeshReactiveDocument<AetheriaRuntimePlayerSettingsDocument> _playerSettings;
|
||||
|
||||
void Start()
|
||||
|
|
@ -126,11 +125,12 @@ public class MapRenderer : MonoBehaviour
|
|||
_nextViewportRefreshTime = Time.unscaledTime + .5f;
|
||||
try
|
||||
{
|
||||
var client = ResolveClient();
|
||||
var viewport = ResolveViewportBounds();
|
||||
ClearViewportCaches();
|
||||
_objectsViewport = client.State.Reactive<AetheriaRuntimeObjectsViewportDocument>(viewport);
|
||||
_renderSplatsViewport = client.State.Reactive<AetheriaRuntimeRenderSplatsViewportDocument>(viewport);
|
||||
_objectsViewport = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeObjectsViewportDocument>(viewport, "unity-map-renderer");
|
||||
_renderSplatsViewport = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeRenderSplatsViewportDocument>(viewport, "unity-map-renderer");
|
||||
|
||||
var objectsViewport = _objectsViewport?.Current;
|
||||
var zoneName = string.IsNullOrWhiteSpace(objectsViewport?.ZoneName)
|
||||
|
|
@ -312,8 +312,8 @@ public class MapRenderer : MonoBehaviour
|
|||
{
|
||||
try
|
||||
{
|
||||
_playerSettings ??= ResolveClient()
|
||||
.State.Reactive<AetheriaRuntimePlayerSettingsDocument>();
|
||||
_playerSettings ??= AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimePlayerSettingsDocument>("unity-map-renderer");
|
||||
return _playerSettings?.Current?.ShowAsteroidsInMinimap ?? false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
@ -323,20 +323,6 @@ public class MapRenderer : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
private AetheriaClient ResolveClient()
|
||||
{
|
||||
var stateBoot = AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory);
|
||||
if (!string.Equals(_clientStatePath, stateBoot.StateFilePath, StringComparison.Ordinal))
|
||||
{
|
||||
_clientStatePath = stateBoot.StateFilePath;
|
||||
ClearClientCaches();
|
||||
}
|
||||
|
||||
return AetheriaUnityRuntimeClientProvider.ResolveClient(
|
||||
stateBoot,
|
||||
"unity-map-renderer");
|
||||
}
|
||||
|
||||
private void ClearClientCaches()
|
||||
{
|
||||
ClearViewportCaches();
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ public class MenuPanel : MonoBehaviour
|
|||
private MenuTabBinding _current;
|
||||
private UIDocument _tabSurfaceDocument;
|
||||
private readonly AetheriaEveUnitySurfaceChrome _tabSurfaceChrome = new AetheriaEveUnitySurfaceChrome();
|
||||
private string _clientStatePath = "";
|
||||
private CultMeshReactiveDocument<AetheriaRuntimeCurrentDockingDocument> _currentDocking;
|
||||
|
||||
public MenuTab CurrentTab { get; private set; }
|
||||
|
|
@ -173,7 +172,8 @@ public class MenuPanel : MonoBehaviour
|
|||
docking = null;
|
||||
try
|
||||
{
|
||||
_currentDocking ??= ResolveClient().State.Reactive<AetheriaRuntimeCurrentDockingDocument>();
|
||||
_currentDocking ??= AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeCurrentDockingDocument>("unity-runtime-menu-tabs");
|
||||
docking = _currentDocking.Current;
|
||||
return docking != null;
|
||||
}
|
||||
|
|
@ -184,17 +184,6 @@ public class MenuPanel : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
private AetheriaClient ResolveClient()
|
||||
{
|
||||
var stateBoot = AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory);
|
||||
if (!string.Equals(_clientStatePath, stateBoot.StateFilePath, StringComparison.Ordinal))
|
||||
{
|
||||
_clientStatePath = stateBoot.StateFilePath;
|
||||
}
|
||||
|
||||
return AetheriaUnityRuntimeClientProvider.ResolveClient(stateBoot, "unity-runtime-menu-tabs");
|
||||
}
|
||||
|
||||
private static string GetTabLabel(MenuTabBinding tabBinding)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(tabBinding.Label)
|
||||
|
|
|
|||
|
|
@ -221,8 +221,8 @@ public class SectorMap : MonoBehaviour
|
|||
|
||||
private void EnsureSectorMapLoaded()
|
||||
{
|
||||
_sectorMapDocument ??= ResolveClient()
|
||||
.State.Reactive<AetheriaRuntimeSectorMapDocument>();
|
||||
_sectorMapDocument ??= AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeSectorMapDocument>("unity-sector-map");
|
||||
_sectorMap = _sectorMapDocument?.Current;
|
||||
|
||||
if (_sectorMapLoaded)
|
||||
|
|
@ -497,13 +497,6 @@ public class SectorMap : MonoBehaviour
|
|||
InfluenceCamera.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
private AetheriaClient ResolveClient()
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.ResolveClient(
|
||||
AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory),
|
||||
"unity-sector-map");
|
||||
}
|
||||
|
||||
private static float2 Position(AetheriaRuntimeSectorMapZone zone)
|
||||
{
|
||||
return new float2((float)zone.X, (float)zone.Y);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
private float _sectorBackgroundDepth;
|
||||
private float _sectorCameraDepth;
|
||||
private UIDocument _zoneDetailsSurfaceDocument;
|
||||
private string _clientStatePath = "";
|
||||
private CultMeshReactiveDocument<AetheriaRuntimeCatalogSnapshot> _catalog;
|
||||
private CultMeshReactiveDocument<AetheriaRuntimePlayerSettingsDocument> _playerSettings;
|
||||
private CultMeshReactiveDocument<AetheriaRuntimeSectorMapDocument> _sectorMap;
|
||||
|
|
@ -169,8 +168,8 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
|
||||
try
|
||||
{
|
||||
_sectorMap ??= ResolveClient()
|
||||
.State.Reactive<AetheriaRuntimeSectorMapDocument>();
|
||||
_sectorMap ??= AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeSectorMapDocument>("unity-sector-renderer");
|
||||
var sectorMap = _sectorMap?.Current;
|
||||
return (sectorMap?.Zones ?? Array.Empty<AetheriaRuntimeSectorMapZone>())
|
||||
.FirstOrDefault(zone => zone.ZoneIndex == zoneIndex);
|
||||
|
|
@ -197,8 +196,8 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
|
||||
try
|
||||
{
|
||||
var nextZoneDetails = ResolveClient()
|
||||
.State.Reactive<AetheriaRuntimeZoneDetailsDocument>(zoneIndex);
|
||||
var nextZoneDetails = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeZoneDetailsDocument>(zoneIndex, "unity-sector-renderer");
|
||||
_zoneDetails?.Dispose();
|
||||
_zoneDetailsIndex = zoneIndex;
|
||||
_zoneDetails = nextZoneDetails;
|
||||
|
|
@ -224,7 +223,8 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
|
||||
try
|
||||
{
|
||||
_catalog = ResolveClient().State.Reactive<AetheriaRuntimeCatalogSnapshot>();
|
||||
_catalog = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeCatalogSnapshot>("unity-sector-renderer");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -241,8 +241,8 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
|
||||
try
|
||||
{
|
||||
_playerSettings = ResolveClient()
|
||||
.State.Reactive<AetheriaRuntimePlayerSettingsDocument>();
|
||||
_playerSettings = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimePlayerSettingsDocument>("unity-sector-renderer");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -267,18 +267,6 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
: formatted;
|
||||
}
|
||||
|
||||
private AetheriaClient ResolveClient()
|
||||
{
|
||||
var stateBoot = AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory);
|
||||
if (!string.Equals(_clientStatePath, stateBoot.StateFilePath, StringComparison.Ordinal))
|
||||
{
|
||||
_clientStatePath = stateBoot.StateFilePath;
|
||||
ClearClientCaches();
|
||||
}
|
||||
|
||||
return AetheriaUnityRuntimeClientProvider.ResolveClient(stateBoot, "unity-sector-renderer");
|
||||
}
|
||||
|
||||
private void ClearClientCaches()
|
||||
{
|
||||
_catalog?.Dispose();
|
||||
|
|
@ -312,8 +300,8 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
{
|
||||
try
|
||||
{
|
||||
_currentZone ??= ResolveClient()
|
||||
.State.Reactive<AetheriaRuntimeCurrentZoneDocument>();
|
||||
_currentZone ??= AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeCurrentZoneDocument>("unity-sector-renderer");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ public class TradeMenu : MonoBehaviour
|
|||
private UIDocument _filterSurfaceDocument;
|
||||
private UIDocument _rowActionSurfaceDocument;
|
||||
private UIDocument _tradeItemSurfaceDocument;
|
||||
private string _clientStatePath = "";
|
||||
private CultMeshReactiveDocument<AetheriaRuntimeCatalogSnapshot> _catalog;
|
||||
private CultMeshReactiveDocument<AetheriaRuntimePlayerSettingsDocument> _playerSettings;
|
||||
private CultMeshReactiveDocument<AetheriaRuntimeCurrentDockingDocument> _currentDocking;
|
||||
|
|
@ -518,7 +517,8 @@ public class TradeMenu : MonoBehaviour
|
|||
|
||||
try
|
||||
{
|
||||
_stationRefit = ResolveClient().State.Reactive<AetheriaRuntimeStationRefitDocument>();
|
||||
_stationRefit = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeStationRefitDocument>("unity-trade");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -533,7 +533,8 @@ public class TradeMenu : MonoBehaviour
|
|||
docking = null;
|
||||
try
|
||||
{
|
||||
_currentDocking ??= ResolveClient().State.Reactive<AetheriaRuntimeCurrentDockingDocument>();
|
||||
_currentDocking ??= AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeCurrentDockingDocument>("unity-trade");
|
||||
docking = _currentDocking.Current;
|
||||
return docking != null;
|
||||
}
|
||||
|
|
@ -585,7 +586,7 @@ public class TradeMenu : MonoBehaviour
|
|||
|
||||
try
|
||||
{
|
||||
submit(ResolveClient().Control);
|
||||
submit(AetheriaUnityRuntimeClientProvider.Control("unity-trade"));
|
||||
InvalidateStationRefit();
|
||||
return true;
|
||||
}
|
||||
|
|
@ -596,18 +597,6 @@ public class TradeMenu : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
private AetheriaClient ResolveClient()
|
||||
{
|
||||
var stateBoot = AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory);
|
||||
if (!string.Equals(_clientStatePath, stateBoot.StateFilePath, StringComparison.Ordinal))
|
||||
{
|
||||
_clientStatePath = stateBoot.StateFilePath;
|
||||
ClearClientCaches();
|
||||
}
|
||||
|
||||
return AetheriaUnityRuntimeClientProvider.ResolveClient(stateBoot, "unity-trade");
|
||||
}
|
||||
|
||||
private void ClearClientCaches()
|
||||
{
|
||||
_catalog?.Dispose();
|
||||
|
|
@ -627,7 +616,8 @@ public class TradeMenu : MonoBehaviour
|
|||
|
||||
try
|
||||
{
|
||||
_catalog = ResolveClient().State.Reactive<AetheriaRuntimeCatalogSnapshot>();
|
||||
_catalog = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimeCatalogSnapshot>("unity-trade");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -644,8 +634,8 @@ public class TradeMenu : MonoBehaviour
|
|||
|
||||
try
|
||||
{
|
||||
_playerSettings = ResolveClient()
|
||||
.State.Reactive<AetheriaRuntimePlayerSettingsDocument>();
|
||||
_playerSettings = AetheriaUnityRuntimeClientProvider
|
||||
.Reactive<AetheriaRuntimePlayerSettingsDocument>("unity-trade");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue