// LIVE FIX TEST — paste into UnityExplorer's C# Console while running at ultrawide.
// Applies both candidate fixes immediately so you can see the result on screen.
// Nothing is persisted: relaunching the game reverts everything.

var log = new System.Text.StringBuilder();

// ---- FIX 1: HUD scaling ----------------------------------------------------
// CanvasScaler.matchWidthOrHeight: 0 = scale by WIDTH, 1 = scale by HEIGHT.
// The game ships 0.453 (width-biased), which balloons the HUD at 5120px wide.
// Matching HEIGHT keeps the HUD the same physical size as it is at 16:9.
foreach (var cs in UnityEngine.Object.FindObjectsOfType<UnityEngine.UI.CanvasScaler>())
{
    log.AppendLine($"UI {cs.name}: match {cs.matchWidthOrHeight} -> 1.0");
    cs.matchWidthOrHeight = 1f;
}

// ---- FIX 2: orthographic view width ---------------------------------------
// For an ortho camera, visible height = 2*orthographicSize and width follows
// aspect. If the game shrank orthographicSize at ultrawide, restoring the 16:9
// value gives back the vertical view (true Hor+).
// Set TARGET_ORTHO to the size you measured at 1920x1080; leave null to only report.
float? TARGET_ORTHO = null;   // e.g. 5.5f

foreach (var c in UnityEngine.Object.FindObjectsOfType<UnityEngine.Camera>())
{
    if (!c.orthographic) continue;
    log.AppendLine($"CAM {c.name}: orthoSize={c.orthographicSize:F4} aspect={c.aspect:F4} " +
        $"visibleW={2f * c.orthographicSize * c.aspect:F3} visibleH={2f * c.orthographicSize:F3}");
    if (TARGET_ORTHO.HasValue)
    {
        c.orthographicSize = TARGET_ORTHO.Value;
        log.AppendLine($"    -> forced orthoSize={TARGET_ORTHO.Value}");
    }
}

UnityExplorer.ExplorerCore.Log(log.ToString());
