-
Notifications
You must be signed in to change notification settings - Fork 9
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
Fixed bugs and added features #4
base: 1.17
Are you sure you want to change the base?
Conversation
fixed bug: Only up to 2 additional key binding could be saved added feature: in controls option can now only add new alternative keybinding if main and other keybinding are bound added feature: fancy toast if can not add new alternative keybinding added feature: adding new alternative keybinding automatically sets the new keybinding button active for key listening fixed bug: reset keybinding and its alternatives tooltip now only shows when it is clickable added feature: pressing esc (unbinding) a key deletes that entry fixed bug: game crashes when multiple alternatives keybindings have same alternative id fixed bug: keybindings are not saved when alternative keybindings get deleted code refactoring
gui but is still triggered (restarting clears that problem)
Now if there are alternatives and default alternatives exist then the default key is set to those of the default alternatives (even better: The KeyBinding instances of the default alternatives are always in these places) and much more ...
*/ | ||
public static void create(KeyBinding base, int code) { | ||
create(base, InputUtil.Type.KEYSYM, code); | ||
public static KeyBinding create(KeyBinding base, int code) { |
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.
I generally agree to this, but I have two notes:
- This change breaks byte code compatibility which would result in a major version bump. I'm not sure if I want this here — maybe this should get a different name for now.
- It should probably be generified if it returns its argument, so it works better with custom classes.
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.
To 1.: Should I leave the old method signature and make it deprecated and give the new method a different name? Or should I not deprecate the old one?
To 2.: 2 of the 3 method named "create" return a new KeyBinding not the one given as argument. Only the method with KeyBinding alternative
as argument return the given KeyBinding. So I only generify that one
@@ -7,7 +7,7 @@ yarn_mappings = 1.17+build.13 | |||
loader_version = 0.11.6 | |||
|
|||
#Mod properties | |||
mod_version = 1.0.1 | |||
mod_version = 1.1.0 |
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.
I'm going to do the bump myself when I find it ready for release :)
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.
Sure. I just need to change the version in order to test the new version I compiled and published to local maven. Otherwise the version from your maven might be taken because of dependencies of dependencies and repository order
public static void create(KeyBinding base, InputUtil.Type inputType, int code) { | ||
KeyBinding alternative = NMUKKeyBindingHelper.createAlternativeKeyBinding(base, inputType, code); | ||
NMUKKeyBindingHelper.registerKeyBinding(alternative); | ||
public static KeyBinding create(KeyBinding base, InputUtil.Type inputType, int code) { |
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.
Same notes as for the overload.
((IKeyBinding) base).nmuk_addAlternative(alternative); | ||
((IKeyBinding) alternative).nmuk_setParent(base); | ||
NMUKKeyBindingHelper.registerKeyBinding(alternative); | ||
public static KeyBinding create(KeyBinding base, KeyBinding alternative) { |
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.
Same here again
No description provided.