Skip to content

Mods could use an API to know if their window got focus. #19

@Dunbaratu

Description

@Dunbaratu

As of version 0.10.13 and up, there are now two different places where focus follows Click exists, and they don't agree with each other, and both are visible to the player:

I am referring to these two values:

  • ClearInputLocks.focusFollowsClick.
  • HighLogic.CurrentGame.Parameters.CustomParams<ClickThroughFix.CTB>().focusFollowsclick

Both settings are still visible to the player, and they disagree. If you click the button to change the value, the toggle on the difficulty settings screen doesn't seem to change to match it.

On a similar note, Is there an official "API" way other mods are supposed to use if they want to query CTB and ask whether CTB is currently in focus-follows-mouse mode or click-focus mode? I was using the CustomParams way to do it, but it broke when the button was added in v0.10.13 and I feel like it's not very future-proof for me to be peeking into a part of CTB's code that's not officially a public-facing API promise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions