Sample input settings through current typed access
This commit is contained in:
parent
6708581363
commit
2f09855ddb
2 changed files with 13 additions and 37 deletions
|
|
@ -4236,7 +4236,8 @@ static void RequireRuntimeInputScreenUsesEveSurface(string root)
|
|||
"AetheriaRuntimeEveCommandKind.SetActionBarEnabled",
|
||||
"RequireLocalStateBoot()",
|
||||
"AetheriaUnityRuntimeClientProvider",
|
||||
".ReactivePlayerSettingsDocument(",
|
||||
".RuntimeState(RequireLocalStateBoot(), \"unity-input-screen\")",
|
||||
".CurrentPlayerSettings()",
|
||||
"action.ApplyBindingOverride",
|
||||
"new InputAction(\"Aetheria Input Capture\")",
|
||||
"AetheriaRuntimeInputSettingsSurfaceBuilder.IsSupportedCapturePath(",
|
||||
|
|
@ -4255,17 +4256,13 @@ static void RequireRuntimeInputScreenUsesEveSurface(string root)
|
|||
string.Join(", ", missingInputScreenSymbols));
|
||||
}
|
||||
|
||||
RequireReactiveTypedDocumentAccess(
|
||||
inputScreen,
|
||||
"InputDisplayLayout",
|
||||
"AetheriaRuntimePlayerSettingsDocument",
|
||||
"_playerSettings",
|
||||
".ReactivePlayerSettingsDocument(",
|
||||
"AetheriaRuntimePlayerSettingsSession",
|
||||
".ObservePlayer()");
|
||||
|
||||
var forbiddenInputScreenSymbols = new[]
|
||||
{
|
||||
"CultMeshReactiveDocument<AetheriaRuntimePlayerSettingsDocument>",
|
||||
".ReactivePlayerSettingsDocument(",
|
||||
"AetheriaRuntimePlayerSettingsSession",
|
||||
".ObservePlayer()",
|
||||
"ClearClientCaches()",
|
||||
"OnPointerClickAsObservable",
|
||||
"BeginDragTrigger",
|
||||
"EndDragTrigger",
|
||||
|
|
@ -7884,7 +7881,7 @@ static void RequireUnitySharedDocumentAccessorErgonomics(string root)
|
|||
if (missingMainMenuSharedDocumentSymbols.Length > 0)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"MainMenu should bind sector, player, and Verse host state through managed reactive Aetheria documents: " +
|
||||
"MainMenu should sample sector, player, and Verse host state through named current typed Aetheria documents: " +
|
||||
string.Join(", ", missingMainMenuSharedDocumentSymbols));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ using System.Linq;
|
|||
using GameCult.Aetheria.EveRuntime;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Eve.Surface;
|
||||
using GameCult.Mesh;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.InputSystem.Utilities;
|
||||
|
|
@ -14,8 +13,6 @@ public class InputDisplayLayout : MonoBehaviour
|
|||
{
|
||||
private UIDocument _surfaceDocument;
|
||||
private AetheriaInput _ownedInput;
|
||||
private string _clientStatePath = "";
|
||||
private CultMeshReactiveDocument<AetheriaRuntimePlayerSettingsDocument> _playerSettings;
|
||||
private InputAction _captureAction;
|
||||
private InputActionAsset _input;
|
||||
private string _captureActionName = "";
|
||||
|
|
@ -95,8 +92,6 @@ public class InputDisplayLayout : MonoBehaviour
|
|||
_ownedInput?.Dispose();
|
||||
_ownedInput = null;
|
||||
|
||||
ClearClientCaches();
|
||||
|
||||
if (_surfaceDocument != null)
|
||||
{
|
||||
AetheriaEveUnitySurfaceHost.DestroyDocument(_surfaceDocument);
|
||||
|
|
@ -366,39 +361,23 @@ public class InputDisplayLayout : MonoBehaviour
|
|||
$"Input settings require a readable local Aetheria Verse state file: {stateBoot.FailureMessage}");
|
||||
}
|
||||
|
||||
if (!string.Equals(_clientStatePath, stateBoot.StateFilePath, StringComparison.Ordinal))
|
||||
{
|
||||
_clientStatePath = stateBoot.StateFilePath;
|
||||
ClearClientCaches();
|
||||
}
|
||||
|
||||
return stateBoot;
|
||||
}
|
||||
|
||||
private void ClearClientCaches()
|
||||
{
|
||||
_playerSettings?.Dispose();
|
||||
_playerSettings = null;
|
||||
}
|
||||
|
||||
private AetheriaRuntimePlayerSettingsDocument ResolvePlayerSettings()
|
||||
{
|
||||
if (_playerSettings != null)
|
||||
return _playerSettings.Current;
|
||||
|
||||
try
|
||||
{
|
||||
_playerSettings = AetheriaUnityRuntimeClientProvider
|
||||
.ReactivePlayerSettingsDocument(
|
||||
RequireLocalStateBoot(),
|
||||
"unity-input-screen");
|
||||
return AetheriaUnityRuntimeClientProvider
|
||||
.RuntimeState(RequireLocalStateBoot(), "unity-input-screen")
|
||||
.CurrentPlayerSettings();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogWarning($"Failed to bind Aetheria player settings for input screen: {ex.Message}");
|
||||
Debug.LogWarning($"Failed to read Aetheria player settings for input screen: {ex.Message}");
|
||||
}
|
||||
|
||||
return _playerSettings?.Current;
|
||||
return null;
|
||||
}
|
||||
|
||||
private void ClearCapture()
|
||||
|
|
|
|||
Loading…
Reference in a new issue