feat: add option to remove redundant arrows

This commit is contained in:
Anna 2021-09-14 12:55:14 -04:00
parent 52d70583a9
commit cd4c2215dc
3 changed files with 20 additions and 1 deletions

View File

@ -10,6 +10,7 @@ namespace QuestMap {
public bool ShowSeasonal;
public bool ShowArrowheads;
public bool CondenseMsq;
public bool ShowRedundantArrows;
public Visibility EmoteVis;
public Visibility ItemVis;

View File

@ -225,6 +225,11 @@ namespace QuestMap {
anyChanged = true;
}
if (ImGui.MenuItem("Show redundant arrows", null, ref this.Plugin.Config.ShowRedundantArrows)) {
this._relayout = true;
anyChanged = true;
}
ImGui.EndMenu();
}

View File

@ -149,7 +149,20 @@ namespace QuestMap {
g.Nodes.Add(graphNode);
msaglNodes[node.Id] = graphNode;
foreach (var parent in node.Parents) {
IEnumerable<Node<Quest>> parents;
if (this.Plugin.Config.ShowRedundantArrows) {
parents = node.Parents;
} else {
// only add if no *other* parent also shares
parents = node.Parents
.Where(q => {
return !node.Parents
.Where(other => other != q)
.Any(other => other.Parents.Contains(q));
});
}
foreach (var parent in parents) {
links.Add((parent.Id, node.Id));
}
}