-
-
Notifications
You must be signed in to change notification settings - Fork 220
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
feat: keybinds by oen | (limited) Part 1 #996
Conversation
Notes:
align-right: true
spacing: -5 The negative sign wasn't considered because it was uint8_t, so I changed it to int8_t. If someone else could test it, I would appreciate it. |
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.
parcial review
modules/client_options/keybins.lua
Outdated
@@ -0,0 +1,766 @@ | |||
|
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.
Co-authored-by: kokekanon <[email protected]>
Co-authored-by: kokekanon <[email protected]>
Co-authored-by: kokekanon <[email protected]>
Co-authored-by: kokekanon <[email protected]>
Co-authored-by: kokekanon <[email protected]>
@kokekanon |
Quality Gate passedIssues Measures |
works in my environment |
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.
works so far,
only tested on windows.
no test in web client
Credits : oen
I’m not interested in the fan war between OTC, I liked this feature and I want it in my client. I’m sharing it.
Here is the original code for keybinds of Oen.
Part 1 integrates Keybins WITHOUT the walk. I could adapt it, but my intention is not to delay the Android branch any further, as it would cause conflicts in that branch. (game_joystick, game_walk)
I will adapt Part 2 when that branch is merged in main repo.
Hotkeys are not adapted because I like the old version(me server is 10.98). If someone wants to adapt it in the future, I would appreciate it if they kept the old version compatible. :)
the "save" functionality is not adapted either, because I didn't like it. (if someone wants to do it, he should add a button and call this
function applyChangedOptions()
andsetOption(key, option.value, option.force))
Keybinds system
Notes
Creating new keybind
Best place to add is init (or whatever onLoad executes) of your module.
Params
Binding keybinds
Creating keybinds is not enough, you have to make them do something. Binding is separated for multiple reasons but the most important one is that not everything is ready and loaded when client starts, some modules require player to enter the game to bind the keys. Must be used AFTER
Keybind.new.
Keybind.bind(category, action, callbacks, widget)
Params
Example
Deleting Keybinds
Best place to add is terminate (or whatever onUnload executes) of your module. This is required, altho there is a check to prevent duplicate Keybinds, it is better to delete unused one before they readded in init or somewhere.
Params
Example
Credits : oen
I’m not interested in the fan war between OTC, I liked this feature and I want it in my client. I’m sharing it.