Show the eu07.ini key on every settings row

This commit is contained in:
maj00r
2026-09-04 21:21:14 +02:00
parent 964884bd56
commit e969137824
6 changed files with 284 additions and 78 deletions

View File

@@ -15,6 +15,7 @@ using Avalonia.Markup.Xaml.Styling;
using Avalonia.Media;
using StarterNG.Classes;
using StarterNG.Controls;
using StarterNG.Infrastructure.Settings;
using StarterNG.Infrastructure;
using StarterNG.Services;
@@ -64,6 +65,7 @@ public partial class Settings : UserControl, ISettingsCapture
AppServices.Current.SettingsStore.RegisterCapture(this);
AnnotateConfigKeys();
PopulateProfileCombo();
ApplyToUi();
@@ -160,6 +162,19 @@ public partial class Settings : UserControl, ISettingsCapture
public void ReloadFromSettings() => ApplyToUi();
/// <summary>
/// Expands each row's eu07.ini key into "key = default (range)", so the line
/// under a setting says what the file holds rather than paraphrasing what the
/// setting does.
/// </summary>
private void AnnotateConfigKeys()
{
// Logical, not visual: the rows exist as soon as the XAML is loaded,
// while categories that are not on screen yet have no visual tree.
foreach (var row in this.GetLogicalDescendants().OfType<SettingRow>())
row.ConfigKey = SettingKeyCatalog.Annotate(row.ConfigKey);
}
private void ApplyToUi()
{
var s = AppServices.Current.Settings;