diff --git a/src/main/java/world/bentobox/challenges/panel/CommonGUI.java b/src/main/java/world/bentobox/challenges/panel/CommonGUI.java index 39897d6..b50b360 100644 --- a/src/main/java/world/bentobox/challenges/panel/CommonGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/CommonGUI.java @@ -1085,7 +1085,13 @@ public abstract class CommonGUI // On cancel conversation will be closed. withEscapeSequence("cancel"). // Use null value in consumer to detect if user has abandoned conversation. - addConversationAbandonedListener(abandonedEvent -> consumer.accept(null)). + addConversationAbandonedListener(abandonedEvent -> + { + if (!abandonedEvent.gracefulExit()) + { + consumer.accept(null); + } + }). withPrefix(context -> user.getTranslation("challenges.gui.questions.prefix")). buildConversation(user.getPlayer()); diff --git a/src/main/java/world/bentobox/challenges/panel/admin/AdminGUI.java b/src/main/java/world/bentobox/challenges/panel/admin/AdminGUI.java index a0efdd7..216d6f1 100644 --- a/src/main/java/world/bentobox/challenges/panel/admin/AdminGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/admin/AdminGUI.java @@ -720,7 +720,13 @@ public class AdminGUI extends CommonGUI // On cancel conversation will be closed. withEscapeSequence("cancel"). // Use null value in consumer to detect if user has abandoned conversation. - addConversationAbandonedListener(abandonedEvent -> consumer.accept(null)). + addConversationAbandonedListener(abandonedEvent -> + { + if (!abandonedEvent.gracefulExit()) + { + consumer.accept(null); + } + }). withLocalEcho(false). withPrefix(context -> user.getTranslation("challenges.gui.questions.prefix")). buildConversation(user.getPlayer()); diff --git a/src/main/java/world/bentobox/challenges/panel/util/NumberGUI.java b/src/main/java/world/bentobox/challenges/panel/util/NumberGUI.java index 4f00cbc..e58a153 100644 --- a/src/main/java/world/bentobox/challenges/panel/util/NumberGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/util/NumberGUI.java @@ -480,7 +480,13 @@ public class NumberGUI // On cancel conversation will be closed. withEscapeSequence("cancel"). // Use null value in consumer to detect if user has abandoned conversation. - addConversationAbandonedListener(abandonedEvent -> consumer.accept(null)). + addConversationAbandonedListener(abandonedEvent -> + { + if (!abandonedEvent.gracefulExit()) + { + consumer.accept(null); + } + }). withPrefix(context -> NumberGUI.this.user.getTranslation("challenges.gui.questions.prefix")). buildConversation(user.getPlayer()); diff --git a/src/main/java/world/bentobox/challenges/panel/util/StringListGUI.java b/src/main/java/world/bentobox/challenges/panel/util/StringListGUI.java index 0e7ea8f..07f30a3 100644 --- a/src/main/java/world/bentobox/challenges/panel/util/StringListGUI.java +++ b/src/main/java/world/bentobox/challenges/panel/util/StringListGUI.java @@ -305,7 +305,13 @@ public class StringListGUI // On cancel conversation will be closed. withEscapeSequence("cancel"). // Use null value in consumer to detect if user has abandoned conversation. - addConversationAbandonedListener(abandonedEvent -> consumer.accept(null)). + addConversationAbandonedListener(abandonedEvent -> + { + if (!abandonedEvent.gracefulExit()) + { + consumer.accept(null); + } + }). withLocalEcho(false). withPrefix(context -> user.getTranslation("challenges.gui.questions.prefix")). buildConversation(user.getPlayer());