-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera switches to "vessel locked" mode when focusing the terminal window when in map-mode #2126
Comments
This is a long standing issue that I can't seem to figure out. It used to be a bug with all windows. If you go back a few versions KSPedia had the same issue. But they somehow fixed it, and I haven't figured out how. I believe that the same issue at least used to happen if the game window was out of focus (I found out by recording long missions while doing other things on the computer at the same time). Definitely a bug, just one I don't know how to fix. |
This old bug has bothered me more and more lately so I decided to start looking at it again and experiment. I found the exact set of circumstances that trigger the bug in KSP!! To get the bug to happen you need the exact input lock bitmask the kOS Terminal happens to use, If you use ControlTypes.All, which is the following mask, the map rotation bug does not happen:
But when you add in the fact that we want to make an exception for the ControlTypes.TARGETING bit, as shown below, then the map rotation bug occurs:
(This is the mask that we use in It is explicitly ControlTypes.TARGETING that causes the bug to manifest. I have no clue why as this seems like there is no logical reason why, but there you have it - zero that bit from the mask and the view spins. Leave that bit as a 1 and the view won't spin. Note, I googled and found that other modders who had this problem and fixed it said that the fix was to use I don't yet know the fix, but I imagine it's going to have to be this: We leave TARGETING locked out most of the time, using the simple ControlType.All flag that just suppresses everything. Then when we detect the script is trying to |
The ugly part about the fix of "temporarily de-focus the terminal, do the target change, then re-focus the terminal" is that it might not be the current CPU's terminal that is focused. It could be the terminal from a second CPU on the vessel that is focused. So simply affecting the |
Actually only one kOS window will have the input lock set at the moment, so I can just ask the InputLockManager to find that lock we set, regardless of which window set it. |
Change input locks to fix map spin, Fixes #2126
Pretty odd bug. I only tested this during atmospheric flight.
To replicate, simply enter mapmode, have the vessel perform some sort of rotation (leaving sas off for example) while focusing a kos terminal window. It doesn't need to be running any scripts.
The text was updated successfully, but these errors were encountered: