Doors: Split into 3 devices
This commit is contained in:
parent
9abbab8e81
commit
0d696fb381
7 changed files with 274 additions and 192 deletions
|
@ -8,16 +8,18 @@ namespace OpenbveFcmbTrainPlugin
|
|||
/// <summary>Represents a collection of plugin settings.</summary>
|
||||
internal class SettingsCollection
|
||||
{
|
||||
internal bool DoorsDeviceEnabled;
|
||||
internal bool DoorSelectionDeviceEnabled;
|
||||
internal bool DoorClosingSoundDeviceEnabled;
|
||||
internal bool DoorTractionCutDeviceEnabled;
|
||||
internal bool DeadmanDeviceEnabled;
|
||||
internal bool TrainStopDeviceEnabled;
|
||||
internal bool AtcBombardierDeviceEnabled;
|
||||
internal bool AtcDimetronicDeviceEnabled;
|
||||
|
||||
internal bool DoorsRequireClosingSound;
|
||||
internal int DoorsClosingSoundDuration = 5;
|
||||
internal int DoorsClosingSoundTimeout = 15;
|
||||
internal int DoorsClosingSoundIndex = 10;
|
||||
internal bool DoorClosingSoundRequired;
|
||||
internal int DoorClosingSoundDuration = 5;
|
||||
internal int DoorClosingSoundTimeout = 15;
|
||||
internal int DoorClosingSoundIndex = 10;
|
||||
|
||||
internal int DeadmanBrakeDelay = 5;
|
||||
internal bool DeadmanRequireFullStop;
|
||||
|
@ -68,41 +70,57 @@ namespace OpenbveFcmbTrainPlugin
|
|||
}
|
||||
switch (Section)
|
||||
{
|
||||
case "doors":
|
||||
case "doorselection":
|
||||
switch (Key)
|
||||
{
|
||||
case "enabled":
|
||||
PluginSettings.DoorsDeviceEnabled = string.Compare(Value, "false", StringComparison.OrdinalIgnoreCase) != 0;
|
||||
PluginSettings.DoorSelectionDeviceEnabled = string.Compare(Value, "false", StringComparison.OrdinalIgnoreCase) != 0;
|
||||
break;
|
||||
case "requireclosingsound":
|
||||
PluginSettings.DoorsRequireClosingSound = string.Compare(Value, "false", StringComparison.OrdinalIgnoreCase) != 0;
|
||||
}
|
||||
break;
|
||||
case "doorclosingsound":
|
||||
switch (Key)
|
||||
{
|
||||
case "enabled":
|
||||
PluginSettings.DoorClosingSoundDeviceEnabled = string.Compare(Value, "false", StringComparison.OrdinalIgnoreCase) != 0;
|
||||
break;
|
||||
case "closingsoundduration":
|
||||
case "required":
|
||||
PluginSettings.DoorClosingSoundRequired = string.Compare(Value, "false", StringComparison.OrdinalIgnoreCase) != 0;
|
||||
break;
|
||||
case "duration":
|
||||
{
|
||||
if (int.TryParse(Value, out int a))
|
||||
{
|
||||
PluginSettings.DoorsClosingSoundDuration = a;
|
||||
PluginSettings.DoorClosingSoundDuration = a;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "closingsoundtimeout":
|
||||
case "timeout":
|
||||
{
|
||||
if (int.TryParse(Value, out int a))
|
||||
{
|
||||
PluginSettings.DoorsClosingSoundTimeout = a;
|
||||
PluginSettings.DoorClosingSoundTimeout = a;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "closingsoundindex":
|
||||
case "index":
|
||||
{
|
||||
if (int.TryParse(Value, out int a))
|
||||
{
|
||||
PluginSettings.DoorsClosingSoundIndex = a;
|
||||
PluginSettings.DoorClosingSoundIndex = a;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case "doortractioncut":
|
||||
switch (Key)
|
||||
{
|
||||
case "enabled":
|
||||
PluginSettings.DoorTractionCutDeviceEnabled = string.Compare(Value, "false", StringComparison.OrdinalIgnoreCase) != 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case "deadman":
|
||||
switch (Key)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue