Use Aetheria state handles for current entity UI reads
This commit is contained in:
parent
e08c9e9c3c
commit
2884cef870
4 changed files with 37 additions and 10 deletions
|
|
@ -73,7 +73,7 @@ public class SchematicDisplay : MonoBehaviour
|
|||
private string _clientStatePath = "";
|
||||
private AetheriaRuntimeCatalogSnapshot _catalog;
|
||||
private AetheriaRuntimePlayerSettingsSnapshot _playerSettings;
|
||||
private AetheriaRuntimeDaemonRenderSettings _renderSettings;
|
||||
private AetheriaRuntimeDaemonRenderSettings? _renderSettings;
|
||||
private AetheriaRuntimeCurrentEntityDocument _currentEntityDocument;
|
||||
private float _currentEntityDocumentReadTime = float.NegativeInfinity;
|
||||
private const float CurrentEntityHudRefreshIntervalSeconds = 0.1f;
|
||||
|
|
@ -210,7 +210,7 @@ public class SchematicDisplay : MonoBehaviour
|
|||
HeatstrokeMeterFill.anchorMax = new Vector2((float)hud.Heatstroke, 1);
|
||||
HypothermiaMeterFill.anchorMax = new Vector2((float)hud.Hypothermia, 1);
|
||||
HeatstrokeLimitFill.anchorMax = new Vector2(
|
||||
(float)(_renderSettings.NormalizeThermalRisk(_cockpit.Item.Temperature)),
|
||||
(float)(_renderSettings?.NormalizeThermalRisk(_cockpit.Item.Temperature) ?? 0.0),
|
||||
1);
|
||||
}
|
||||
|
||||
|
|
@ -367,7 +367,10 @@ public class SchematicDisplay : MonoBehaviour
|
|||
try
|
||||
{
|
||||
_currentEntityDocument = ResolveClient()
|
||||
.CurrentEntityAsync()
|
||||
.Aetheria()
|
||||
.Current
|
||||
.Entity
|
||||
.LatestAsync()
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -784,7 +784,10 @@ public class InventoryMenu : MonoBehaviour
|
|||
try
|
||||
{
|
||||
currentEntity = ResolveClient()
|
||||
.CurrentEntityAsync()
|
||||
.Aetheria()
|
||||
.Current
|
||||
.Entity
|
||||
.LatestAsync()
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
}
|
||||
|
|
@ -866,7 +869,10 @@ public class InventoryMenu : MonoBehaviour
|
|||
try
|
||||
{
|
||||
var current = ResolveClient()
|
||||
.CurrentEntityAsync()
|
||||
.Aetheria()
|
||||
.Current
|
||||
.Entity
|
||||
.LatestAsync()
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
if (current != null && string.Equals(current.EntityKey, entityKey, StringComparison.Ordinal))
|
||||
|
|
|
|||
|
|
@ -1136,7 +1136,10 @@ private void Update()
|
|||
try
|
||||
{
|
||||
currentEntityKey = ResolveClient()
|
||||
.CurrentEntityAsync()
|
||||
.Aetheria()
|
||||
.Current
|
||||
.Entity
|
||||
.LatestAsync()
|
||||
.GetAwaiter()
|
||||
.GetResult()
|
||||
?.EntityKey ?? "";
|
||||
|
|
@ -1287,7 +1290,10 @@ private void Update()
|
|||
try
|
||||
{
|
||||
var current = ResolveClient()
|
||||
.CurrentEntityAsync()
|
||||
.Aetheria()
|
||||
.Current
|
||||
.Entity
|
||||
.LatestAsync()
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
if (current != null && string.Equals(current.EntityKey, entityKey, StringComparison.Ordinal))
|
||||
|
|
|
|||
Loading…
Reference in a new issue