Wait for daemon ship settings state

This commit is contained in:
Meta Vens 2026-06-21 13:40:29 +01:00
commit 0f1e8e38df
2 changed files with 12 additions and 3 deletions

View file

@ -8723,6 +8723,18 @@ static void RequireRuntimeSimulationTuningRequests(string root)
string.Join("; ", hits));
}
var inventoryMenuPath = Path.Combine(root, "Assets", "Scripts", "UI", "Menu", "InventoryMenu.cs");
var inventoryMenu = File.Exists(inventoryMenuPath)
? File.ReadAllText(inventoryMenuPath)
: throw new InvalidOperationException("Cannot verify runtime simulation tuning authority; InventoryMenu.cs is missing.");
var shutdownRequest = inventoryMenu.IndexOf("GameManager.RequestEntityShutdownPerformance", StringComparison.Ordinal);
var staleShipSettingsRender = inventoryMenu.IndexOf("RenderCurrentShipSettingsSurface(entity);", shutdownRequest, StringComparison.Ordinal);
if (shutdownRequest >= 0 && staleShipSettingsRender >= 0)
{
throw new InvalidOperationException(
"InventoryMenu still redraws ship settings immediately after submitting daemon shutdown-performance requests.");
}
var forbiddenUnityAcceptanceSymbols = new[]
{
"entity?.Settings == null",

View file

@ -202,19 +202,16 @@ public class InventoryMenu : MonoBehaviour
GameManager.RequestEntityShutdownPerformance(
entity,
Mathf.Clamp01(entity.Settings.ShutdownPerformance - ShutdownThresholdStep));
RenderCurrentShipSettingsSurface(entity);
return;
case AetheriaRuntimeShipSettingsCommandKind.IncrementShutdownThreshold:
GameManager.RequestEntityShutdownPerformance(
entity,
Mathf.Clamp01(entity.Settings.ShutdownPerformance + ShutdownThresholdStep));
RenderCurrentShipSettingsSurface(entity);
return;
case AetheriaRuntimeShipSettingsCommandKind.ResetShutdownThreshold:
GameManager.RequestEntityShutdownPerformance(
entity,
Mathf.Clamp01(GameManager.Settings.GameplaySettings.DefaultShutdownPerformance));
RenderCurrentShipSettingsSurface(entity);
return;
case AetheriaRuntimeShipSettingsCommandKind.Close:
HideCurrentShipSettingsSurface();