Skip to content

Commit 6a8df6d

Browse files
authored
Merge pull request #549 from Csantucci/3d-Cab-animation-for-generic-items
Generic items: optional internal 3DCab animation linked to them
2 parents 55f3ff8 + 7c55924 commit 6a8df6d

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

Source/Documentation/Manual/cabs.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,14 @@ It may be modified with following parameter in the .sd file::
564564
Examples of use are fan control, open/close of aerodynamic coverages of couplers
565565
in high speed trains, menu pages switching.
566566

567+
Animations within the 3D cab .s file are also available, as follows::
568+
569+
ORTS_ITEM1CONTINUOUS
570+
ORTS_ITEM2CONTINUOUS
571+
ORTS_ITEM1TWOSTATE
572+
ORTS_ITEM2TWOSTATE
573+
574+
in analogy to the four animations for the locomotive .s file.
567575

568576
High-resolution Cab Backgrounds and Controls
569577
--------------------------------------------

Source/Orts.Formats.Msts/CabViewFile.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,11 @@ public enum CABViewControlTypes
265265
EXTERNALWIPERS,
266266
LEFTDOOR,
267267
RIGHTDOOR,
268-
MIRRORS
268+
MIRRORS,
269+
ORTS_ITEM1CONTINUOUS,
270+
ORTS_ITEM2CONTINUOUS,
271+
ORTS_ITEM1TWOSTATE,
272+
ORTS_ITEM2TWOSTATE,
269273
}
270274

271275
public enum CABViewControlStyles

Source/RunActivity/Viewer3D/RollingStock/MSTSLocomotiveViewer.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2857,6 +2857,10 @@ public ThreeDimentionCabViewer(Viewer viewer, MSTSLocomotive car, MSTSLocomotive
28572857
case CABViewControlTypes.MIRRORS:
28582858
case CABViewControlTypes.LEFTDOOR:
28592859
case CABViewControlTypes.RIGHTDOOR:
2860+
case CABViewControlTypes.ORTS_ITEM1CONTINUOUS:
2861+
case CABViewControlTypes.ORTS_ITEM2CONTINUOUS:
2862+
case CABViewControlTypes.ORTS_ITEM1TWOSTATE:
2863+
case CABViewControlTypes.ORTS_ITEM2TWOSTATE:
28602864
break;
28612865
default:
28622866
//cvf file has no external wipers, left door, right door and mirrors key word
@@ -2962,6 +2966,18 @@ public override void PrepareFrame(RenderFrame frame, ElapsedTime elapsedTime)
29622966
case CABViewControlTypes.MIRRORS:
29632967
p.Value.UpdateState(Locomotive.MirrorOpen, elapsedTime);
29642968
break;
2969+
case CABViewControlTypes.ORTS_ITEM1CONTINUOUS:
2970+
p.Value.UpdateLoop(Locomotive.GenericItem1, elapsedTime);
2971+
break;
2972+
case CABViewControlTypes.ORTS_ITEM2CONTINUOUS:
2973+
p.Value.UpdateLoop(Locomotive.GenericItem2, elapsedTime);
2974+
break;
2975+
case CABViewControlTypes.ORTS_ITEM1TWOSTATE:
2976+
p.Value.UpdateState(Locomotive.GenericItem1, elapsedTime);
2977+
break;
2978+
case CABViewControlTypes.ORTS_ITEM2TWOSTATE:
2979+
p.Value.UpdateState(Locomotive.GenericItem2, elapsedTime);
2980+
break;
29652981
default:
29662982
break;
29672983
}

0 commit comments

Comments
 (0)