fix(settings): a value of eu07.ini the starter does not know stays until changed by hand

A renderer written in by hand ("gfxrenderer vulkan") went back to "default"
on the next save, the Vulkan renderer's own keys were taken out, and saying
no to reading the file again lost every change made on disk meanwhile.

Such a value is now shown as the file writes it - on its list where the
control is one, with the note under the setting otherwise - and written back
as it is until the player sets that control, even to what the starter shows
by default. The move to the standard mode puts them right, as before for the
advanced settings. Declining to read the file again no longer forgets the
change on disk: the next save goes onto it.

The default UART features in another order are no longer named unknown.
This commit is contained in:
maj00r
2026-11-24 18:26:56 +01:00
parent 94112af005
commit b778122fb5
10 changed files with 529 additions and 54 deletions

View File

@@ -961,23 +961,34 @@ public class SettingsStoreTests
Assert.Contains($"gfxrenderer {word}\n", SavedLines(installation));
}
// Words master does not know start the full renderer with a line in its log, and the
// experimental renderer is not in a player's build: a save puts "default" in their place.
// A word the starter does not know is written in by hand for a build that has it, such as one with Vulkan:
// shown, and left as it is until another renderer is chosen.
[Theory]
[InlineData("full")]
[InlineData("opengl")]
[InlineData("gl46")]
[InlineData("vulkan")]
[InlineData("vulkan14")]
[InlineData("experimental")]
[InlineData("null")]
public void A_renderer_word_master_does_not_run_is_saved_as_default(string word)
public void A_renderer_word_the_starter_does_not_know_stays_until_another_is_chosen(string word)
{
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, $"gfxrenderer {word}\n"));
installation.SettingsStore.Load();
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, $"gfxrenderer {word}\nfieldofview 45\n"));
var store = installation.SettingsStore;
store.Load();
installation.SettingsStore.Save();
Assert.Equal(word, store.Settings.RendererWord);
Assert.Equal(word, store.UnreadableValues()["gfxrenderer"]);
store.Settings.FieldOfView = 60;
store.Save();
Assert.Contains($"gfxrenderer {word}\n", SavedLines(installation));
// Picking one from the list, even the full renderer it runs as, is a choice.
store.Settings.RendererWord = null;
store.Settings.RenderEngine = 0;
store.Save();
Assert.Contains("gfxrenderer default\n", SavedLines(installation));
Assert.False(store.UnreadableValues().ContainsKey("gfxrenderer"));
}
[Theory]