Skip to content

Commit 0d98b5e

Browse files
committed
Automatic merge of T1.5.1-905-gaf8fb30c5 and 14 pull requests
- Pull request #570 at 3539862: Experimental glTF 2.0 support with PBR lighting - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at 9c456aa: Blueprint/train car operations UI window - Pull request #885 at 8f94333: feat: Add notifications to Menu - Pull request #886 at 6c0785b: Scene viewer extension to TrackViewer - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #903 at 9bead33: Downloading route content (Github, zip) - Pull request #911 at 6834af0: docs: Add refactoring as a special type of PR - Pull request #916 at 992cc97: Distributed Power Air Brake Synchronization - Pull request #919 at 9358732: Added mouse wheel support for controls which can be moved by pressing t… - Pull request #920 at a94e403: Update RailDriver in Manual - Pull request #923 at d0208cd: Add curve squeal to route
16 parents b4353a3 + af8fb30 + 3539862 + d00beb9 + f92de76 + 9c456aa + 8f94333 + 6c0785b + 1f5ba4c + 5866028 + 9bead33 + 6834af0 + 992cc97 + 9358732 + a94e403 + d0208cd commit 0d98b5e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Source/RunActivity/Viewer3D/Popups/ControlRectangle.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
// You should have received a copy of the GNU General Public License
1616
// along with Open Rails. If not, see <http://www.gnu.org/licenses/>.
1717

18-
using System;
18+
using System.Linq;
1919
using Microsoft.Xna.Framework;
2020
using Microsoft.Xna.Framework.Graphics;
21+
using Orts.Simulation.RollingStocks;
2122
using Orts.Viewer3D.RollingStock;
2223

2324
namespace Orts.Viewer3D.Popups
@@ -41,7 +42,13 @@ public override void Draw(SpriteBatch spriteBatch)
4142
if (Viewer.Camera is CabCamera && (Viewer.PlayerLocomotiveViewer as MSTSLocomotiveViewer)._hasCabRenderer)
4243
{
4344
var cabRenderer = (Viewer.PlayerLocomotiveViewer as MSTSLocomotiveViewer)._CabRenderer;
44-
foreach (var controlRenderer in cabRenderer.ControlMap.Values)
45+
46+
var loco = Viewer.PlayerLocomotive as MSTSLocomotive;
47+
var cabViewFrontRear = loco.UsingRearCab ? 1 : 0;
48+
var itemsFrontCount = loco.CabViewList[(int)CabViewType.Front].CVFFile.CabViewControls.Count() - 1;
49+
var itemsRearCount = loco.CabViewList.Count > 1 ? loco.CabViewList[(int)CabViewType.Rear].CVFFile.CabViewControls.Count() - 1 : 0;
50+
51+
foreach (var controlRenderer in cabRenderer.ControlMap.Values.Skip(cabViewFrontRear == 0 ? 0 : itemsFrontCount).Take(cabViewFrontRear == 0 ? itemsFrontCount : itemsRearCount))
4552
{
4653
if ((Viewer.Camera as CabCamera).SideLocation == controlRenderer.Control.CabViewpoint && controlRenderer is ICabViewMouseControlRenderer mouseRenderer)
4754
{

0 commit comments

Comments
 (0)