BepInEx / BepInEx.ConfigurationManager

Plugin configuration manager for BepInEx
https://www.patreon.com/ManlyMarco
GNU Lesser General Public License v3.0
231 stars 53 forks source link

Fix F1 not hiding window again #10

Closed benediktwerner closed 3 years ago

benediktwerner commented 3 years ago

Currently, it's not possible to close the settings window again by pressing F1.

From what I can tell Event has existed at least since Unity version 5.4 but I'm not sure what your requirements for backward compatibility are. Otherwise, it might require some reflection or a version check.

Edit: Also, I checked the hotkey functionality and it's still possible to set hotkeys to F1 without closing the window, although not sure why anybody would want to do that.

ghorsington commented 3 years ago

Greetings!

Thanks for the PR; we always try to target the lowest Unity version possible for our 1st party plugins so that they are usable on as many games as possible. In practice we try to primarily target Unity 5. If a choice is available, we try to pick options that also work on even older versions. Reflection is used only in cases where multi-version support is important, like support between Unity 5 and Unity 2017+.

Looking at it, it seems that Event is available in as low Unity versions as 4.0, so this should work fine there. Other than that, the code looks fine to me. Thanks again!