Improves display of quests an NPC is part of
This commit is contained in:
parent
032327c0f7
commit
2504a64191
@ -22,7 +22,6 @@ import org.dynmap.markers.GenericMarker;
|
||||
import org.dynmap.markers.MarkerIcon;
|
||||
import org.dynmap.markers.MarkerSet;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@ -131,19 +130,20 @@ public class QuestsHandler extends AbstractTraitHandler {
|
||||
}
|
||||
//TODO: Get information about the planner (repeatable and/or limited)
|
||||
|
||||
if (!questKills.isEmpty()) {
|
||||
markerDescription.append("<h3>Kill target for quests:</h3>");
|
||||
markerDescription.append(getQuestListString(questKills));
|
||||
if (!questKills.isEmpty() || !questInteractions.isEmpty() || !questDeliveries.isEmpty()) {
|
||||
markerDescription.append("<h3>Involved in quests:</h3><ul>");
|
||||
|
||||
for (IQuest quest : new HashSet<>(questKills)) {
|
||||
markerDescription.append("<li>Killed in: ").append(quest.getName()).append("</li>");
|
||||
}
|
||||
for (IQuest quest : new HashSet<>(questDeliveries)) {
|
||||
markerDescription.append("<li>Delivery target in: ").append(quest.getName()).append("</li>");
|
||||
}
|
||||
for (IQuest quest : new HashSet<>(questInteractions)) {
|
||||
markerDescription.append("<li>Interacted with in quest: ").append(quest.getName()).append("</li>");
|
||||
}
|
||||
|
||||
if (!questInteractions.isEmpty()) {
|
||||
markerDescription.append("<h3>Interaction target for quests:</h3>");
|
||||
markerDescription.append(getQuestListString(questInteractions));
|
||||
}
|
||||
|
||||
if (!questDeliveries.isEmpty()) {
|
||||
markerDescription.append("<h3>Delivery target for quests:</h3>");
|
||||
markerDescription.append(getQuestListString(questDeliveries));
|
||||
markerDescription.append("</ul>");
|
||||
}
|
||||
|
||||
addNPCMarker(npcId, getMarkerTitle(info.getQuestNPCType()), markerDescription.toString(), icon, questMarkerSet);
|
||||
@ -267,21 +267,6 @@ public class QuestsHandler extends AbstractTraitHandler {
|
||||
return rewardInfo.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a comma-separated list of the given quests' names
|
||||
*
|
||||
* @param quests <p>The quests to get a list string for</p>
|
||||
* @return <p>The names of the given quests</p>
|
||||
*/
|
||||
private String getQuestListString(List<IQuest> quests) {
|
||||
List<String> questNames = new ArrayList<>();
|
||||
//Note: The list is cast to a set to remove duplicates
|
||||
for (IQuest quest : new HashSet<>(quests)) {
|
||||
questNames.add(quest.getName());
|
||||
}
|
||||
return String.join(", ", questNames);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the marker title to use for the given quest NPC type
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user