diff --git a/src/main/java/com/cstav/genshinstrument/client/gui/screens/instrument/partial/AbstractInstrumentScreen.java b/src/main/java/com/cstav/genshinstrument/client/gui/screens/instrument/partial/AbstractInstrumentScreen.java index 249f3e3..636746b 100644 --- a/src/main/java/com/cstav/genshinstrument/client/gui/screens/instrument/partial/AbstractInstrumentScreen.java +++ b/src/main/java/com/cstav/genshinstrument/client/gui/screens/instrument/partial/AbstractInstrumentScreen.java @@ -200,7 +200,7 @@ public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers) { } @Override public boolean keyReleased(int pKeyCode, int pScanCode, int pModifiers) { - unlockFocused(); + unlockFocused(pKeyCode); final NoteButton note = getNoteByKey(pKeyCode); if (note != null) @@ -225,6 +225,7 @@ public NoteButton getNoteByKey(final int keyCode) { return noteMap().containsKey(key) ? noteMap().get(key) : null; } + /** * Unlocks any focused {@link NoteButton}s */ @@ -235,6 +236,15 @@ private void unlockFocused() { return; } } + /** + * Unlocks a {@link NoteButton} based on its corresponding key + */ + private void unlockFocused(final int keyCode) { + final NoteButton note = getNoteByKey(keyCode); + + if (note != null) + note.locked = false; + } //#region Making the options screen function