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
1 change: 1 addition & 0 deletions src/main/java/com/sidezbros/double_hotbar/DHModConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public static void init() {
public int inventoryRow = 3;
public boolean holdToSwap = true;
public boolean holdToSwapBar = false;
public boolean pressToSwapActive = false;
public boolean allowDoubleTap = true;
@ConfigEntry.BoundedDiscrete(min = 50, max = 1000)
public int holdTime = 200;
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/com/sidezbros/double_hotbar/DoubleHotbar.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ 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));

ClientTickEvents.END_CLIENT_TICK.register(client -> {

if (DHModConfig.INSTANCE.holdToSwap) {
if (keyBinding.isPressed() != this.hotbarKeys[9]) {
this.hotbarKeys[9] = keyBinding.isPressed();
Expand All @@ -56,11 +58,16 @@ public void onInitializeClient() {
this.swapStack(client.player, DHModConfig.INSTANCE.holdToSwapBar, client.player.getInventory().getSelectedSlot());
this.alreadySwapped = true;
}

} else {
while (keyBinding.wasPressed()) {
this.swapStack(client.player, true, 0);
this.swapStack(
client.player,
!DHModConfig.INSTANCE.pressToSwapActive, // short version of "DHModConfig.INSTANCE.pressToSwapActive ? false : true"
DHModConfig.INSTANCE.pressToSwapActive ? client.player.getInventory().getSelectedSlot() : 0);
}
}

if (DHModConfig.INSTANCE.allowDoubleTap) {
for (int i = 0; i < 9; i++) {
if (client.options.hotbarKeys[i].isPressed() != this.hotbarKeys[i]) {
Expand All @@ -76,6 +83,7 @@ public void onInitializeClient() {
}
}
}

});
}

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
Expand Up @@ -12,6 +12,7 @@
"text.autoconfig.double_hotbar.option.holdTime": "Hold to Swap Time (ms)",
"text.autoconfig.double_hotbar.option.renderCrop": "Crop Hotbar Height (pixels)",
"text.autoconfig.double_hotbar.option.holdToSwapBar": "Hold to Swap Entire Bar",
"text.autoconfig.double_hotbar.option.pressToSwapActive": "Replacing the active item when pressed",
"text.autoconfig.double_hotbar.option.wooshVolume": "Sound Effect Volume (%)",
"text.autoconfig.double_hotbar.option.reverseBars": "Main Hotbar On Top",
"text.autoconfig.double_hotbar.title":"Double Hotbar Config"
Expand Down
20 changes: 20 additions & 0 deletions src/main/resources/assets/double_hotbar/lang/ru_ru.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"key.category.double_hotbar.keybinds": "Double Hotbar",
"key.double_hotbar.swap": "Сменить Хотбар",
"subtitles.double_hotbar.woosh": "Hotbar Woosh",
"text.autoconfig.double_hotbar.option.disableMod": "Отключить мод",
"text.autoconfig.double_hotbar.option.displayDoubleHotbar": "Показывать второй хотбар",
"text.autoconfig.double_hotbar.option.inventoryRow": "Выбранная строка инвентаря",
"text.autoconfig.double_hotbar.option.shift": "Позиция по вертикали",
"text.autoconfig.double_hotbar.option.allowDoubleTap": "Включить двойное нажатие",
"text.autoconfig.double_hotbar.option.doubleTapWindow": "Время для двойного нажатия (ms)",
"text.autoconfig.double_hotbar.option.holdToSwap": "Режим \"Удержать для замены\"",
"text.autoconfig.double_hotbar.option.holdTime": "Время удержания для замены (ms)",
"text.autoconfig.double_hotbar.option.renderCrop": "Обрезать высоту хотбара (pixels)",
"text.autoconfig.double_hotbar.option.holdToSwapBar": "Удержать для смены всего хотбара",
"text.autoconfig.double_hotbar.option.pressToSwapActive": "Замена активного предмета при нажатию",
"text.autoconfig.double_hotbar.option.wooshVolume": "Громкость звукового эффекта (%)",
"text.autoconfig.double_hotbar.option.reverseBars": "Закрепить Хотбар наверху",
"text.autoconfig.double_hotbar.title":"Настройки Double Hotbar"

}
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
Expand Up @@ -12,6 +12,7 @@
"text.autoconfig.double_hotbar.option.holdTime": "長按切換時間(毫秒)",
"text.autoconfig.double_hotbar.option.renderCrop": "快捷欄高度裁剪(像素)",
"text.autoconfig.double_hotbar.option.holdToSwapBar": "長按切換整個快捷欄",
"text.autoconfig.double_hotbar.option.pressToSwapActive": "按下时替换活动项",
"text.autoconfig.double_hotbar.option.wooshVolume": "音效音量 (%)",
"text.autoconfig.double_hotbar.option.reverseBars": "主要快捷欄置頂",
"text.autoconfig.double_hotbar.title": "雙層快捷欄設定"
Expand Down