Update course muunt viewport better to reflect hding and selection
This commit is contained in:
parent
9f1a4d4d12
commit
ef1cfadb98
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -67,7 +67,7 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
|
||||
get
|
||||
{
|
||||
if (renderablePoint == null)
|
||||
renderablePoint = new RenderablePathPoint(new Vector4(0f, 0.7f, 1f, 1f), Translate, Rotate, new OpenTK.Vector3(30), this);
|
||||
renderablePoint = new RenderablePathPoint(new Vector4(0.1f, 0.3f, 0.3f, 1f), Translate, Rotate, new OpenTK.Vector3(30), this);
|
||||
return renderablePoint;
|
||||
}
|
||||
}
|
||||
|
@ -101,6 +101,9 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
|
||||
{
|
||||
foreach (var path in group.PathPoints)
|
||||
{
|
||||
if (!path.RenderablePoint.IsVisable)
|
||||
continue;
|
||||
|
||||
if (Use4PointConnection)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
|
@ -201,25 +201,42 @@ namespace FirstPlugin.Forms
|
||||
}
|
||||
|
||||
if (newSelection.Count > 0)
|
||||
{
|
||||
viewport.scene.SelectedObjects = newSelection;
|
||||
viewport.UpdateViewport();
|
||||
}
|
||||
}
|
||||
|
||||
bool IsParentChecked = false;
|
||||
private void treeView1_AfterCheck(object sender, TreeViewEventArgs e) {
|
||||
if (!IsLoaded)
|
||||
if (!IsLoaded || IsParentChecked)
|
||||
return;
|
||||
|
||||
if (e.Node is PathPointNode)
|
||||
((PathPointNode)e.Node).OnChecked(e.Node.Checked);
|
||||
|
||||
IsParentChecked = true;
|
||||
CheckChildNodes(e.Node, e.Node.Checked);
|
||||
IsParentChecked = false; //Update viewport on the last node checked
|
||||
|
||||
viewport.UpdateViewport();
|
||||
}
|
||||
|
||||
private void CheckChildNodes(TreeNode node, bool IsChecked)
|
||||
{
|
||||
OnNodeChecked(node, IsChecked);
|
||||
foreach (TreeNode n in node.Nodes)
|
||||
{
|
||||
n.Checked = IsChecked;
|
||||
OnNodeChecked(n, IsChecked);
|
||||
if (n.Nodes.Count > 0)
|
||||
{
|
||||
CheckChildNodes(n, IsChecked);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnNodeChecked(TreeNode node, bool IsChecked)
|
||||
{
|
||||
if (node is PathPointNode)
|
||||
((PathPointNode)node).OnChecked(IsChecked);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -130,10 +130,24 @@ namespace Switch_Toolbox.Library
|
||||
{
|
||||
return (UserControl)ctrl;
|
||||
}
|
||||
if (ctrl.GetType() == type)
|
||||
else if (ctrl.GetType() == type)
|
||||
{
|
||||
return (UserControl)ctrl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine(ctrl);
|
||||
|
||||
foreach (var inter in ctrl.GetType().GetInterfaces())
|
||||
{
|
||||
Console.WriteLine(inter);
|
||||
|
||||
if (inter.IsGenericType && inter.GetGenericTypeDefinition() == type)
|
||||
{
|
||||
return (UserControl)ctrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user