Open Caenen opened 2 months ago
Any ideas @adoxa?
I'll see if I can automatically disable/toggle on dock/launch, but I won't say when...
I may have found a solution that works without disabling or re-toggling the Rotation Lock control. I tested it for a bit and it seems to have resolved the problem on my end, but I can't guarantee its stability as it's not the cleanest solution. I've temporarily pushed the code to a separate branch on the FLSharp repo: https://github.com/BC46/FLSharp/commit/6e578bc4fa1409143c28406db503ce8e44995fab.
I think the problem was that when docked the game's behavior manager wasn't aware of the last rotation lock state and thus after undocking it assumed it wasn't changed from the default. Hence making the behavior manager aware of this seems to help.
@Caenen told me on Discord about a bug related to Auto Level where if you disable it while in space, then dock and undock, it's automatically enabled but you have to press the hotkey twice in order to disable it again. I fixed it by telling the behavior manager that auto leveling should be disabled after undocking if that's what it was prior to docking. The implementation can be found here: https://github.com/BC46/FLSharp/commit/4fa19eec638bfc380dbd272f5144ffa74ffb70e2.
@adoxa if you want to automatically set Rotation Lock and and Auto Level to the default values when undocking, all you have to do is update the booleans [esi+0x44]
and 0x612700
, respectively. Though you may also have to call the IBehaviorManager
functions like I did too but I'm not sure.
I'd be more inclined to restore default, i.e. they're always off when you launch. People have until I do it to change my mind. :)
I think restoring defaults makes the most sense too since FL already does that for mouse flight. Also you may have to find a better launch hook because I found out that BaseWatcher::set_pointer
gets called in instances other than just on-launch, e.g. when toggling cockpit view.
There is a bug that sneaks in when using the Rotation Lock feature JFLP adds/restores to the game. After toggling it on in space, then docking, it is still enabled after undocking but runs into a huge error where the ship controls brick themselves upon hitting some pitch elevation limit around 65° up or down.
Video example: https://drive.google.com/file/d/1H3f_D1md_Ii3wwjvOtueicMVP_i37LeA/view?usp=sharing
Repro steps:
Some additional observations: