Hi,
The "Position ( x y w h )" entry must currently also exist in 3D cvf files and the values w or h must not be 0.As soon as the mouse is moved over the brake lever, the float value "NormalizedMouseMovement" is determined by dividing with either w or h:
/// <summary>
/// Converts absolute mouse movement to control value change, respecting the configured orientation and increase direction
/// </summary>
float NormalizedMouseMovement()
{
return (ControlDiscrete.Orientation > 0
? (float)UserInput.MouseMoveY / (float)Control.Height
: (float)UserInput.MouseMoveX / (float)Control.Width)
* (ControlDiscrete.Direction > 0 ? -1 : 1);
}
Code in MSTSLocomotiveViewer.cs
w and h are "Control.Widht" and "Control.Height" and if missing or 0 result in a division by 0 - thus "NaN", which results in "def %" on the screen.
"NormalizedMouseMovement" is to determine the mouse movement value and thus the change value for the brake lever. The function is only effective for mouse movements with pressed left mouse button over the brake lever (also other controls), no matter if you are in 2D or 3D CabView. If you use the keyboard the function "NormalizedMouseMovement" is not used.
---
What
superheatedsteam has written about the mouse sensitivity of the lever control has thus been confirmed for me in the OR code.
---
The question remains, what does someone do, who no longer builds a 2D-CabView for a loco, but only a 3D-CabView. How should he then define the w and h values for the "Position" parameter, which is mandatory for 3D? The "Position" parameter values are originally based on the width/height values of the .ace graphic of a control in the 2D-CabView - but there is no such graphic in the 3D-CabView for the individual controls.
When I left out the "Position" parameters in the 3D-cvf-file and this bug occurred, I assumed that the size of a 3D-control will be determined by its actual 3D-dimensions in the s-file of the 3D-CabView. But if this has to be specified manually by a content creator by using a "Position" parameter, even in 3D, then this should at least be mentioned in the manual, I urgently propose. Basically so or so similar, as superheatedsteam writes it.
Or the OR code should be changed so that the "Position" parameter for 3D-cvf is no longer necessary.
Greetings
Jonas