-
Notifications
You must be signed in to change notification settings - Fork 118
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
Improve mouse capture handling in menus #520
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes please holy shit
This actually i think would break backwards compatibility for mods that use scrollbars, In theory I could solve that, but it wouldn't be nice code |
works in testing btw |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As someone who wrote the original system I approve these changes
Also regarding breaking mods, as far as I know mod settings is the only public mod which uses this system and it's getting merged ( right ? ) anyways so it shouldn't matter much |
@GeckoEidechse this pr cured my dogs cancer can we set a new merge record? 😳😳😳 |
uhh all mods that use a custom scrollbar like Better Server Browser (ok grandpa), Better Modlist (deprecated by thunderstore guys), Modsettings and the LAN browser mod from that one polish guy will compile error unless updated. btw gecko can you please tell people in the 1.10 announcement to uninstall better modlist since it's merged thank |
this is great, but should probably be moved into its own file instead of sh_menu_models if we're api-ing it |
good point, will do |
Finally got around to doing this |
as of now, mods that are using mouse movement captures (only mods that use the custom scrollbar afaik) will break since they register the callback for the menu instead of the capture element. However they will not compile error but scrollbars will just stop working. |
This should now preserve backwards compatibility, you can now pass either a I'm keeping the changes to other files within NorthstarMods itself as we should prefer passing the |
Aight this is I think in it's final state, unless anyone has any changes they want made. From my own personal testing, backwards compatibility is preserved |
what's blocking this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, will probably double check through everything and merge shortly, though i imagine it's fine
Titanfall_2_2022-11-08_23-15-57.mp4 |
(just so it's known, the scrolling boxes being weird is not my fault, they are simply unfinished) |
* rework mouse capture handling * small improvement to comment * move to new script file * refactor to use only the capturePanel * refactor part 2 * github please commit everything * remove non-implemented global function * cleanup * rename variable * formatting and a comment * run callbacks for menus * update comment accordingly * small formatting change * slight refactor to avoid duplicate code * improve comment * pass correct parameters * newline at end of file :)
This both allows a menu to have multiple mouse capture callbacks, as well as passing the menu element that captured the mouse input as a parameter, allowing for multiple scrollbars per menu