Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/main/java/com/sidezbros/double_hotbar/DoubleHotbar.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
public class DoubleHotbar implements ClientModInitializer {
public static final Logger LOGGER = LogManager.getLogger("double_hotbar");
private static KeyBinding keyBinding;
private static KeyBinding disableKeyBinding;
private boolean[] hotbarKeys = new boolean[10];
private long[] timer = new long[10];
private boolean alreadySwapped = false;
Expand All @@ -37,6 +38,8 @@ public void onInitializeClient() {
Registry.register(Registries.SOUND_EVENT, WOOSH_SOUND_ID, WOOSH_SOUND_EVENT);
keyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding("key.double_hotbar.swap", InputUtil.Type.KEYSYM,
GLFW.GLFW_KEY_R, KEYBIND_CATEGORY));
disableKeyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding("key.double_hotbar.disable", InputUtil.Type.KEYSYM,
GLFW.GLFW_KEY_UNKNOWN, KEYBIND_CATEGORY));
ClientTickEvents.END_CLIENT_TICK.register(client -> {
if (DHModConfig.INSTANCE.holdToSwap) {
if (keyBinding.isPressed() != this.hotbarKeys[9]) {
Expand Down Expand Up @@ -76,6 +79,9 @@ public void onInitializeClient() {
}
}
}
if (disableKeyBinding.wasPressed()) {
DHModConfig.INSTANCE.disableMod = !DHModConfig.INSTANCE.disableMod;
}
});
}

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/double_hotbar/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"key.category.double_hotbar.keybinds": "Double Hotbar",
"key.double_hotbar.swap": "Swap Hotbars",
"key.double_hotbar.disable": "Disable Second Hotbar",
"subtitles.double_hotbar.woosh": "Hotbar Woosh",
"text.autoconfig.double_hotbar.option.disableMod": "Disable Mod",
"text.autoconfig.double_hotbar.option.displayDoubleHotbar": "Show Second Hotbar",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/double_hotbar/lang/zh_tw.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"key.category.double_hotbar.keybinds": "雙層快捷欄 (Double Hotbar)",
"key.double_hotbar.swap": "切換快捷欄",
"key.double_hotbar.disable": "禁用第二個快速欄",
"subtitles.double_hotbar.woosh": "快捷欄切換音效",
"text.autoconfig.double_hotbar.option.disableMod": "停用模組",
"text.autoconfig.double_hotbar.option.displayDoubleHotbar": "顯示第二層快捷欄",
Expand Down