Fast bug fix when users could not write a valid input via chat message.

This commit is contained in:
BONNe 2020-05-02 00:17:26 +03:00
commit 4caeee6d64
5 changed files with 29 additions and 5 deletions

View File

@ -42,7 +42,7 @@
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- This allows to change between versions and snapshots. -->
<build.version>0.8.1</build.version>
<build.version>0.8.2</build.version>
<build.number>-LOCAL</build.number>
</properties>

View File

@ -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());

View File

@ -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());

View File

@ -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());

View File

@ -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());