*Multiple lines of text.

*add extra text to description and finish text.
This commit is contained in:
Zino 2013-08-06 21:11:25 +02:00
parent cfb567f59c
commit 83bdc7b458
6 changed files with 1029 additions and 993 deletions

View File

@ -107,7 +107,11 @@ public class NpcListener implements Listener {
quester.questToTake = q.name;
String s = extracted(quester);
player.sendMessage(s);
for (String msg : s.split("<br>")) {
player.sendMessage(msg);
}
plugin.conversationFactory.buildConversation((Conversable) player).begin();
} else if (quester.currentQuest.equals(q) == false) {
@ -128,7 +132,9 @@ public class NpcListener implements Listener {
quester.questToTake = q.name;
String s = extracted(quester);
player.sendMessage(s);
for (String msg : s.split("<br>")) {
player.sendMessage(msg);
}
plugin.conversationFactory.buildConversation((Conversable) player).begin();
}

View File

@ -143,7 +143,10 @@ public class PlayerListener implements Listener {
+ "\n"
+ ChatColor.RESET + plugin.getQuest(quester.questToTake).description + "\n";
player.sendMessage(s);
for (String msg : s.split("<br>")) {
player.sendMessage(msg);
}
plugin.conversationFactory.buildConversation((Conversable) player).begin();
}

View File

@ -173,7 +173,13 @@ public class Quest {
q.reset();
q.completedQuests.add(name);
String none = ChatColor.GRAY + "- (None)";
player.sendMessage(Quests.parseString(finished, q.currentQuest));
String ps = Quests.parseString(finished, q.currentQuest);
for (String msg : ps.split("<br>")) {
player.sendMessage(msg);
}
if(moneyReward > 0 && Quests.economy != null){
Quests.economy.depositPlayer(q.name, moneyReward);
none = null;

View File

@ -611,6 +611,12 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
public Prompt acceptInput(ConversationContext context, String input) {
if (input.equalsIgnoreCase("cancel") == false) {
if (input.startsWith("++")) {
if (context.getSessionData(CK.Q_ASK_MESSAGE) != null) {
context.setSessionData(CK.Q_ASK_MESSAGE, context.getSessionData(CK.Q_ASK_MESSAGE) + " " + input.substring(2));
return new CreateMenuPrompt();
}
}
context.setSessionData(CK.Q_ASK_MESSAGE, input);
}
@ -632,6 +638,12 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
public Prompt acceptInput(ConversationContext context, String input) {
if (input.equalsIgnoreCase("cancel") == false) {
if (input.startsWith("++")) {
if (context.getSessionData(CK.Q_FINISH_MESSAGE) != null) {
context.setSessionData(CK.Q_FINISH_MESSAGE, context.getSessionData(CK.Q_FINISH_MESSAGE) + " " + input.substring(2));
return new CreateMenuPrompt();
}
}
context.setSessionData(CK.Q_FINISH_MESSAGE, input);
}

View File

@ -222,8 +222,8 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
loadEvents();
log.log(Level.INFO, "[Quests] " + quests.size() + " Quest(s) loaded.");
log.log(Level.INFO, "[Quests] " + events.size() + " Event(s) loaded.");
questers.putAll(getOnlineQuesters());
if (snoop) {
questers.putAll(getOnlineQuesters());
snoop();
}
}
@ -779,6 +779,11 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
+ RESET + getQuest(quester.questToTake).description + "\n";
cs.sendMessage(s);
for (String msg : s.split("<br>")) {
cs.sendMessage(msg);
}
conversationFactory.buildConversation((Conversable) cs).begin();
} else {

View File

@ -92,7 +92,11 @@ public class QuestAcceptPrompt extends StringPrompt implements ColorUtil {
quester.questToTake = q.name;
String s = extracted(quester);
player.sendMessage(s);
for (String msg : s.split("<br>")) {
player.sendMessage(msg);
}
plugin.conversationFactory.buildConversation((Conversable) player).begin();
}else{