private void On_Selected_Changed(ControlTreeNode sender)
 {
     if (this.ContainsSelected())
     {
         _linkedBox.ParentModel.SetSelectedBox(_linkedBox);
     }
     else if (_linkedBox.ParentModel.GetSelectedBox() == _linkedBox)
     {
         _linkedBox.ParentModel.SetSelectedBox(-1);
     }
 }
        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);
        }
Beispiel #3
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();
        }
Beispiel #4
0
 private void On_GamePath_Changed(ControlTreeNode node)
 {
     _linkedTexture.GamePath = (string)node.Tag;
 }
Beispiel #5
0
 private void On_Name_Changed(ControlTreeNode node)
 {
     _linkedTexture.Name = (string)node.Tag;
 }
Beispiel #6
0
 private void On_Ref_Changed(ControlTreeNode node)
 {
     _linkedTexture.Reference = (string)node.Tag;
 }
Beispiel #7
0
 private void On_Tex_Changed(ControlTreeNode node)
 {
     _linkedFace.TextureName = "#" + (string)node.Tag;
 }
Beispiel #8
0
 private void On_Axis_Changed(ControlTreeNode node)
 {
     _linkedRotation.Axis = (Axis)node.Tag;
 }
 private void On_Shade_Changed(ControlTreeNode node)
 {
     _linkedBox.Shade = (bool)node.Tag;
 }
Beispiel #10
0
 private void On_Tint_Changed(ControlTreeNode node)
 {
     _linkedFace.TintIndex = (int)node.Tag;
 }
Beispiel #11
0
 private void On_Ambient_Changed(ControlTreeNode node)
 {
     _linkedModel.AmbientOcclusion = (bool)node.Tag;
 }
Beispiel #12
0
 private void On_Cull_Changed(ControlTreeNode node)
 {
     _linkedFace.CullFace = (CullFace)node.Tag;
 }
Beispiel #13
0
 private void On_Rot_Changed(ControlTreeNode node)
 {
     _linkedFace.Rotation = (int)node.Tag;
 }
Beispiel #14
0
 private void On_Uv_Changed(ControlTreeNode node)
 {
     _linkedFace.UV = (Vector4)node.Tag;
 }
Beispiel #15
0
 private void On_Origin_Changed(ControlTreeNode node)
 {
     _linkedRotation.Origin = (Vector3)node.Tag;
 }
 private void On_From_Changed(ControlTreeNode node)
 {
     _linkedBox.From = (Vector3)node.Tag;
 }
Beispiel #17
0
 private void On_Rescale_Changed(ControlTreeNode node)
 {
     _linkedRotation.Rescale = (bool)node.Tag;
 }
 private void On_To_Changed(ControlTreeNode node)
 {
     _linkedBox.To = (Vector3)node.Tag;
 }
Beispiel #19
0
 private void On_Angle_Changed(ControlTreeNode node)
 {
     _linkedRotation.Angle = (float)node.Tag;
 }
Beispiel #20
0
 private void On_Vis_Changed(ControlTreeNode node)
 {
     _linkedFace.Visible = (bool)node.Tag;
 }