Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
         }
     }
 }