internal bool MoveCheck(Vector2 Point, out Cursor.Status Status) { if (!Loading.SimulationSetup) { Status = Cursor.Status.Default; return(false); } if (renderer.Camera.CurrentMode != CameraViewMode.Interior && renderer.Camera.CurrentMode != CameraViewMode.InteriorLookAhead) { Status = Cursor.Status.Default; return(false); } Status = Cursor.Status.Default; TrainManager.Car Car = TrainManager.PlayerTrain.Cars[TrainManager.PlayerTrain.DriverCar]; int add = Car.CarSections[0].CurrentAdditionalGroup + 1; if (add >= Car.CarSections[0].Groups.Length) { return(false); } TrainManager.TouchElement[] TouchElements = Car.CarSections[0].Groups[add].TouchElements; if (TouchElements == null) { return(false); } ObjectState pickedObject = ParseFBO(Point, 5, 5); foreach (TrainManager.TouchElement TouchElement in TouchElements) { if (TouchElement.Element.internalObject != pickedObject) { continue; } switch (TouchElement.Command) { case Translations.Command.PowerIncrease: case Translations.Command.BrakeIncrease: case Translations.Command.ReverserForward: Status = Cursor.Status.Plus; break; case Translations.Command.PowerDecrease: case Translations.Command.BrakeDecrease: case Translations.Command.ReverserBackward: Status = Cursor.Status.Minus; break; } } return(pickedObject != null); }
internal bool MoveCheck(Vector2 Point, out Cursor.Status Status) { if (!Loading.SimulationSetup) { Status = Cursor.Status.Default; return(false); } if (renderer.Camera.CurrentMode != CameraViewMode.Interior && renderer.Camera.CurrentMode != CameraViewMode.InteriorLookAhead) { Status = Cursor.Status.Default; return(false); } Status = Cursor.Status.Default; CarBase Car = TrainManager.PlayerTrain.Cars[TrainManager.PlayerTrain.DriverCar]; int add = Car.CarSections[0].CurrentAdditionalGroup + 1; if (add >= Car.CarSections[0].Groups.Length) { return(false); } TouchElement[] TouchElements = Car.CarSections[0].Groups[add].TouchElements; if (TouchElements == null) { return(false); } ObjectState pickedObject = renderer.AvailableNewRenderer ? ParseFBO(Point, 5, 5) : RenderSceneSelection(Point, new Vector2(5.0f)); foreach (TouchElement TouchElement in TouchElements.Where(x => x.Element.internalObject == pickedObject)) { foreach (int index in TouchElement.ControlIndices) { switch (Interface.CurrentControls[index].Command) { case Translations.Command.PowerIncrease: case Translations.Command.BrakeIncrease: case Translations.Command.ReverserForward: Status = Cursor.Status.Plus; break; case Translations.Command.PowerDecrease: case Translations.Command.BrakeDecrease: case Translations.Command.ReverserBackward: Status = Cursor.Status.Minus; break; } } } return(pickedObject != null); }
internal static bool MoveCheck(Vector2 Point, out Cursor.Status Status) { if (!Loading.SimulationSetup) { Status = Cursor.Status.Default; return(false); } if (World.CameraMode != CameraViewMode.Interior && World.CameraMode != CameraViewMode.InteriorLookAhead) { Status = Cursor.Status.Default; return(false); } Status = Cursor.Status.Default; TrainManager.Car Car = TrainManager.PlayerTrain.Cars[TrainManager.PlayerTrain.DriverCar]; int add = Car.CarSections[0].CurrentAdditionalGroup + 1; if (add < Car.CarSections[0].Groups.Length) { TrainManager.TouchElement[] TouchElements = Car.CarSections[0].Groups[add].TouchElements; if (TouchElements != null) { foreach (var TouchElement in TouchElements) { int o = TouchElement.Element.ObjectIndex; ShowObjectSelection(o); } int[] SelectBuffer = new int[2048]; PickPre(SelectBuffer, Point, new Vector2(5)); RenderSceneSelection(); int PickedObjectIndex = PickPost(SelectBuffer); foreach (var TouchElement in TouchElements) { int o = TouchElement.Element.ObjectIndex; HideObjectSelection(o); if (o == PickedObjectIndex) { switch (TouchElement.Command) { case Translations.Command.PowerIncrease: case Translations.Command.BrakeIncrease: case Translations.Command.ReverserForward: Status = Cursor.Status.Plus; break; case Translations.Command.PowerDecrease: case Translations.Command.BrakeDecrease: case Translations.Command.ReverserBackward: Status = Cursor.Status.Minus; break; } } } if (PickedObjectIndex >= 0) { return(true); } } } return(false); }