mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-06 13:48:34 +01:00
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:
@@ -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 += (_, _) =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user