Route input screen through managed runtime client
This commit is contained in:
parent
2df226ec16
commit
ade83e9fc9
2 changed files with 13 additions and 27 deletions
|
|
@ -4153,13 +4153,12 @@ static void RequireRuntimeInputScreenUsesEveSurface(string root)
|
|||
"AetheriaEveUnitySurfaceHost.RenderRuntime(",
|
||||
"AetheriaEveUnitySurfaceHost.Hide(_surfaceDocument)",
|
||||
"UIDocument",
|
||||
"private AetheriaClient _client",
|
||||
".Ui.InputSettingsAsync(command, body, \"unity-input-screen\")",
|
||||
"AetheriaRuntimeInputSettingsCommandBody",
|
||||
"AetheriaRuntimeEveCommandKind.SetBindingOverride",
|
||||
"AetheriaRuntimeEveCommandKind.SetActionBarEnabled",
|
||||
"AetheriaClient",
|
||||
".OpenAsync(",
|
||||
"AetheriaUnityRuntimeClientProvider.ResolveClient(",
|
||||
".Aetheria()",
|
||||
".Settings",
|
||||
".Player",
|
||||
|
|
@ -12876,6 +12875,10 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root)
|
|||
var inventoryPanel = File.Exists(inventoryPanelPath)
|
||||
? File.ReadAllText(inventoryPanelPath)
|
||||
: throw new InvalidOperationException("Cannot verify daemon state acquisition; InventoryPanel.cs is missing.");
|
||||
var inputDisplayLayoutPath = Path.Combine(root, "Assets", "Scripts", "UI", "InputScreen", "InputDisplayLayout.cs");
|
||||
var inputDisplayLayout = File.Exists(inputDisplayLayoutPath)
|
||||
? File.ReadAllText(inputDisplayLayoutPath)
|
||||
: throw new InvalidOperationException("Cannot verify daemon state acquisition; InputDisplayLayout.cs is missing.");
|
||||
var gameplayBootShellPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityGameplayBootShell.cs");
|
||||
var gameplayBootShell = File.Exists(gameplayBootShellPath)
|
||||
? File.ReadAllText(gameplayBootShellPath)
|
||||
|
|
@ -12988,7 +12991,8 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root)
|
|||
["Assets/Scripts/UI/Menu/TradeMenu.cs"] = tradeMenu,
|
||||
["Assets/Scripts/UI/Menu/InventoryMenu.cs"] = inventoryMenu,
|
||||
["Assets/Scripts/UI/Menu/InventoryPanel.cs"] = inventoryPanel,
|
||||
["Assets/Scripts/UI/MainMenu.cs"] = mainMenu
|
||||
["Assets/Scripts/UI/MainMenu.cs"] = mainMenu,
|
||||
["Assets/Scripts/UI/InputScreen/InputDisplayLayout.cs"] = inputDisplayLayout
|
||||
};
|
||||
var directClientOpenHits = providerOwnedClientAccessSources
|
||||
.Where(pair =>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using GameCult.Aetheria.EveRuntime;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
|
|
@ -14,7 +13,6 @@ public class InputDisplayLayout : MonoBehaviour
|
|||
{
|
||||
private UIDocument _surfaceDocument;
|
||||
private AetheriaInput _ownedInput;
|
||||
private AetheriaClient _client;
|
||||
private string _clientStatePath = "";
|
||||
private AetheriaRuntimePlayerSettingsDocument _playerSettings;
|
||||
private InputAction _captureAction;
|
||||
|
|
@ -96,8 +94,6 @@ public class InputDisplayLayout : MonoBehaviour
|
|||
_ownedInput?.Dispose();
|
||||
_ownedInput = null;
|
||||
|
||||
DisposeClient();
|
||||
|
||||
if (_surfaceDocument != null)
|
||||
{
|
||||
AetheriaEveUnitySurfaceHost.DestroyDocument(_surfaceDocument);
|
||||
|
|
@ -364,38 +360,24 @@ public class InputDisplayLayout : MonoBehaviour
|
|||
|
||||
private AetheriaClient ResolveClient()
|
||||
{
|
||||
var gameDataDirectory = new DirectoryInfo(Path.Combine(Application.dataPath, "..", "GameData"));
|
||||
var stateBoot = AetheriaRuntimeStateBoot.Inspect(gameDataDirectory);
|
||||
var stateBoot = AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory);
|
||||
if (!stateBoot.SupportsLocalStateFileRead || !stateBoot.StateFileExists)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
$"Input settings require a readable local Aetheria Verse state file: {stateBoot.FailureMessage}");
|
||||
}
|
||||
|
||||
if (_client != null && string.Equals(_clientStatePath, stateBoot.StateFilePath, StringComparison.Ordinal))
|
||||
if (!string.Equals(_clientStatePath, stateBoot.StateFilePath, StringComparison.Ordinal))
|
||||
{
|
||||
return _client;
|
||||
_clientStatePath = stateBoot.StateFilePath;
|
||||
ClearClientCaches();
|
||||
}
|
||||
|
||||
DisposeClient();
|
||||
_client = AetheriaClient
|
||||
.OpenAsync(
|
||||
stateBoot.StateFilePath,
|
||||
"unity-input-screen",
|
||||
"local",
|
||||
startServer: false,
|
||||
pullOnOpen: true)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
_clientStatePath = stateBoot.StateFilePath;
|
||||
return _client;
|
||||
return AetheriaUnityRuntimeClientProvider.ResolveClient(stateBoot, "unity-input-screen");
|
||||
}
|
||||
|
||||
private void DisposeClient()
|
||||
private void ClearClientCaches()
|
||||
{
|
||||
_client?.Dispose();
|
||||
_client = null;
|
||||
_clientStatePath = "";
|
||||
_playerSettings = null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue