ATC Dimetronic: Implement double signal codes
This commit is contained in:
parent
77869e9c1e
commit
5477d7389c
3 changed files with 70 additions and 28 deletions
|
@ -11,6 +11,8 @@ namespace OpenbveFcmbTrainPlugin
|
|||
/// <summary>Represents a collection of plugin settings.</summary>
|
||||
internal class SettingsCollection
|
||||
{
|
||||
internal double TrainLength;
|
||||
|
||||
internal bool DoorSelectionDeviceEnabled;
|
||||
internal bool DoorClosingSoundDeviceEnabled;
|
||||
internal bool DoorTractionCutDeviceEnabled;
|
||||
|
@ -75,6 +77,19 @@ namespace OpenbveFcmbTrainPlugin
|
|||
}
|
||||
switch (Section)
|
||||
{
|
||||
case "train":
|
||||
switch (Key)
|
||||
{
|
||||
case "length":
|
||||
{
|
||||
if (double.TryParse(Value, NumberStyles.Float, CultureInfo.InvariantCulture, out double a))
|
||||
{
|
||||
PluginSettings.TrainLength = a;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case "doorselection":
|
||||
switch (Key)
|
||||
{
|
||||
|
@ -211,8 +226,7 @@ namespace OpenbveFcmbTrainPlugin
|
|||
PluginSettings.AtcDimetronicAtoAvailable = string.Compare(Value, "false", StringComparison.OrdinalIgnoreCase) != 0;
|
||||
break;
|
||||
default:
|
||||
int aspect;
|
||||
if (int.TryParse(Key, NumberStyles.Integer, CultureInfo.InvariantCulture, out aspect))
|
||||
if (int.TryParse(Key, NumberStyles.Integer, CultureInfo.InvariantCulture, out int aspect))
|
||||
{
|
||||
AtcDimetronic.SignalCode signalCode = new AtcDimetronic.SignalCode(aspect, Value);
|
||||
if (signalCode != null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue