feat(render): implement Campaign AR and terrain fidelity

This commit is contained in:
Erik 2026-08-22 13:13:29 +02:00
parent 99cf26e00c
commit 7a5f96ede5
368 changed files with 50611 additions and 950 deletions

View file

@ -678,6 +678,24 @@ public sealed class OptionPage
_rows.Add(row);
}
/// <summary>
/// Detaches a dynamically-owned suffix while preserving the registered
/// prefix. Detached rows no longer participate in Apply/Reset/Defaults and
/// their page-notify callback is severed, so retained widgets removed from
/// the visual tree cannot keep this page alive or re-arm its buttons.
/// </summary>
public void RemoveTail(int retainedRowCount)
{
if (retainedRowCount < 0 || retainedRowCount > _rows.Count)
throw new ArgumentOutOfRangeException(nameof(retainedRowCount));
for (int i = _rows.Count - 1; i >= retainedRowCount; i--)
{
_rows[i].AttachPageNotify(static () => { });
_rows.RemoveAt(i);
}
OnOptionChanged?.Invoke();
}
/// <summary><c>OptionPage::Changed @0x004F2D60</c>: true if ANY
/// registered row's own <see cref="IOptionRow.Changed"/> is true.</summary>
public bool Changed => _rows.Any(static row => row.Changed);
@ -687,8 +705,9 @@ public sealed class OptionPage
/// <see cref="AfterApply"/>, then re-evaluates <see cref="OnOptionChanged"/>.</summary>
public void Apply()
{
foreach (IOptionRow row in _rows)
row.SaveCurrentValue();
foreach (IOptionRow row in _rows.ToArray())
if (_rows.Contains(row))
row.SaveCurrentValue();
AfterApply?.Invoke();
OnOptionChanged?.Invoke();
}
@ -702,7 +721,8 @@ public sealed class OptionPage
public void Reset()
{
foreach (IOptionRow row in _rows.Where(static row => row.Changed).ToArray())
row.RestoreSavedValue();
if (_rows.Contains(row))
row.RestoreSavedValue();
OnOptionChanged?.Invoke();
}
@ -711,8 +731,9 @@ public sealed class OptionPage
/// committing, then re-evaluates <see cref="OnOptionChanged"/>.</summary>
public void Defaults()
{
foreach (IOptionRow row in _rows)
row.RestoreDefaultValue();
foreach (IOptionRow row in _rows.ToArray())
if (_rows.Contains(row))
row.RestoreDefaultValue();
OnOptionChanged?.Invoke();
}
@ -735,8 +756,9 @@ public sealed class OptionPage
/// </summary>
public void ReloadFromLive()
{
foreach (IOptionRow row in _rows)
row.SaveCurrentValue();
foreach (IOptionRow row in _rows.ToArray())
if (_rows.Contains(row))
row.SaveCurrentValue();
OnOptionChanged?.Invoke();
}