From bce008f0edcfd41b69a5a24a88b94daa5e2f20fe Mon Sep 17 00:00:00 2001 From: maj00r Date: Fri, 4 Sep 2026 21:36:13 +0200 Subject: [PATCH] Stop printing a default for text-valued setting keys An absent lang key does not mean English, it means follow the system language. --- StarterNG.Tests/SettingKeyCatalogTests.cs | 10 ++++++++++ StarterNG/Infrastructure/Settings/SettingKeyCatalog.cs | 10 ++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/StarterNG.Tests/SettingKeyCatalogTests.cs b/StarterNG.Tests/SettingKeyCatalogTests.cs index 440ba81..94c4853 100644 --- a/StarterNG.Tests/SettingKeyCatalogTests.cs +++ b/StarterNG.Tests/SettingKeyCatalogTests.cs @@ -18,6 +18,16 @@ public class SettingKeyCatalogTests Assert.Equal("vsync = false", SettingKeyCatalog.Annotate("vsync")); } + [Fact] + public void A_text_valued_key_is_shown_without_a_default() + { + // An absent lang means "follow the operating system", not "English", and an + // absent exe path means "go and find the binary" - neither has a default + // worth printing. + Assert.Equal("lang", SettingKeyCatalog.Annotate("lang")); + Assert.Equal("starter.exe.path", SettingKeyCatalog.Annotate("starter.exe.path")); + } + [Fact] public void A_composite_or_unknown_key_is_shown_as_written() { diff --git a/StarterNG/Infrastructure/Settings/SettingKeyCatalog.cs b/StarterNG/Infrastructure/Settings/SettingKeyCatalog.cs index f9c681f..c5e897b 100644 --- a/StarterNG/Infrastructure/Settings/SettingKeyCatalog.cs +++ b/StarterNG/Infrastructure/Settings/SettingKeyCatalog.cs @@ -16,6 +16,12 @@ public readonly record struct SettingKeyInfo(string Key, string? Default, string /// literals that method defaults and clamps with - so the settings screen can /// state a fact about each key rather than a description of it. If a default or /// a clamp changes in the serializer, it changes here too. +/// +/// Text-valued keys carry no default. The literal the serializer passes to +/// GetString is the last step of a chain, not the value the simulator assumes: +/// an absent lang means the starter follows the operating system, and an +/// absent starter.exe.path means it goes looking for the binary itself. +/// Printing "lang = en" beside the language picker would state something untrue. /// public static class SettingKeyCatalog { @@ -61,7 +67,7 @@ public static class SettingKeyCatalog ["height"] = new("height", "720", null), ["inactivepause"] = new("inactivepause", "true", null), ["input.gamepad"] = new("input.gamepad", "true", null), - ["lang"] = new("lang", "en", null), + ["lang"] = new("lang", null, null), ["livetraction"] = new("livetraction", "true", null), ["maxcabtexturesize"] = new("maxcabtexturesize", "4096", null), ["maxtexturesize"] = new("maxtexturesize", "4096", null), @@ -87,7 +93,7 @@ public static class SettingKeyCatalog ["starter.bufferscale"] = new("starter.bufferscale", "100", "50-200"), ["starter.drivableonly"] = new("starter.drivableonly", "true", null), ["starter.exe.auto"] = new("starter.exe.auto", "true", null), - ["starter.exe.path"] = new("starter.exe.path", "eu07.exe", null), + ["starter.exe.path"] = new("starter.exe.path", null, null), ["starter.expandtree"] = new("starter.expandtree", "false", null), ["starter.hide.archivalvehicles"] = new("starter.hide.archivalvehicles", "true", null), ["starter.ignoreirrelevant"] = new("starter.ignoreirrelevant", "false", null),