コード例 #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();
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: doio/Ultrapowa-SC-Editor
 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();
 }