mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-03 17:29:57 +01:00
Remove initial action from main quests prompt, functional as legacy only
This commit is contained in:
parent
200a10efaa
commit
271c995a0c
@ -36,7 +36,6 @@ import com.sk89q.worldguard.protection.managers.RegionManager;
|
|||||||
|
|
||||||
import me.blackvein.quests.Quest;
|
import me.blackvein.quests.Quest;
|
||||||
import me.blackvein.quests.Quests;
|
import me.blackvein.quests.Quests;
|
||||||
import me.blackvein.quests.actions.Action;
|
|
||||||
import me.blackvein.quests.convo.generic.ItemStackPrompt;
|
import me.blackvein.quests.convo.generic.ItemStackPrompt;
|
||||||
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
|
||||||
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
|
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
|
||||||
@ -62,7 +61,7 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||||||
this.plugin = (Quests)context.getPlugin();
|
this.plugin = (Quests)context.getPlugin();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final int size = 15;
|
private final int size = 14;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSize() {
|
public int getSize() {
|
||||||
@ -97,22 +96,20 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||||||
return ChatColor.GRAY;
|
return ChatColor.GRAY;
|
||||||
}
|
}
|
||||||
case 7:
|
case 7:
|
||||||
return ChatColor.BLUE;
|
|
||||||
case 8:
|
|
||||||
if (plugin.getDependencies().getCitizens() != null) {
|
if (plugin.getDependencies().getCitizens() != null) {
|
||||||
return ChatColor.BLUE;
|
return ChatColor.BLUE;
|
||||||
} else {
|
} else {
|
||||||
return ChatColor.GRAY;
|
return ChatColor.GRAY;
|
||||||
}
|
}
|
||||||
|
case 8:
|
||||||
case 9:
|
case 9:
|
||||||
case 10:
|
case 10:
|
||||||
case 11:
|
case 11:
|
||||||
case 12:
|
case 12:
|
||||||
case 13:
|
|
||||||
return ChatColor.BLUE;
|
return ChatColor.BLUE;
|
||||||
case 14:
|
case 13:
|
||||||
return ChatColor.GREEN;
|
return ChatColor.GREEN;
|
||||||
case 15:
|
case 14:
|
||||||
return ChatColor.RED;
|
return ChatColor.RED;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
@ -147,26 +144,24 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||||||
return ChatColor.GRAY + Lang.get("questWGSetRegion");
|
return ChatColor.GRAY + Lang.get("questWGSetRegion");
|
||||||
}
|
}
|
||||||
case 7:
|
case 7:
|
||||||
return ChatColor.YELLOW + Lang.get("questEditorInitialEvent");
|
|
||||||
case 8:
|
|
||||||
if (plugin.getDependencies().getCitizens() != null) {
|
if (plugin.getDependencies().getCitizens() != null) {
|
||||||
return ChatColor.YELLOW + Lang.get("questEditorSetGUI");
|
return ChatColor.YELLOW + Lang.get("questEditorSetGUI");
|
||||||
} else {
|
} else {
|
||||||
return ChatColor.GRAY + Lang.get("questEditorSetGUI");
|
return ChatColor.GRAY + Lang.get("questEditorSetGUI");
|
||||||
}
|
}
|
||||||
case 9:
|
case 8:
|
||||||
return ChatColor.DARK_AQUA + Lang.get("questEditorReqs");
|
return ChatColor.DARK_AQUA + Lang.get("questEditorReqs");
|
||||||
case 10:
|
case 9:
|
||||||
return ChatColor.AQUA + Lang.get("questEditorPln");
|
return ChatColor.AQUA + Lang.get("questEditorPln");
|
||||||
case 11:
|
case 10:
|
||||||
return ChatColor.LIGHT_PURPLE + Lang.get("questEditorStages");
|
return ChatColor.LIGHT_PURPLE + Lang.get("questEditorStages");
|
||||||
case 12:
|
case 11:
|
||||||
return ChatColor.DARK_PURPLE + Lang.get("questEditorRews");
|
return ChatColor.DARK_PURPLE + Lang.get("questEditorRews");
|
||||||
case 13:
|
case 12:
|
||||||
return ChatColor.DARK_GREEN + Lang.get("questEditorOpts");
|
return ChatColor.DARK_GREEN + Lang.get("questEditorOpts");
|
||||||
case 14:
|
case 13:
|
||||||
return ChatColor.GREEN + Lang.get("save");
|
return ChatColor.GREEN + Lang.get("save");
|
||||||
case 15:
|
case 14:
|
||||||
return ChatColor.RED + Lang.get("exit");
|
return ChatColor.RED + Lang.get("exit");
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
@ -214,13 +209,6 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||||
}
|
}
|
||||||
case 7:
|
case 7:
|
||||||
if (context.getSessionData(CK.Q_INITIAL_EVENT) == null) {
|
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
|
||||||
} else {
|
|
||||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + (String) context.getSessionData(CK.Q_INITIAL_EVENT)
|
|
||||||
+ ChatColor.RESET + ChatColor.GRAY + ")";
|
|
||||||
}
|
|
||||||
case 8:
|
|
||||||
if (plugin.getDependencies().getCitizens() != null) {
|
if (plugin.getDependencies().getCitizens() != null) {
|
||||||
if (context.getSessionData(CK.Q_GUIDISPLAY) == null) {
|
if (context.getSessionData(CK.Q_GUIDISPLAY) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
@ -231,13 +219,13 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||||||
} else {
|
} else {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||||
}
|
}
|
||||||
|
case 8:
|
||||||
case 9:
|
case 9:
|
||||||
case 10:
|
case 10:
|
||||||
case 11:
|
case 11:
|
||||||
case 12:
|
case 12:
|
||||||
case 13:
|
case 13:
|
||||||
case 14:
|
case 14:
|
||||||
case 15:
|
|
||||||
return "";
|
return "";
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
@ -290,26 +278,24 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||||||
return new QuestMainPrompt(context);
|
return new QuestMainPrompt(context);
|
||||||
}
|
}
|
||||||
case 7:
|
case 7:
|
||||||
return new QuestInitialActionPrompt(context);
|
|
||||||
case 8:
|
|
||||||
if (plugin.getDependencies().getCitizens() != null) {
|
if (plugin.getDependencies().getCitizens() != null) {
|
||||||
return new QuestGuiDisplayPrompt(context);
|
return new QuestGuiDisplayPrompt(context);
|
||||||
} else {
|
} else {
|
||||||
return new QuestMainPrompt(context);
|
return new QuestMainPrompt(context);
|
||||||
}
|
}
|
||||||
case 9:
|
case 8:
|
||||||
return new RequirementsPrompt(context);
|
return new RequirementsPrompt(context);
|
||||||
case 10:
|
case 9:
|
||||||
return new PlannerPrompt(context);
|
return new PlannerPrompt(context);
|
||||||
case 11:
|
case 10:
|
||||||
return new StageMenuPrompt(context);
|
return new StageMenuPrompt(context);
|
||||||
case 12:
|
case 11:
|
||||||
return new RewardsPrompt(context);
|
return new RewardsPrompt(context);
|
||||||
case 13:
|
case 12:
|
||||||
return new OptionsPrompt(context);
|
return new OptionsPrompt(context);
|
||||||
case 14:
|
case 13:
|
||||||
return new QuestSavePrompt(context);
|
return new QuestSavePrompt(context);
|
||||||
case 15:
|
case 14:
|
||||||
return new QuestExitPrompt(context);
|
return new QuestExitPrompt(context);
|
||||||
default:
|
default:
|
||||||
return new QuestMainPrompt(context);
|
return new QuestMainPrompt(context);
|
||||||
@ -656,57 +642,6 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class QuestInitialActionPrompt extends QuestsEditorStringPrompt {
|
|
||||||
|
|
||||||
public QuestInitialActionPrompt(final ConversationContext context) {
|
|
||||||
super(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTitle(final ConversationContext context) {
|
|
||||||
return Lang.get("eventTitle");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getQueryText(final ConversationContext context) {
|
|
||||||
return Lang.get("questEditorEnterInitialEvent");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getPromptText(final ConversationContext context) {
|
|
||||||
String text = ChatColor.AQUA + getTitle(context) + "\n";
|
|
||||||
if (plugin.getActions().isEmpty()) {
|
|
||||||
text += ChatColor.RED + "- " + Lang.get("none");
|
|
||||||
} else {
|
|
||||||
for (final Action e : plugin.getActions()) {
|
|
||||||
text += ChatColor.GREEN + "- " + e.getName() + "\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return text + ChatColor.YELLOW + getQueryText(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Prompt acceptInput(final ConversationContext context, final String input) {
|
|
||||||
if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false
|
|
||||||
&& input.equalsIgnoreCase(Lang.get("cmdClear")) == false) {
|
|
||||||
final Action a = plugin.getAction(input);
|
|
||||||
if (a != null) {
|
|
||||||
context.setSessionData(CK.Q_INITIAL_EVENT, a.getName());
|
|
||||||
return new QuestMainPrompt(context);
|
|
||||||
}
|
|
||||||
context.getForWhom().sendRawMessage(ChatColor.RED + input + ChatColor.YELLOW + " "
|
|
||||||
+ Lang.get("questEditorInvalidEventName"));
|
|
||||||
return new QuestInitialActionPrompt(context);
|
|
||||||
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
|
||||||
context.setSessionData(CK.Q_INITIAL_EVENT, null);
|
|
||||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("questEditorEventCleared"));
|
|
||||||
return new QuestMainPrompt(context);
|
|
||||||
} else {
|
|
||||||
return new QuestMainPrompt(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class QuestGuiDisplayPrompt extends QuestsEditorNumericPrompt {
|
public class QuestGuiDisplayPrompt extends QuestsEditorNumericPrompt {
|
||||||
|
|
||||||
private final Quests plugin;
|
private final Quests plugin;
|
||||||
|
@ -58,7 +58,6 @@ questEditorAskMessage: "Set ask message"
|
|||||||
questEditorFinishMessage: "Set finish message"
|
questEditorFinishMessage: "Set finish message"
|
||||||
questEditorNPCStart: "Set NPC start"
|
questEditorNPCStart: "Set NPC start"
|
||||||
questEditorBlockStart: "Set block start"
|
questEditorBlockStart: "Set block start"
|
||||||
questEditorInitialEvent: "Set initial action"
|
|
||||||
questEditorSetGUI: "Set GUI item display"
|
questEditorSetGUI: "Set GUI item display"
|
||||||
questEditorReqs: "Edit Requirements"
|
questEditorReqs: "Edit Requirements"
|
||||||
questEditorPln: "Edit Planner"
|
questEditorPln: "Edit Planner"
|
||||||
@ -72,7 +71,6 @@ questEditorEnterAskMessage: "Enter ask message, <cancel>"
|
|||||||
questEditorEnterFinishMessage: "Enter finish message, <cancel>"
|
questEditorEnterFinishMessage: "Enter finish message, <cancel>"
|
||||||
questEditorEnterNPCStart: "Enter NPC ID, <clear>, <cancel>"
|
questEditorEnterNPCStart: "Enter NPC ID, <clear>, <cancel>"
|
||||||
questEditorEnterBlockStart: "Right-click on a block to use as a start point, <done>, <clear>, <cancel>"
|
questEditorEnterBlockStart: "Right-click on a block to use as a start point, <done>, <clear>, <cancel>"
|
||||||
questEditorEnterInitialEvent: "Enter an action name, <clear>, <cancel>"
|
|
||||||
questDungeonsCreate: "Players added to this group may perform quests together!"
|
questDungeonsCreate: "Players added to this group may perform quests together!"
|
||||||
questDungeonsDisband: "The quest group was disbanded."
|
questDungeonsDisband: "The quest group was disbanded."
|
||||||
questDungeonsInvite: "<player> can now perform quests with you!"
|
questDungeonsInvite: "<player> can now perform quests with you!"
|
||||||
@ -96,7 +94,6 @@ questDeleted: "Quest deleted! Quest and action data has been reloaded."
|
|||||||
questEditorNameExists: "A quest with that name already exists!"
|
questEditorNameExists: "A quest with that name already exists!"
|
||||||
questEditorBeingEdited: "Something with that name is already being modified!"
|
questEditorBeingEdited: "Something with that name is already being modified!"
|
||||||
questEditorInvalidQuestName: "Name may not contain periods or commas!"
|
questEditorInvalidQuestName: "Name may not contain periods or commas!"
|
||||||
questEditorInvalidEventName: "is not a valid action name!"
|
|
||||||
questEditorInvalidNPC: "No NPC exists with that ID!"
|
questEditorInvalidNPC: "No NPC exists with that ID!"
|
||||||
questEditorNoStartBlockSelected: "You must select a block first."
|
questEditorNoStartBlockSelected: "You must select a block first."
|
||||||
questEditorPositiveAmount: "Amount must be a positive number."
|
questEditorPositiveAmount: "Amount must be a positive number."
|
||||||
@ -104,7 +101,6 @@ questEditorQuestAsRequirement1: "The following quests have"
|
|||||||
questEditorQuestAsRequirement2: "as a requirement:"
|
questEditorQuestAsRequirement2: "as a requirement:"
|
||||||
questEditorQuestAsRequirement3: "You must modify these quests so that they do not use it before deleting it."
|
questEditorQuestAsRequirement3: "You must modify these quests so that they do not use it before deleting it."
|
||||||
questEditorQuestNotFound: "Quest not found!"
|
questEditorQuestNotFound: "Quest not found!"
|
||||||
questEditorEventCleared: "Initial action cleared."
|
|
||||||
questEditorSave: "Finish and save?"
|
questEditorSave: "Finish and save?"
|
||||||
questEditorNeedAskMessage: "You must set an ask message!"
|
questEditorNeedAskMessage: "You must set an ask message!"
|
||||||
questEditorNeedFinishMessage: "You must set a finish message!"
|
questEditorNeedFinishMessage: "You must set a finish message!"
|
||||||
@ -618,7 +614,6 @@ phatLootsRewardsTitle: "- PhatLoots Rewards -"
|
|||||||
customRequirementsTitle: "- Custom Requirements -"
|
customRequirementsTitle: "- Custom Requirements -"
|
||||||
customRewardsTitle: "- Custom Rewards -"
|
customRewardsTitle: "- Custom Rewards -"
|
||||||
skillListTitle: "- Skill List -"
|
skillListTitle: "- Skill List -"
|
||||||
eventTitle: "- Action -"
|
|
||||||
topQuestersTitle: "- Top <number> Questers -"
|
topQuestersTitle: "- Top <number> Questers -"
|
||||||
createItemTitle: "- Create Item -"
|
createItemTitle: "- Create Item -"
|
||||||
dateTimeTitle: "- Date & Time -"
|
dateTimeTitle: "- Date & Time -"
|
||||||
|
Loading…
Reference in New Issue
Block a user