@@ -4232,23 +4232,18 @@ public void StartThrottleToZero(float? target)
4232
4232
/// whether it is used for cruise control or not
4233
4233
/// </summary>
4234
4234
/// <param name="intermediateValue">Whather asking for intermediate (for mouse operation) or notched (for displaying) value.</param>
4235
- /// <returns>Combined position into 0-1 range</returns>
4236
- public float GetThrottleHandleValue ( float data )
4235
+ /// <returns>Position into 0-1 range</returns>
4236
+ public float GetThrottleHandleValue ( bool intermediateValue )
4237
4237
{
4238
4238
if ( CruiseControl ? . SpeedRegMode == CruiseControl . SpeedRegulatorMode . Auto && CruiseControl . SelectedMaxAccelerationPercent != 0
4239
4239
&& CruiseControl . HasIndependentThrottleDynamicBrakeLever )
4240
- return ThrottleController . CurrentValue ;
4240
+ return intermediateValue ? ThrottleController . CurrentValue : ThrottleController . IntermediateValue ;
4241
4241
if ( CruiseControl ? . SpeedRegMode == CruiseControl . SpeedRegulatorMode . Auto && CruiseControl . UseThrottleAsForceSelector )
4242
4242
return CruiseControl . SelectedMaxAccelerationPercent / 100 ;
4243
4243
if ( CruiseControl ? . SpeedRegMode == CruiseControl . SpeedRegulatorMode . Auto && CruiseControl . UseThrottleAsSpeedSelector )
4244
4244
return CruiseControl . SelectedSpeedMpS / MaxSpeedMpS ;
4245
4245
4246
-
4247
- if ( CruiseControl == null || CruiseControl . SpeedRegMode == CruiseControl . SpeedRegulatorMode . Manual )
4248
- return data ;
4249
- else
4250
- return ThrottleController . CurrentValue ;
4251
-
4246
+ return intermediateValue ? ThrottleController . CurrentValue : ThrottleController . IntermediateValue ;
4252
4247
}
4253
4248
4254
4249
#endregion
@@ -5777,7 +5772,7 @@ public virtual float GetDataOf(CabViewControl cvc)
5777
5772
case CABViewControlTypes . THROTTLE :
5778
5773
{
5779
5774
if ( CruiseControl != null && CruiseControl . SkipThrottleDisplay ) break ;
5780
- data = GetThrottleHandleValue ( ( Train . TrainType == Train . TRAINTYPE . AI_PLAYERHOSTING || Train . Autopilot ) ? ThrottlePercent / 100f : LocalThrottlePercent / 100f ) ;
5775
+ data = GetThrottleHandleValue ( false ) ;
5781
5776
break ;
5782
5777
}
5783
5778
case CABViewControlTypes . THROTTLE_DISPLAY :
@@ -5872,10 +5867,13 @@ public virtual float GetDataOf(CabViewControl cvc)
5872
5867
break ;
5873
5868
}
5874
5869
case CABViewControlTypes . DYNAMIC_BRAKE :
5870
+ {
5871
+ data = DynamicBrakeController ? . CurrentValue ?? 0 ;
5872
+ break ;
5873
+ }
5875
5874
case CABViewControlTypes . DYNAMIC_BRAKE_DISPLAY :
5876
- //case CABViewControlTypes.CP_HANDLE:
5877
5875
{
5878
- data = DynamicBrakePercent / 100f ;
5876
+ data = ( Train . TrainType == Train . TRAINTYPE . AI_PLAYERHOSTING || Train . Autopilot ) ? DynamicBrakePercent / 100 : LocalDynamicBrakePercent / 100 ;
5879
5877
break ;
5880
5878
}
5881
5879
case CABViewControlTypes . WIPERS :
0 commit comments