mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-14 20:35:34 +08:00
Collisions editing progress
This commit is contained in:
@@ -415,6 +415,10 @@ namespace CodeWalker.Project.Panels
|
||||
n = boundsnode.Nodes.Add("Edit Polygon");
|
||||
n.Name = "EditPoly";
|
||||
n.Tag = b; //this tag should get updated with the selected poly!
|
||||
|
||||
n = boundsnode.Nodes.Add("Edit Vertex");
|
||||
n.Name = "EditVertex";
|
||||
n.Tag = b; //this tag should get updated with the selected vertex!
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1186,6 +1190,15 @@ namespace CodeWalker.Project.Panels
|
||||
polynode.Tag = p;
|
||||
return polynode;
|
||||
}
|
||||
public TreeNode FindCollisionVertexTreeNode(BoundVertex v)
|
||||
{
|
||||
if (v == null) return null;
|
||||
var ybnnode = FindCollisionBoundsTreeNode(v.Owner);
|
||||
var vertnode = GetChildTreeNode(ybnnode, "EditVertex");
|
||||
if (vertnode == null) return null;
|
||||
vertnode.Tag = v;
|
||||
return vertnode;
|
||||
}
|
||||
public TreeNode FindYndTreeNode(YndFile ynd)
|
||||
{
|
||||
if (ProjectTreeView.Nodes.Count <= 0) return null;
|
||||
@@ -1580,6 +1593,29 @@ namespace CodeWalker.Project.Panels
|
||||
}
|
||||
}
|
||||
}
|
||||
public void TrySelectCollisionVertexTreeNode(BoundVertex vert)
|
||||
{
|
||||
TreeNode tnode = FindCollisionVertexTreeNode(vert);
|
||||
if (tnode == null)
|
||||
{
|
||||
tnode = FindCollisionBoundsTreeNode(vert?.Owner);
|
||||
}
|
||||
if (tnode == null)
|
||||
{
|
||||
tnode = FindYbnTreeNode(vert?.Owner?.GetRootYbn());
|
||||
}
|
||||
if (tnode != null)
|
||||
{
|
||||
if (ProjectTreeView.SelectedNode == tnode)
|
||||
{
|
||||
OnItemSelected?.Invoke(vert);
|
||||
}
|
||||
else
|
||||
{
|
||||
ProjectTreeView.SelectedNode = tnode;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void TrySelectPathNodeTreeNode(YndNode node)
|
||||
{
|
||||
TreeNode tnode = FindPathNodeTreeNode(node);
|
||||
|
||||
Reference in New Issue
Block a user