Example #1
0
 public void UpdateValues()
 {
     this.UpdateValue(_linkedBox.Name);
     foreach (ControlTreeNode node in Nodes)
     {
         if (node.Name == "Faces")
         {
             foreach (TreeNodeFace faceNode in node.Nodes)
             {
                 faceNode.UpdateValues();
             }
         }
         if (node.Name == "Shade")
         {
             TreeNodeBool shadeNode = (TreeNodeBool)node;
             shadeNode.UpdateValue(_linkedBox.Shade);
         }
         if (node.Name == "From")
         {
             TreeNodeVector3 fromNode = (TreeNodeVector3)node;
             fromNode.UpdateValue(_linkedBox.From);
         }
         if (node.Name == "To")
         {
             TreeNodeVector3 toNode = (TreeNodeVector3)node;
             toNode.UpdateValue(_linkedBox.To);
         }
         if (node.Name == "Rotation")
         {
             TreeNodeRotation rotNode = (TreeNodeRotation)node;
             rotNode.UpdateValues();
         }
     }
 }
Example #2
0
 public void UpdateValues()
 {
     foreach (ControlTreeNode node in Nodes)
     {
         if (node.Name == "Axis")
         {
             TreeNodeArray axNode = (TreeNodeArray)node;
             axNode.UpdateValue(_linkedRotation.Axis);
         }
         if (node.Name == "Angle")
         {
             TreeNodeFloat angNode = (TreeNodeFloat)node;
             angNode.UpdateValue(_linkedRotation.Angle);
         }
         if (node.Name == "Origin")
         {
             TreeNodeVector3 orNode = (TreeNodeVector3)node;
             orNode.UpdateValue(_linkedRotation.Origin);
         }
         if (node.Name == "Rescale")
         {
             TreeNodeBool rescaleNode = (TreeNodeBool)node;
             rescaleNode.UpdateValue(_linkedRotation.Rescale);
         }
     }
 }
Example #3
0
        private void Configurate()
        {
            TreeNodeBool visableNode = new TreeNodeBool("Visable", _linkedFace.Visible);

            visableNode.ValueChanged += new TreeNodeValueChangedHandler(On_Vis_Changed);

            TreeNodeArray texNode = new TreeNodeArray("Texture", _linkedFace.TextureName.Substring(1), _linkedFace.ParentBox.ParentModel.GetTextureNames());

            texNode.ValueChanged += new TreeNodeValueChangedHandler(On_Tex_Changed);

            TreeNodeVector4 uVNode = new TreeNodeVector4("UV", _linkedFace.UV);

            uVNode.ValueChanged += new TreeNodeValueChangedHandler(On_Uv_Changed);

            TreeNodeInt rotationNode = new TreeNodeInt("Rotation", _linkedFace.Rotation, 0, 270, 90, true);

            rotationNode.ValueChanged += new TreeNodeValueChangedHandler(On_Rot_Changed);

            TreeNodeArray cullNode = new TreeNodeArray("CullFace", _linkedFace.CullFace, Enum.GetValues(typeof(CullFace)));

            cullNode.ValueChanged += new TreeNodeValueChangedHandler(On_Cull_Changed);

            TreeNodeInt tintIndexNode = new TreeNodeInt("TintIndex", _linkedFace.TintIndex, -1, 10, 1, true);

            tintIndexNode.ValueChanged += new TreeNodeValueChangedHandler(On_Tint_Changed);

            Nodes.Add(visableNode);
            Nodes.Add(texNode);
            Nodes.Add(uVNode);
            Nodes.Add(rotationNode);
            Nodes.Add(cullNode);
            Nodes.Add(tintIndexNode);
        }
Example #4
0
        private void Configurate()
        {
            this.ImageIndex       = 2;
            base.ValueChanged    += new TreeNodeValueChangedHandler(On_Name_Changed);
            base.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);

            ContextMenuStrip  menuStripBox = new ContextMenuStrip();
            ToolStripMenuItem removeBox    = new ToolStripMenuItem("Remove Element");

            removeBox.Click += new EventHandler(On_Remove_Box_Click);
            menuStripBox.Items.Add(removeBox);
            ContextMenuStrip = menuStripBox;

            ControlTreeNode facesNode = new ControlTreeNode("Faces");

            facesNode.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);
            for (int i = 0; i < _linkedBox.Faces.Count; i++)
            {
                TreeNodeFace faceNode = _linkedBox.Faces[i].TreeNode;
                facesNode.Nodes.Add(faceNode);
            }

            TreeNodeBool shadeNode = new TreeNodeBool("Shade", _linkedBox.Shade);

            shadeNode.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);
            shadeNode.ValueChanged    += new TreeNodeValueChangedHandler(On_Shade_Changed);

            TreeNodeVector3 fromNode = new TreeNodeVector3("From", _linkedBox.From, -16, 32, 2);

            fromNode.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);
            fromNode.ValueChanged    += new TreeNodeValueChangedHandler(On_From_Changed);

            TreeNodeVector3 toNode = new TreeNodeVector3("To", _linkedBox.To, -16, 32, 2);

            toNode.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);
            toNode.ValueChanged    += new TreeNodeValueChangedHandler(On_To_Changed);

            TreeNodeRotation rotNode = _linkedBox.Rotation.TreeNode;

            rotNode.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);

            Nodes.Add(facesNode);
            Nodes.Add(fromNode);
            Nodes.Add(toNode);
            Nodes.Add(shadeNode);
            Nodes.Add(rotNode);
        }
Example #5
0
        private void Configurate()
        {
            ControlTreeNode   elementsNode = new ControlTreeNode("Elements");
            ContextMenuStrip  menuStripBox = new ContextMenuStrip();
            ToolStripMenuItem addBox       = new ToolStripMenuItem("Add Element");

            addBox.Click += new EventHandler(On_Add_Box_Click);
            menuStripBox.Items.Add(addBox);
            elementsNode.ContextMenuStrip = menuStripBox;
            for (int i = 0; i < _linkedModel.Boxes.Count; i++)
            {
                TreeNodeElement boxNode = _linkedModel.Boxes[i].TreeNode;
                elementsNode.Nodes.Add(boxNode);
            }

            ControlTreeNode   texturesNode = new ControlTreeNode("Textures");
            ContextMenuStrip  menuStripTex = new ContextMenuStrip();
            ToolStripMenuItem addTex       = new ToolStripMenuItem("Add Texture");

            addTex.Click += new EventHandler(On_Add_Tex_Click);
            menuStripTex.Items.Add(addTex);
            texturesNode.ContextMenuStrip = menuStripTex;
            for (int i = 0; i < _linkedModel.Textures.Count; i++)
            {
                if (_linkedModel.Textures[i].Name != "MissingT")
                {
                    texturesNode.Nodes.Add(_linkedModel.Textures[i].TreeNode);
                }
            }

            TreeNodeBool ambientNode = new TreeNodeBool("AmbientOcclusion", _linkedModel.AmbientOcclusion);

            ambientNode.ValueChanged += new TreeNodeValueChangedHandler(On_Ambient_Changed);

            elementsNode.Expand();
            texturesNode.Expand();
            Nodes.Add(elementsNode);
            Nodes.Add(texturesNode);
            Nodes.Add(ambientNode);
            Expand();
        }
Example #6
0
        private void Configurate()
        {
            TreeNodeArray axisNode = new TreeNodeArray("Axis", _linkedRotation.Axis, Enum.GetValues(typeof(Axis)));

            axisNode.ValueChanged += new TreeNodeValueChangedHandler(On_Axis_Changed);

            TreeNodeFloat angleNode = new TreeNodeFloat("Angle", _linkedRotation.Angle, -45, 45, 22.5f);

            angleNode.ValueChanged += new TreeNodeValueChangedHandler(On_Angle_Changed);

            TreeNodeVector3 originNode = new TreeNodeVector3("Origin", _linkedRotation.Origin);

            originNode.ValueChanged += new TreeNodeValueChangedHandler(On_Origin_Changed);

            TreeNodeBool rescaleNode = new TreeNodeBool("Rescale", _linkedRotation.Rescale);

            rescaleNode.ValueChanged += new TreeNodeValueChangedHandler(On_Rescale_Changed);

            Nodes.Add(axisNode);
            Nodes.Add(angleNode);
            Nodes.Add(originNode);
            Nodes.Add(rescaleNode);
        }
Example #7
0
 public void UpdateValues()
 {
     foreach (ControlTreeNode node in Nodes)
     {
         if (node.Name == "Visable")
         {
             TreeNodeBool visableNode = (TreeNodeBool)node;
             visableNode.UpdateValue(_linkedFace.Visible);
         }
         if (node.Name == "Texture")
         {
             TreeNodeArray texNode = (TreeNodeArray)node;
             texNode.UpdateValue(_linkedFace.TextureName.Substring(1));
         }
         if (node.Name == "UV")
         {
             TreeNodeVector4 uvNode = (TreeNodeVector4)node;
             uvNode.UpdateValue(_linkedFace.UV);
         }
         if (node.Name == "Rotation")
         {
             TreeNodeInt rotNode = (TreeNodeInt)node;
             rotNode.UpdateValue(_linkedFace.Rotation);
         }
         if (node.Name == "CullFace")
         {
             TreeNodeArray cullNode = (TreeNodeArray)node;
             cullNode.UpdateValue(_linkedFace.CullFace);
         }
         if (node.Name == "TintIndex")
         {
             TreeNodeInt tintNode = (TreeNodeInt)node;
             tintNode.UpdateValue(_linkedFace.TintIndex);
         }
     }
 }