Improve color support within custom data list prompts

This commit is contained in:
PikaMug 2021-01-31 21:37:42 -05:00
parent 7c2b951339
commit 1f6394a5ed
5 changed files with 14 additions and 12 deletions

View File

@ -1405,13 +1405,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
display = display.replace("%count%", entry.getValue() + "/" display = display.replace("%count%", entry.getValue() + "/"
+ stage.customObjectiveCounts.get(countsIndex)); + stage.customObjectiveCounts.get(countsIndex));
} }
unfinished.add(display); unfinished.add(ChatColor.translateAlternateColorCodes('&', display));
} else { } else {
if (co.canShowCount()) { if (co.canShowCount()) {
display = display.replace("%count%", stage.customObjectiveCounts.get(countsIndex) display = display.replace("%count%", stage.customObjectiveCounts.get(countsIndex)
+ "/" + stage.customObjectiveCounts.get(countsIndex)); + "/" + stage.customObjectiveCounts.get(countsIndex));
} }
finished.add(display); finished.add(ChatColor.translateAlternateColorCodes('&', display));
} }
} }
countsIndex++; countsIndex++;

View File

@ -951,7 +951,7 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public String getPromptText(final ConversationContext context) { public String getPromptText(final ConversationContext context) {
String text = ChatColor.AQUA + "- "; String text = ChatColor.GOLD + "- ";
final LinkedList<String> list = (LinkedList<String>) context.getSessionData(CK.REQ_CUSTOM); final LinkedList<String> list = (LinkedList<String>) context.getSessionData(CK.REQ_CUSTOM);
final LinkedList<Map<String, Object>> datamapList final LinkedList<Map<String, Object>> datamapList
= (LinkedList<Map<String, Object>>) context.getSessionData(CK.REQ_CUSTOM_DATA); = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REQ_CUSTOM_DATA);
@ -968,9 +968,10 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
text += ChatColor.BLUE + "" + ChatColor.BOLD + index + ChatColor.RESET + ChatColor.YELLOW + " - " text += ChatColor.BLUE + "" + ChatColor.BOLD + index + ChatColor.RESET + ChatColor.YELLOW + " - "
+ dataKey; + dataKey;
if (datamap.get(dataKey) != null) { if (datamap.get(dataKey) != null) {
text += ChatColor.GREEN + " (" + datamap.get(dataKey).toString() + ")\n"; text += ChatColor.GRAY + " (" + ChatColor.AQUA + ChatColor.translateAlternateColorCodes('&',
datamap.get(dataKey).toString()) + ChatColor.GRAY + ")\n";
} else { } else {
text += ChatColor.RED + " (" + Lang.get("valRequired") + ")\n"; text += ChatColor.GRAY + " (" + Lang.get("noneSet") + ChatColor.GRAY + ")\n";
} }
index++; index++;
} }

View File

@ -1750,7 +1750,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public String getPromptText(final ConversationContext context) { public String getPromptText(final ConversationContext context) {
String text = ChatColor.AQUA + "- "; String text = ChatColor.GOLD + "- ";
final LinkedList<String> list = (LinkedList<String>) context.getSessionData(CK.REW_CUSTOM); final LinkedList<String> list = (LinkedList<String>) context.getSessionData(CK.REW_CUSTOM);
final LinkedList<Map<String, Object>> datamapList final LinkedList<Map<String, Object>> datamapList
= (LinkedList<Map<String, Object>>) context.getSessionData(CK.REW_CUSTOM_DATA); = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REW_CUSTOM_DATA);
@ -1767,9 +1767,10 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
text += ChatColor.BLUE + "" + ChatColor.BOLD + index + ChatColor.RESET + ChatColor.YELLOW + " - " text += ChatColor.BLUE + "" + ChatColor.BOLD + index + ChatColor.RESET + ChatColor.YELLOW + " - "
+ dataKey; + dataKey;
if (datamap.get(dataKey) != null) { if (datamap.get(dataKey) != null) {
text += ChatColor.GREEN + " (" + datamap.get(dataKey).toString() + ")\n"; text += ChatColor.GRAY + " (" + ChatColor.AQUA + ChatColor.translateAlternateColorCodes('&',
datamap.get(dataKey).toString()) + ChatColor.GRAY + ")\n";
} else { } else {
text += ChatColor.RED + " (" + Lang.get("valRequired") + ")\n"; text += ChatColor.GRAY + " (" + Lang.get("noneSet") + ChatColor.GRAY + ")\n";
} }
index++; index++;
} }

View File

@ -2427,7 +2427,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public String getPromptText(final ConversationContext context) { public String getPromptText(final ConversationContext context) {
String text = ChatColor.AQUA + "- "; String text = ChatColor.GOLD + "- ";
final LinkedList<String> list = (LinkedList<String>) context.getSessionData(stagePrefix final LinkedList<String> list = (LinkedList<String>) context.getSessionData(stagePrefix
+ CK.S_CUSTOM_OBJECTIVES); + CK.S_CUSTOM_OBJECTIVES);
final LinkedList<Entry<String, Object>> datamapList final LinkedList<Entry<String, Object>> datamapList
@ -2452,9 +2452,10 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
text += ChatColor.BLUE + "" + ChatColor.BOLD + index + ChatColor.RESET + ChatColor.YELLOW text += ChatColor.BLUE + "" + ChatColor.BOLD + index + ChatColor.RESET + ChatColor.YELLOW
+ " - " + datamap.getKey(); + " - " + datamap.getKey();
if (currentData.getValue() != null) { if (currentData.getValue() != null) {
text += ChatColor.GREEN + " (" + currentData.getValue().toString() + ")\n"; text += ChatColor.GRAY + " (" + ChatColor.AQUA + ChatColor.translateAlternateColorCodes('&',
currentData.getValue().toString()) + ChatColor.GRAY + ")\n";
} else { } else {
text += ChatColor.RED + " (" + Lang.get("valRequired") + ")\n"; text += ChatColor.GRAY + " (" + Lang.get("noneSet") + ChatColor.GRAY + ")\n";
} }
index++; index++;
} }

View File

@ -802,7 +802,6 @@ money: "Money"
with: "with" with: "with"
to: "to" to: "to"
blocksWithin: "within <amount> blocks of" blocksWithin: "within <amount> blocks of"
valRequired: "Value required"
experience: "Experience" experience: "Experience"
partiesExperience: "Parties experience" partiesExperience: "Parties experience"
timePrompt: "Enter amount of time (in seconds), <clear>, <cancel>" timePrompt: "Enter amount of time (in seconds), <clear>, <cancel>"