Undo/Redo keys can now be held down.

Implemented throttling intervals for KeyPresets for both first press & all subsequent presses
This commit is contained in:
bigguy345 committed 2025-12-20 12:51:49 +02:00
1 parent 39c768e965
commit 05bb9c0081
2 files changed
+37 -3

No files matched your search

@@ -731,7 +731,7 @@ public class GuiScriptTextArea extends GuiNpcTextField {
// UNDO: Restore last edit from undo list
// Works in search bar.
KEYS.UNDO.setTask(e -> {
if (!e.isPress() || !isActive.get() && !searchBar.isVisible())
if ((!e.isPress() && !e.isHold()) || !isActive.get() && !searchBar.isVisible())
return;
if (searchBar.hasFocus()) {
@@ -753,7 +753,7 @@ public class GuiScriptTextArea extends GuiNpcTextField {
// REDO: Restore last undone edit from redo list
// Works in search bar.
KEYS.REDO.setTask(e -> {
if (!e.isPress() || !isActive.get() && !searchBar.isVisible())
if ((!e.isPress() && !e.isHold()) || !isActive.get() && !searchBar.isVisible())
return;
if (searchBar.hasFocus()) {