mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-24 01:58:42 +01:00
Revise Stage prompt names and events
This commit is contained in:
parent
a5578e3e59
commit
85eb514965
@ -57,7 +57,7 @@ import me.blackvein.quests.prompts.OptionsPrompt;
|
||||
import me.blackvein.quests.prompts.RequirementsPrompt;
|
||||
import me.blackvein.quests.prompts.RewardsPrompt;
|
||||
import me.blackvein.quests.prompts.PlannerPrompt;
|
||||
import me.blackvein.quests.prompts.StagesPrompt;
|
||||
import me.blackvein.quests.prompts.StageMenuPrompt;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.ConfigUtil;
|
||||
import me.blackvein.quests.util.ItemUtil;
|
||||
@ -475,7 +475,7 @@ public class QuestFactory implements ConversationAbandonedListener {
|
||||
case 10:
|
||||
return new PlannerPrompt(plugin, QuestFactory.this);
|
||||
case 11:
|
||||
return new StagesPrompt(plugin, QuestFactory.this);
|
||||
return new StageMenuPrompt(plugin, QuestFactory.this);
|
||||
case 12:
|
||||
return new RewardsPrompt(plugin, QuestFactory.this);
|
||||
case 13:
|
||||
@ -1356,7 +1356,7 @@ public class QuestFactory implements ConversationAbandonedListener {
|
||||
} else if (context.getSessionData(CK.Q_FINISH_MESSAGE) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorNeedFinishMessage"));
|
||||
return new QuestMainPrompt();
|
||||
} else if (new StagesPrompt(plugin, QuestFactory.this).getStages(context) == 0) {
|
||||
} else if (new StageMenuPrompt(plugin, QuestFactory.this).getStages(context) == 0) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorNeedStages"));
|
||||
return new QuestMainPrompt();
|
||||
}
|
||||
@ -1754,7 +1754,7 @@ public class QuestFactory implements ConversationAbandonedListener {
|
||||
String delayMessage;
|
||||
String startMessage;
|
||||
String completeMessage;
|
||||
for (int i = 1; i <= new StagesPrompt(plugin, this).getStages(cc); i++) {
|
||||
for (int i = 1; i <= new StageMenuPrompt(plugin, this).getStages(cc); i++) {
|
||||
pref = "stage" + i;
|
||||
ConfigurationSection stage = ordered.createSection("" + i);
|
||||
breakNames = null;
|
||||
|
@ -5,12 +5,12 @@ import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
|
||||
public class QuestsEditorPostOpenCreateStagePromptEvent extends QuestsEditorEvent {
|
||||
public class QuestsEditorPostOpenStageMainPromptEvent extends QuestsEditorEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private final QuestFactory factory;
|
||||
private final int stageNum;
|
||||
|
||||
public QuestsEditorPostOpenCreateStagePromptEvent(QuestFactory factory, int stageNum, ConversationContext context) {
|
||||
public QuestsEditorPostOpenStageMainPromptEvent(QuestFactory factory, int stageNum, ConversationContext context) {
|
||||
super(context);
|
||||
this.context = context;
|
||||
this.factory = factory;
|
@ -5,11 +5,11 @@ import org.bukkit.event.HandlerList;
|
||||
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
|
||||
public class QuestsEditorPostOpenStagesPromptEvent extends QuestsEditorEvent {
|
||||
public class QuestsEditorPostOpenStageMenuPromptEvent extends QuestsEditorEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private final QuestFactory factory;
|
||||
|
||||
public QuestsEditorPostOpenStagesPromptEvent(QuestFactory factory, ConversationContext context) {
|
||||
public QuestsEditorPostOpenStageMenuPromptEvent(QuestFactory factory, ConversationContext context) {
|
||||
super(context);
|
||||
this.context = context;
|
||||
this.factory = factory;
|
@ -131,7 +131,7 @@ public class BlocksPrompt extends FixedSetPrompt {
|
||||
return new CutBlockListPrompt();
|
||||
}
|
||||
try {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} catch (Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
|
@ -132,7 +132,7 @@ public class ItemsPrompt extends FixedSetPrompt {
|
||||
return new BrewListPrompt();
|
||||
}
|
||||
try {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} catch (Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
|
@ -138,7 +138,7 @@ public class MobsPrompt extends FixedSetPrompt {
|
||||
return new ShearListPrompt();
|
||||
}
|
||||
try {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} catch (Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
@ -302,13 +302,13 @@ public class MobsPrompt extends FixedSetPrompt {
|
||||
if (one == two) {
|
||||
if (three != 0 || four != 0 || five != 0) {
|
||||
if (two == three && three == four && four == five) {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new MobListPrompt();
|
||||
}
|
||||
} else {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
@ -540,7 +540,7 @@ public class MobsPrompt extends FixedSetPrompt {
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(pref + CK.S_FISH, null);
|
||||
}
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
}
|
||||
|
||||
@ -617,7 +617,7 @@ public class MobsPrompt extends FixedSetPrompt {
|
||||
two = 0;
|
||||
}
|
||||
if (one == two) {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new TameListPrompt();
|
||||
@ -787,7 +787,7 @@ public class MobsPrompt extends FixedSetPrompt {
|
||||
two = 0;
|
||||
}
|
||||
if (one == two) {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new ShearListPrompt();
|
||||
|
@ -127,25 +127,25 @@ public class NPCsPrompt extends FixedSetPrompt {
|
||||
return new DeliveryListPrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoCitizens"));
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase("2")) {
|
||||
if (plugin.getDependencies().getCitizens() != null) {
|
||||
return new NPCIDsToTalkToPrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoCitizens"));
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
} else if (input.equalsIgnoreCase("3")) {
|
||||
if (plugin.getDependencies().getCitizens() != null) {
|
||||
return new NPCKillListPrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoCitizens"));
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
}
|
||||
try {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} catch (Exception e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
@ -390,7 +390,7 @@ public class NPCsPrompt extends FixedSetPrompt {
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(pref + CK.S_NPCS_TO_TALK_TO, null);
|
||||
}
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
}
|
||||
|
||||
@ -469,7 +469,7 @@ public class NPCsPrompt extends FixedSetPrompt {
|
||||
two = 0;
|
||||
}
|
||||
if (one == two) {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new NPCKillListPrompt();
|
||||
|
@ -34,13 +34,13 @@ import me.blackvein.quests.CustomObjective;
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.actions.Action;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenCreateStagePromptEvent;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStageMainPromptEvent;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.ConfigUtil;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import me.blackvein.quests.util.MiscUtil;
|
||||
|
||||
public class CreateStagePrompt extends NumericPrompt {
|
||||
public class StageMainPrompt extends NumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
private final int stageNum;
|
||||
@ -49,7 +49,7 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
private boolean hasObjective = false;
|
||||
private final int size = 17;
|
||||
|
||||
public CreateStagePrompt(Quests plugin, int stageNum, QuestFactory qf) {
|
||||
public StageMainPrompt(Quests plugin, int stageNum, QuestFactory qf) {
|
||||
this.plugin = plugin;
|
||||
this.stageNum = stageNum;
|
||||
this.pref = "stage" + stageNum;
|
||||
@ -401,8 +401,8 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
context.setSessionData(pref, Boolean.TRUE);
|
||||
checkObjective(context);
|
||||
|
||||
QuestsEditorPostOpenCreateStagePromptEvent event
|
||||
= new QuestsEditorPostOpenCreateStagePromptEvent(questFactory, stageNum, context);
|
||||
QuestsEditorPostOpenStageMainPromptEvent event
|
||||
= new QuestsEditorPostOpenStageMainPromptEvent(questFactory, stageNum, context);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
String text = ChatColor.LIGHT_PURPLE + "- " + ChatColor.AQUA
|
||||
@ -438,32 +438,32 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
return new EventListPrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
case 10:
|
||||
if (hasObjective) {
|
||||
return new DelayPrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
case 11:
|
||||
if (context.getSessionData(pref + CK.S_DELAY) == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoDelaySet"));
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else {
|
||||
return new DelayMessagePrompt();
|
||||
}
|
||||
case 12:
|
||||
if (plugin.getDependencies().getDenizenAPI() == null) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNoDenizen"));
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else {
|
||||
if (hasObjective) {
|
||||
return new DenizenPrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
}
|
||||
case 13:
|
||||
@ -471,28 +471,28 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
return new StartMessagePrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
case 14:
|
||||
if (hasObjective) {
|
||||
return new CompleteMessagePrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
case 15:
|
||||
if (hasObjective) {
|
||||
return new OverrideDisplayPrompt();
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
case 16:
|
||||
return new DeletePrompt();
|
||||
case 17:
|
||||
return new StagesPrompt(plugin, questFactory);
|
||||
return new StageMenuPrompt(plugin, questFactory);
|
||||
default:
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
}
|
||||
|
||||
@ -616,7 +616,7 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
two = 0;
|
||||
}
|
||||
if (one == two) {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new PasswordListPrompt();
|
||||
@ -713,7 +713,7 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
context.setSessionData(pref + CK.S_OVERRIDE_DISPLAY, null);
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorObjectiveOverrideCleared"));
|
||||
}
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
}
|
||||
|
||||
@ -744,7 +744,7 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(pref + CK.S_PLAYER_KILL, null);
|
||||
}
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
}
|
||||
|
||||
@ -850,7 +850,7 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
three = 0;
|
||||
}
|
||||
if (one == two && two == three) {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listsNotSameSize"));
|
||||
return new ReachListPrompt();
|
||||
@ -1061,7 +1061,7 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
} else if (input.equalsIgnoreCase("6")) {
|
||||
return new CommandEventPrompt();
|
||||
} else if (input.equalsIgnoreCase("7")) {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else {
|
||||
return new EventListPrompt();
|
||||
}
|
||||
@ -1451,12 +1451,12 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
public Prompt acceptInput(ConversationContext context, String input) {
|
||||
Player player = (Player) context.getForWhom();
|
||||
if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(pref + CK.S_DELAY, null);
|
||||
player.sendMessage(ChatColor.GREEN + Lang.get("stageEditorDelayCleared"));
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
long stageDelay;
|
||||
try {
|
||||
@ -1471,7 +1471,7 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
return new DelayPrompt();
|
||||
} else {
|
||||
context.setSessionData(pref + CK.S_DELAY, stageDelay);
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1489,11 +1489,11 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false
|
||||
&& input.equalsIgnoreCase(Lang.get("cmdClear")) == false) {
|
||||
context.setSessionData(pref + CK.S_DELAY_MESSAGE, input);
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(pref + CK.S_DELAY_MESSAGE, null);
|
||||
player.sendMessage(ChatColor.YELLOW + Lang.get("stageEditorMessageCleared"));
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else {
|
||||
return new DelayMessagePrompt();
|
||||
}
|
||||
@ -1518,7 +1518,7 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
&& input.equalsIgnoreCase(Lang.get("cmdClear")) == false) {
|
||||
if (plugin.getDependencies().getDenizenAPI().containsScript(input)) {
|
||||
context.setSessionData(pref + CK.S_DENIZEN, input.toUpperCase());
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("stageEditorInvalidScript"));
|
||||
return new DenizenPrompt();
|
||||
@ -1526,9 +1526,9 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(pref + CK.S_DENIZEN, null);
|
||||
player.sendMessage(ChatColor.YELLOW + Lang.get("stageEditorDenizenCleared"));
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1550,11 +1550,11 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
public Prompt acceptInput(ConversationContext context, String input) {
|
||||
Player player = (Player) context.getForWhom();
|
||||
if (input.equalsIgnoreCase("1") || input.equalsIgnoreCase("Yes")) {
|
||||
new StagesPrompt(plugin, questFactory).deleteStage(context, stageNum);
|
||||
new StageMenuPrompt(plugin, questFactory).deleteStage(context, stageNum);
|
||||
player.sendMessage(ChatColor.YELLOW + Lang.get("stageEditorDeleteSucces"));
|
||||
return new StagesPrompt(plugin, questFactory);
|
||||
return new StageMenuPrompt(plugin, questFactory);
|
||||
} else if (input.equalsIgnoreCase("2") || input.equalsIgnoreCase("No")) {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||
return new DeletePrompt();
|
||||
@ -1575,13 +1575,13 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false
|
||||
&& input.equalsIgnoreCase(Lang.get("cmdClear")) == false) {
|
||||
context.setSessionData(pref + CK.S_START_MESSAGE, input);
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(pref + CK.S_START_MESSAGE, null);
|
||||
player.sendMessage(ChatColor.YELLOW + Lang.get("stageEditorMessageCleared"));
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1599,13 +1599,13 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false
|
||||
&& input.equalsIgnoreCase(Lang.get("cmdClear")) == false) {
|
||||
context.setSessionData(pref + CK.S_COMPLETE_MESSAGE, input);
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(pref + CK.S_COMPLETE_MESSAGE, null);
|
||||
player.sendMessage(ChatColor.YELLOW + Lang.get("stageEditorMessageCleared"));
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
} else {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1700,7 +1700,7 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
context.setSessionData(pref + CK.S_CUSTOM_OBJECTIVES_DATA_TEMP, null);
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorCustomCleared"));
|
||||
}
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1747,7 +1747,7 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
context.setSessionData(pref + CK.S_CUSTOM_OBJECTIVES_DATA_DESCRIPTIONS, found.getDescriptions());
|
||||
return new ObjectiveCustomDataListPrompt();
|
||||
} else {
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||
@ -1841,7 +1841,7 @@ public class CreateStagePrompt extends NumericPrompt {
|
||||
}
|
||||
}
|
||||
context.setSessionData(pref + CK.S_CUSTOM_OBJECTIVES_DATA_DESCRIPTIONS, null);
|
||||
return new CreateStagePrompt(plugin, stageNum, questFactory);
|
||||
return new StageMainPrompt(plugin, stageNum, questFactory);
|
||||
}
|
||||
}
|
||||
}
|
@ -19,17 +19,17 @@ import org.bukkit.conversations.Prompt;
|
||||
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStagesPromptEvent;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStageMenuPromptEvent;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
|
||||
public class StagesPrompt extends NumericPrompt {
|
||||
public class StageMenuPrompt extends NumericPrompt {
|
||||
|
||||
private final Quests plugin;
|
||||
private final QuestFactory questFactory;
|
||||
private int size = 2;
|
||||
|
||||
public StagesPrompt(Quests plugin, QuestFactory qf) {
|
||||
public StageMenuPrompt(Quests plugin, QuestFactory qf) {
|
||||
this.plugin = plugin;
|
||||
questFactory = qf;
|
||||
}
|
||||
@ -72,7 +72,7 @@ public class StagesPrompt extends NumericPrompt {
|
||||
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
QuestsEditorPostOpenStagesPromptEvent event = new QuestsEditorPostOpenStagesPromptEvent(questFactory, context);
|
||||
QuestsEditorPostOpenStageMenuPromptEvent event = new QuestsEditorPostOpenStageMenuPromptEvent(questFactory, context);
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
String text = ChatColor.LIGHT_PURPLE + "- " + getTitle() + " -\n";
|
||||
@ -89,14 +89,14 @@ public class StagesPrompt extends NumericPrompt {
|
||||
int stages = getStages(context);
|
||||
if (i > 0) {
|
||||
if (i < (stages + 1) && i > 0) {
|
||||
return new CreateStagePrompt(plugin, (i), questFactory);
|
||||
return new StageMainPrompt(plugin, (i), questFactory);
|
||||
} else if (i == (stages + 1)) {
|
||||
return new CreateStagePrompt(plugin, (stages + 1), questFactory);
|
||||
return new StageMainPrompt(plugin, (stages + 1), questFactory);
|
||||
} else if (i == (stages + 2)) {
|
||||
return questFactory.returnToMenu();
|
||||
}
|
||||
}
|
||||
return new StagesPrompt(plugin, questFactory);
|
||||
return new StageMenuPrompt(plugin, questFactory);
|
||||
}
|
||||
|
||||
public int getStages(ConversationContext context) {
|
Loading…
Reference in New Issue
Block a user