fix(ui): restore retail vitals and window interactions
All checks were successful
CI / linux-portable (push) Successful in 3m16s
CI / windows-gate (push) Successful in 5m41s
CI / release (push) Successful in 2m5s

This commit is contained in:
Erik 2026-08-20 13:26:35 +02:00
parent 4d84456c21
commit 1bd2b30291
36 changed files with 1462 additions and 86 deletions

View file

@ -48,6 +48,27 @@ public sealed class RetailWindowLayoutPersistence : IDisposable
/// mid-drag reload would litter settings.json with intermediate-resolution
/// keys.</summary>
public void RestoreAll(bool saveBack = true)
=> RestoreAllCore(
saveBack,
restoreVisibility: true);
/// <summary>
/// Reloads the current resolution's saved geometry after a live display
/// change. Retail's <c>UI-&lt;char&gt;-&lt;world&gt;-&lt;W&gt;-&lt;H&gt;.txt</c>
/// records only X/Y/W/H; global message <c>0xE</c> therefore cannot hide
/// a window. Keeping live visibility is especially load-bearing for the Options window:
/// hiding Config while its Resolution row is still uncommitted invokes
/// <c>PlayerOptionPage::OnVisibilityChanged(false)</c> and restores the
/// previous resolution, producing a resize-out/resize-back blip.
/// </summary>
public void RestoreAfterDisplayChange()
=> RestoreAllCore(
saveBack: false,
restoreVisibility: false);
private void RestoreAllCore(
bool saveBack,
bool restoreVisibility)
{
ObjectDisposedException.ThrowIf(_disposed, this);
string character = _characterKey();
@ -72,7 +93,9 @@ public sealed class RetailWindowLayoutPersistence : IDisposable
handle,
layout,
screen,
restoreVisibility: !_stateManagedVisibilityWindows.Contains(handle.Name));
restoreVisibility:
restoreVisibility
&& !_stateManagedVisibilityWindows.Contains(handle.Name));
// Lazily migrate legacy position-only entries into the complete schema.
if (saveBack)
_store.SaveWindowLayout(character, resolution, handle.Name, Capture(handle));