mirror of
https://github.com/PikaMug/Quests.git
synced 2025-01-13 11:41:21 +01:00
Correct string replacement, part 2
This commit is contained in:
parent
c7cfa9aaa5
commit
8a218031cf
@ -12,12 +12,12 @@
|
|||||||
|
|
||||||
package me.blackvein.quests.convo.generic;
|
package me.blackvein.quests.convo.generic;
|
||||||
|
|
||||||
|
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
|
||||||
|
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStringPromptEvent;
|
||||||
|
import me.blackvein.quests.util.Lang;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.conversations.ConversationContext;
|
import org.bukkit.conversations.ConversationContext;
|
||||||
import org.bukkit.conversations.Prompt;
|
import org.bukkit.conversations.Prompt;
|
||||||
|
|
||||||
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
|
|
||||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStringPromptEvent;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class OverridePrompt extends QuestsEditorStringPrompt {
|
public class OverridePrompt extends QuestsEditorStringPrompt {
|
||||||
@ -60,8 +60,15 @@ public class OverridePrompt extends QuestsEditorStringPrompt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Prompt acceptInput(final ConversationContext context, final String input) {
|
public Prompt acceptInput(final @NotNull ConversationContext context, final String input) {
|
||||||
|
if (input != null) {
|
||||||
|
if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||||
|
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorMessageCleared"));
|
||||||
|
context.setSessionData(classPrefix + "-override", Lang.get("cmdClear"));
|
||||||
|
} else if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||||
context.setSessionData(classPrefix + "-override", input);
|
context.setSessionData(classPrefix + "-override", input);
|
||||||
|
}
|
||||||
|
}
|
||||||
return oldPrompt;
|
return oldPrompt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -436,8 +436,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
|||||||
@Override
|
@Override
|
||||||
public @NotNull String getBasicPromptText(final ConversationContext context) {
|
public @NotNull String getBasicPromptText(final ConversationContext context) {
|
||||||
final String input = (String) context.getSessionData(classPrefix + "-override");
|
final String input = (String) context.getSessionData(classPrefix + "-override");
|
||||||
if (input != null && !input.equalsIgnoreCase(Lang.get("cancel"))) {
|
if (input != null && !input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||||
if (input.equalsIgnoreCase(Lang.get("clear"))) {
|
if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||||
context.setSessionData(stagePrefix + CK.S_OVERRIDE_DISPLAY, null);
|
context.setSessionData(stagePrefix + CK.S_OVERRIDE_DISPLAY, null);
|
||||||
} else {
|
} else {
|
||||||
final LinkedList<String> overrides = new LinkedList<>();
|
final LinkedList<String> overrides = new LinkedList<>();
|
||||||
|
Loading…
Reference in New Issue
Block a user