Restore the three-state consist override in settings

Keeps the old starter's starter.batterydefault key and its three states. The
setting wins over the depot checkbox, which greys out and says so while an
override is in force.
This commit is contained in:
maj00r
2026-09-04 23:24:45 +02:00
parent cef00c4e3c
commit c0cc696dc9
12 changed files with 104 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ using Avalonia.Media;
using StarterNG.Classes;
using StarterNG.Controls;
using StarterNG.Domain;
using StarterNG.Domain.Settings;
using StarterNG.Domain.Vehicles;
using StarterNG.Application;
@@ -579,14 +580,21 @@ public sealed class VehicleDetails
private Control ReadyToGoRow()
{
var trainset = _consist.EditingTrainset;
var over = AppServices.Current.Settings.ReadyOverride;
bool overridden = over != ConsistReadyOverride.Scenery;
var ready = new CheckBox
{
Content = App.Loc["ConsistReady"],
FontSize = 12,
IsEnabled = trainset is not null,
IsChecked = trainset?.ReadyToGo ?? false
IsEnabled = trainset is not null && !overridden,
IsChecked = overridden
? over == ConsistReadyOverride.AlwaysReady
: trainset?.ReadyToGo ?? false
};
ToolTip.SetTip(ready, App.Loc["ConsistReadyDesc"]);
ToolTip.SetTip(ready, overridden
? App.Loc["ConsistReadyOverridden"]
: App.Loc["ConsistReadyDesc"]);
ready.IsCheckedChanged += (_, _) =>
{