-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added basic Keybind setting and Module setting tab.
The new Binding system saves the Binds to the new Settings file. This means that any changes made to bindings will persist across game sessions, similar to other module settings. There is now a Module Settings Tab instead of a dropdown in the Module Component. This is likely to change in the future but it's a good placeholder.
- Loading branch information
1 parent
25db625
commit 4fb7f0c
Showing
74 changed files
with
483 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/net/aoba/core/settings/types/KeybindSetting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package net.aoba.core.settings.types; | ||
|
||
import java.util.function.Consumer; | ||
import net.aoba.core.settings.Setting; | ||
import net.minecraft.client.option.KeyBinding; | ||
|
||
public class KeybindSetting extends Setting<KeyBinding> { | ||
public KeybindSetting(String ID, String description, KeyBinding default_value) { | ||
super(ID, description, default_value); | ||
type = TYPE.KEYBIND; | ||
} | ||
|
||
public KeybindSetting(String ID, String displayName, String description, KeyBinding default_value) { | ||
super(ID, displayName, description, default_value); | ||
type = TYPE.KEYBIND; | ||
} | ||
|
||
public KeybindSetting(String ID, String description, KeyBinding default_value, Consumer<KeyBinding> onUpdate) { | ||
super(ID, description, default_value, onUpdate); | ||
type = TYPE.KEYBIND; | ||
} | ||
|
||
/** | ||
* Checks whether or not a value is with this setting's valid range. | ||
*/ | ||
@Override | ||
protected boolean isValueValid(KeyBinding value) { | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.