Beispiel #1
0
        private void changeTextureToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ReplaceTexture form       = new ReplaceTexture();
            List <short>   textureIds = new List <short>();

            foreach (Texture texture in m_vStorageObject.GetTextures())
            {
                textureIds.Add(texture.GetTextureId());
            }
            ((ComboBox)form.Controls["comboBox1"]).DataSource = textureIds;
            if (form.ShowDialog() == DialogResult.OK)
            {
                if (treeView1.SelectedNode != null)
                {
                    if (treeView1.SelectedNode.Tag != null)
                    {
                        ShapeChunk data = (ShapeChunk)treeView1.SelectedNode.Tag;
                        data.SetTextureId(Convert.ToByte(((ComboBox)form.Controls["comboBox1"]).SelectedItem));
                        m_vStorageObject.AddChange(data);
                        Render();
                    }
                }
            }
            form.Dispose();
        }
Beispiel #2
0
 private void changeTextureToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ReplaceTexture form = new ReplaceTexture();
     List<short> textureIds = new List<short>();
     foreach (Texture texture in m_vStorageObject.GetTextures())
         textureIds.Add(texture.GetTextureId());
     ((ComboBox)form.Controls["comboBox1"]).DataSource = textureIds;
     if(form.ShowDialog() == DialogResult.OK)
     {
         if (treeView1.SelectedNode != null)
         {
             if (treeView1.SelectedNode.Tag != null)
             {
                 ShapeChunk data = (ShapeChunk)treeView1.SelectedNode.Tag;
                 data.SetTextureId(Convert.ToByte(((ComboBox)form.Controls["comboBox1"]).SelectedItem));
                 m_vStorageObject.AddChange(data);
                 Render();
             }
         }
     }
     form.Dispose();
 }