1
0
mirror of synced 2024-11-12 02:00:50 +01:00

Update course muunt viewport better to reflect hding and selection

This commit is contained in:
KillzXGaming 2019-04-07 18:28:29 -04:00
parent 9f1a4d4d12
commit ef1cfadb98
12 changed files with 40 additions and 6 deletions

Binary file not shown.

View File

@ -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;
}
}

View File

@ -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++)

View File

@ -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);
}
}
}

View File

@ -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;