Add settings profiles and expand exposed eu07.ini options

Adds save/apply named settings profiles (SettingsProfileStore), a
battery-default export option that rewrites trainset velocity on
launch, and an option to omit decorative trainsets from the exported
scenery. Also surfaces many previously-unmapped eu07.ini keys in the
Settings UI (UART/feedback port, FPS limit, shadow angle, fullscreen
windowed, ANGLE Vulkan, friction/brake sensitivity, and an Advanced
section for texture/GLES/threading tunables).
This commit is contained in:
Mateusz Włodarczyk
2026-07-05 18:04:07 +02:00
parent 211863c921
commit c4147a2f66
11 changed files with 557 additions and 19 deletions

View File

@@ -125,6 +125,28 @@ public sealed class ConfigFile
}
}
/// <summary>
/// Deactivates <paramref name="key"/> by turning its line into a comment,
/// preserving indentation, the key/value that was there and any trailing
/// comment. No-op if the key is not currently active.
/// </summary>
public void Remove(string key)
{
if (!_index.TryGetValue(key, out int i))
return;
SplitLine(_lines[i], out string indent, out _, out string value, out string comment);
var sb = new StringBuilder();
sb.Append(indent).Append("// ").Append(key);
if (value.Length > 0)
sb.Append(' ').Append(value);
if (comment.Length > 0)
sb.Append('\t').Append(comment);
_lines[i] = sb.ToString();
_index.Remove(key);
}
public void SetBool(string key, bool value) => Set(key, value ? "yes" : "no");
public void SetInt(string key, int value) =>
Set(key, value.ToString(CultureInfo.InvariantCulture));