mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-27 21:26:29 +01:00
Potentially fix custom objective displays, see #625
This commit is contained in:
parent
4f8cc34c0a
commit
a92ff51231
@ -783,9 +783,11 @@ public class Quester {
|
|||||||
}
|
}
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (CustomObjective co : getCurrentStage(quest).customObjectives) {
|
for (CustomObjective co : getCurrentStage(quest).customObjectives) {
|
||||||
|
String display = co.getDisplay();
|
||||||
|
boolean addUnfinished = false;
|
||||||
|
boolean addFinished = false;
|
||||||
for (Entry<String, Integer> entry : getQuestData(quest).customObjectiveCounts.entrySet()) {
|
for (Entry<String, Integer> entry : getQuestData(quest).customObjectiveCounts.entrySet()) {
|
||||||
if (co.getName().equals(entry.getKey())) {
|
if (co.getName().equals(entry.getKey())) {
|
||||||
String display = co.getDisplay();
|
|
||||||
Entry<String, Object> datamap = getCurrentStage(quest).customObjectiveData.get(index);
|
Entry<String, Object> datamap = getCurrentStage(quest).customObjectiveData.get(index);
|
||||||
for (Entry<String,Object> prompt : co.getData()) {
|
for (Entry<String,Object> prompt : co.getData()) {
|
||||||
try {
|
try {
|
||||||
@ -799,15 +801,21 @@ public class Quester {
|
|||||||
if (co.canShowCount()) {
|
if (co.canShowCount()) {
|
||||||
display = display.replace("%count%", entry.getValue() + "/" + getCurrentStage(quest).customObjectiveCounts.get(index));
|
display = display.replace("%count%", entry.getValue() + "/" + getCurrentStage(quest).customObjectiveCounts.get(index));
|
||||||
}
|
}
|
||||||
unfinishedObjectives.add(ChatColor.GREEN + display);
|
addUnfinished = true;
|
||||||
} else {
|
} else {
|
||||||
if (co.canShowCount()) {
|
if (co.canShowCount()) {
|
||||||
display = display.replace("%count%", getCurrentStage(quest).customObjectiveCounts.get(index) + "/" + getCurrentStage(quest).customObjectiveCounts.get(index));
|
display = display.replace("%count%", getCurrentStage(quest).customObjectiveCounts.get(index) + "/" + getCurrentStage(quest).customObjectiveCounts.get(index));
|
||||||
}
|
}
|
||||||
|
addFinished = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (addUnfinished) {
|
||||||
|
unfinishedObjectives.add(ChatColor.GREEN + display);
|
||||||
|
}
|
||||||
|
if (addFinished) {
|
||||||
finishedObjectives.add(ChatColor.GRAY + display);
|
finishedObjectives.add(ChatColor.GRAY + display);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
objectives.addAll(unfinishedObjectives);
|
objectives.addAll(unfinishedObjectives);
|
||||||
|
Loading…
Reference in New Issue
Block a user