Skip to content

Commit d93e863

Browse files
committed
Rename variable
1 parent e2c841d commit d93e863

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Source/Orts.Formats.Msts/CabViewFile.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,14 @@ public enum DiscreteStates
342342
public struct CabViewControlType
343343
{
344344
public CABViewControlTypes Type;
345-
public int Subtype;
345+
public int Id;
346346
public CabViewControlType(string name)
347347
{
348348
Type = CABViewControlTypes.NONE;
349-
Subtype = 0;
349+
Id = 0;
350350
if (name != null && name.ToUpperInvariant().StartsWith("ORTS_TCS"))
351351
{
352-
if (int.TryParse(name.Substring(8), out Subtype))
352+
if (int.TryParse(name.Substring(8), out Id))
353353
{
354354
Type = CABViewControlTypes.ORTS_TCS;
355355
}
@@ -358,7 +358,7 @@ public CabViewControlType(string name)
358358
}
359359
public override string ToString()
360360
{
361-
if (Type == CABViewControlTypes.ORTS_TCS) return Type.ToString() + Subtype;
361+
if (Type == CABViewControlTypes.ORTS_TCS) return Type.ToString() + Id;
362362
return Type.ToString();
363363
}
364364
}
@@ -592,7 +592,7 @@ public CVCDial(CABViewControlTypes dialtype, int maxvalue, STFReader stf, string
592592
ControlType = new CabViewControlType()
593593
{
594594
Type = dialtype,
595-
Subtype = 0,
595+
Id = 0,
596596
};
597597
ControlStyle = CABViewControlStyles.NEEDLE;
598598
Direction = 0;

Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5816,7 +5816,7 @@ public virtual float GetDataOf(CabViewControl cvc)
58165816
}
58175817

58185818
case CABViewControlTypes.ORTS_TCS:
5819-
TrainControlSystem.CabDisplayControls.TryGetValue(cvc.ControlType.Subtype - 1, out data);
5819+
TrainControlSystem.CabDisplayControls.TryGetValue(cvc.ControlType.Id - 1, out data);
58205820
break;
58215821

58225822
case CABViewControlTypes.ORTS_BATTERY_SWITCH_COMMAND_SWITCH:

Source/RunActivity/Viewer3D/RollingStock/MSTSLocomotiveViewer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2302,7 +2302,7 @@ public bool IsMouseWithin()
23022302

23032303
public string GetControlName()
23042304
{
2305-
if (ControlDiscrete.ControlType.Type == CABViewControlTypes.ORTS_TCS) return (Locomotive as MSTSLocomotive).TrainControlSystem.GetDisplayString(ControlDiscrete.ControlType.Subtype);
2305+
if (ControlDiscrete.ControlType.Type == CABViewControlTypes.ORTS_TCS) return (Locomotive as MSTSLocomotive).TrainControlSystem.GetDisplayString(ControlDiscrete.ControlType.Id);
23062306
return GetControlType().ToString();
23072307
}
23082308

@@ -2521,7 +2521,7 @@ public void HandleUserInput()
25212521

25222522
// Train Control System controls
25232523
case CABViewControlTypes.ORTS_TCS:
2524-
int commandIndex = Control.ControlType.Subtype - 1;
2524+
int commandIndex = Control.ControlType.Id - 1;
25252525
Locomotive.TrainControlSystem.TCSCommandButtonDown.TryGetValue(commandIndex, out bool currentValue);
25262526
if (ChangedValue(1) > 0 ^ currentValue)
25272527
new TCSButtonCommand(Viewer.Log, !currentValue, commandIndex);

0 commit comments

Comments
 (0)