From 83ce1dd9df2efddba60b220d6a0cd0c480420e40 Mon Sep 17 00:00:00 2001 From: Aeltumn Date: Thu, 10 Oct 2024 20:09:15 +0200 Subject: [PATCH] fix: Fix chat queries not re-opening menus --- .../kotlin/com/noxcrew/interfaces/InterfacesListeners.kt | 4 ++++ .../com/noxcrew/interfaces/view/AbstractInterfaceView.kt | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/interfaces/src/main/kotlin/com/noxcrew/interfaces/InterfacesListeners.kt b/interfaces/src/main/kotlin/com/noxcrew/interfaces/InterfacesListeners.kt index 164d581..c60eb2e 100644 --- a/interfaces/src/main/kotlin/com/noxcrew/interfaces/InterfacesListeners.kt +++ b/interfaces/src/main/kotlin/com/noxcrew/interfaces/InterfacesListeners.kt @@ -703,8 +703,12 @@ public class InterfacesListeners private constructor(private val plugin: Plugin) runSync { // Close the current inventory to open another to avoid close reasons + val reopen = view.shouldStillBeOpened view.player.closeInventory(Reason.OPEN_NEW) + // Ensure the view is allowed to be opened again after we're done + if (reopen) (view as AbstractInterfaceView<*, *, *>).markAsReopenable() + // Clear the inventory view.player.inventory.clear() } diff --git a/interfaces/src/main/kotlin/com/noxcrew/interfaces/view/AbstractInterfaceView.kt b/interfaces/src/main/kotlin/com/noxcrew/interfaces/view/AbstractInterfaceView.kt index 497946c..bf00eda 100644 --- a/interfaces/src/main/kotlin/com/noxcrew/interfaces/view/AbstractInterfaceView.kt +++ b/interfaces/src/main/kotlin/com/noxcrew/interfaces/view/AbstractInterfaceView.kt @@ -94,6 +94,11 @@ public abstract class AbstractInterfaceView