mirror of
https://github.com/PikaMug/Quests.git
synced 2025-03-02 11:31:10 +01:00
Prevent editor from closing on invalid numeric prompt input
This commit is contained in:
parent
4b25d24ea1
commit
b705c4bddb
@ -242,7 +242,7 @@ public class QuestFactory implements ConversationAbandonedListener {
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("exited"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
default:
|
||||
return null;
|
||||
return new QuestMenuPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -511,7 +511,7 @@ public class QuestFactory implements ConversationAbandonedListener {
|
||||
case 15:
|
||||
return new ExitPrompt(context);
|
||||
default:
|
||||
return null;
|
||||
return new QuestMainPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
((Player) context.getForWhom()).sendMessage(ChatColor.YELLOW + Lang.get("exited"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
default:
|
||||
return null;
|
||||
return new ActionMenuPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -428,7 +428,7 @@ public class ActionFactory implements ConversationAbandonedListener {
|
||||
case 10:
|
||||
return new ExitPrompt();
|
||||
default:
|
||||
return null;
|
||||
return new ActionMainPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
return new BlocksPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ public class DateTimePrompt extends QuestsEditorNumericPrompt {
|
||||
}
|
||||
return oldPrompt;
|
||||
default:
|
||||
return null;
|
||||
return new DateTimePrompt(context, oldPrompt, source);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ public class GUIDisplayPrompt extends QuestsEditorNumericPrompt {
|
||||
case 3:
|
||||
return plugin.getQuestFactory().returnToMenu(context);
|
||||
default:
|
||||
return null;
|
||||
return new GUIDisplayPrompt(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ public class ItemsPrompt extends QuestsEditorNumericPrompt {
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
return new ItemsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ public class MobsPrompt extends QuestsEditorNumericPrompt {
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
return new MobsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -198,7 +198,7 @@ public class NPCsPrompt extends QuestsEditorNumericPrompt {
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
return new NPCsPrompt(stageNum, context);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
||||
case 3:
|
||||
return plugin.getQuestFactory().returnToMenu(context);
|
||||
default:
|
||||
return null;
|
||||
return new OptionsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ public class PlannerPrompt extends QuestsEditorNumericPrompt {
|
||||
case 5:
|
||||
return plugin.getQuestFactory().returnToMenu(context);
|
||||
default:
|
||||
return null;
|
||||
return new PlannerPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -369,7 +369,7 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
||||
case 11:
|
||||
return plugin.getQuestFactory().returnToMenu(context);
|
||||
default:
|
||||
return null;
|
||||
return new RequirementsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -415,7 +415,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
||||
case 12:
|
||||
return plugin.getQuestFactory().returnToMenu(context);
|
||||
default:
|
||||
return null;
|
||||
return new RewardsPrompt(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -241,9 +241,10 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
return "";
|
||||
}
|
||||
case 4:
|
||||
if (context.getSessionData(stagePrefix + CK.S_MOB_TYPES) == null
|
||||
&& context.getSessionData(stagePrefix + CK.S_FISH) == null
|
||||
if (context.getSessionData(stagePrefix + CK.S_MOB_TYPES) == null
|
||||
&& context.getSessionData(stagePrefix + CK.S_TAME_TYPES) == null
|
||||
&& context.getSessionData(stagePrefix + CK.S_FISH) == null
|
||||
&& context.getSessionData(stagePrefix + CK.S_COW_MILK) == null
|
||||
&& context.getSessionData(stagePrefix + CK.S_SHEAR_COLORS) == null) {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user