feat: add option to remove redundant arrows
This commit is contained in:
parent
52d70583a9
commit
cd4c2215dc
@ -10,6 +10,7 @@ namespace QuestMap {
|
||||
public bool ShowSeasonal;
|
||||
public bool ShowArrowheads;
|
||||
public bool CondenseMsq;
|
||||
public bool ShowRedundantArrows;
|
||||
|
||||
public Visibility EmoteVis;
|
||||
public Visibility ItemVis;
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user