From 1f6394a5eda6984019e1742aba81c9364263dbf5 Mon Sep 17 00:00:00 2001 From: PikaMug <2267126+PikaMug@users.noreply.github.com> Date: Sun, 31 Jan 2021 21:37:42 -0500 Subject: [PATCH] Improve color support within custom data list prompts --- main/src/main/java/me/blackvein/quests/Quests.java | 4 ++-- .../convo/quests/requirements/RequirementsPrompt.java | 7 ++++--- .../quests/convo/quests/rewards/RewardsPrompt.java | 7 ++++--- .../quests/convo/quests/stages/StageMainPrompt.java | 7 ++++--- main/src/main/resources/strings.yml | 1 - 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/main/src/main/java/me/blackvein/quests/Quests.java b/main/src/main/java/me/blackvein/quests/Quests.java index f69a20cdc..762297ccc 100644 --- a/main/src/main/java/me/blackvein/quests/Quests.java +++ b/main/src/main/java/me/blackvein/quests/Quests.java @@ -1405,13 +1405,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener display = display.replace("%count%", entry.getValue() + "/" + stage.customObjectiveCounts.get(countsIndex)); } - unfinished.add(display); + unfinished.add(ChatColor.translateAlternateColorCodes('&', display)); } else { if (co.canShowCount()) { display = display.replace("%count%", stage.customObjectiveCounts.get(countsIndex) + "/" + stage.customObjectiveCounts.get(countsIndex)); } - finished.add(display); + finished.add(ChatColor.translateAlternateColorCodes('&', display)); } } countsIndex++; diff --git a/main/src/main/java/me/blackvein/quests/convo/quests/requirements/RequirementsPrompt.java b/main/src/main/java/me/blackvein/quests/convo/quests/requirements/RequirementsPrompt.java index 100ec033c..5e3da35c3 100644 --- a/main/src/main/java/me/blackvein/quests/convo/quests/requirements/RequirementsPrompt.java +++ b/main/src/main/java/me/blackvein/quests/convo/quests/requirements/RequirementsPrompt.java @@ -951,7 +951,7 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt { @SuppressWarnings("unchecked") @Override public String getPromptText(final ConversationContext context) { - String text = ChatColor.AQUA + "- "; + String text = ChatColor.GOLD + "- "; final LinkedList list = (LinkedList) context.getSessionData(CK.REQ_CUSTOM); final LinkedList> datamapList = (LinkedList>) 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 + " - " + dataKey; 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 { - text += ChatColor.RED + " (" + Lang.get("valRequired") + ")\n"; + text += ChatColor.GRAY + " (" + Lang.get("noneSet") + ChatColor.GRAY + ")\n"; } index++; } diff --git a/main/src/main/java/me/blackvein/quests/convo/quests/rewards/RewardsPrompt.java b/main/src/main/java/me/blackvein/quests/convo/quests/rewards/RewardsPrompt.java index 95781c256..f3ae1078d 100644 --- a/main/src/main/java/me/blackvein/quests/convo/quests/rewards/RewardsPrompt.java +++ b/main/src/main/java/me/blackvein/quests/convo/quests/rewards/RewardsPrompt.java @@ -1750,7 +1750,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt { @SuppressWarnings("unchecked") @Override public String getPromptText(final ConversationContext context) { - String text = ChatColor.AQUA + "- "; + String text = ChatColor.GOLD + "- "; final LinkedList list = (LinkedList) context.getSessionData(CK.REW_CUSTOM); final LinkedList> datamapList = (LinkedList>) 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 + " - " + dataKey; 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 { - text += ChatColor.RED + " (" + Lang.get("valRequired") + ")\n"; + text += ChatColor.GRAY + " (" + Lang.get("noneSet") + ChatColor.GRAY + ")\n"; } index++; } diff --git a/main/src/main/java/me/blackvein/quests/convo/quests/stages/StageMainPrompt.java b/main/src/main/java/me/blackvein/quests/convo/quests/stages/StageMainPrompt.java index 24a04c203..3b2372c3c 100644 --- a/main/src/main/java/me/blackvein/quests/convo/quests/stages/StageMainPrompt.java +++ b/main/src/main/java/me/blackvein/quests/convo/quests/stages/StageMainPrompt.java @@ -2427,7 +2427,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt { @SuppressWarnings("unchecked") @Override public String getPromptText(final ConversationContext context) { - String text = ChatColor.AQUA + "- "; + String text = ChatColor.GOLD + "- "; final LinkedList list = (LinkedList) context.getSessionData(stagePrefix + CK.S_CUSTOM_OBJECTIVES); final LinkedList> datamapList @@ -2452,9 +2452,10 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt { text += ChatColor.BLUE + "" + ChatColor.BOLD + index + ChatColor.RESET + ChatColor.YELLOW + " - " + datamap.getKey(); 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 { - text += ChatColor.RED + " (" + Lang.get("valRequired") + ")\n"; + text += ChatColor.GRAY + " (" + Lang.get("noneSet") + ChatColor.GRAY + ")\n"; } index++; } diff --git a/main/src/main/resources/strings.yml b/main/src/main/resources/strings.yml index 5c08ac38c..ac9c5593b 100644 --- a/main/src/main/resources/strings.yml +++ b/main/src/main/resources/strings.yml @@ -802,7 +802,6 @@ money: "Money" with: "with" to: "to" blocksWithin: "within blocks of" -valRequired: "Value required" experience: "Experience" partiesExperience: "Parties experience" timePrompt: "Enter amount of time (in seconds), , "