From 1146695996bc5a46e38cae619a271dbdad66f3ac Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Tue, 6 Sep 2022 14:35:56 +0300 Subject: Fix unfocusing item slots not resetting the focused slot to -1 --- src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java index ec8ae96..fd94100 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java @@ -407,6 +407,11 @@ public class WItemSlot extends WWidget { } } + @Override + public void onFocusLost() { + focusedSlot = -1; + } + /** * Adds a change listener to this slot. * Does nothing if the listener is already registered. -- cgit