Skip to content

Commit

Permalink
Pause terminal item movement when shifting
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldoylecs committed Jan 26, 2025
1 parent 3f65118 commit 25300d4
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import appeng.api.config.TerminalStyle;
import appeng.api.config.YesNo;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IDisplayRepo;
import appeng.api.util.IConfigManager;
import appeng.api.util.IConfigurableObject;
import appeng.client.ActionKey;
Expand Down Expand Up @@ -88,7 +89,7 @@ public class GuiWirelessCraftingTerminal extends AEBaseGui
public static int craftingGridOffsetX = 80;
public static int craftingGridOffsetY;
private static String memoryText = "";
private final ItemRepo repo;
private final IDisplayRepo repo;
private final int offsetX = 8;
private final IConfigManager configSrc;
private GuiTabButton craftingStatusBtn;
Expand Down Expand Up @@ -654,6 +655,18 @@ protected void keyTyped(final char character, final int key) {
}
}

@Override
public void handleKeyboardInput() {
super.handleKeyboardInput();

// Pause the terminal when holding shift
this.repo.setPaused(hasShiftDown());
}

private boolean hasShiftDown() {
return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
}

protected boolean isPowered() {
return this.repo.hasPower();
}
Expand Down

0 comments on commit 25300d4

Please sign in to comment.