Beispiel #1
0
        private void RefreshTexture()
        {
            int n = listBox3.SelectedIndex;

            if (n == -1)
            {
                return;
            }
            foreach (WADFile.WADSection sec in wad.sections)
            {
                if (sec.type == "TEXT")
                {
                    WADFile.WADTexture tex = sec.textures[n];
                    if (tex.flags == 0)
                    {
                        comboBox1.Visible = true;
                        pb1.Image         = tex.GetBitmap(sec.palettes[comboBox1.SelectedIndex]);
                    }
                    else
                    {
                        comboBox1.Visible = false;
                        pb1.Image         = tex.GetBitmap(null);
                    }
                }
            }
        }
Beispiel #2
0
        private void importToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int n = listBox3.SelectedIndex;

            if (n == -1)
            {
                return;
            }
            OpenFileDialog d = new OpenFileDialog();

            d.Filter = "*.png|*.png";
            if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                foreach (WADFile.WADSection sec in wad.sections)
                {
                    if (sec.type == "TEXT")
                    {
                        WADFile.WADTexture tex = sec.textures[n];
                        tex.ImportData(new Bitmap(d.FileName));
                    }
                }
                rtb1.Clear();
                wad.Resave();
                LoadWAD();
                listBox3.SelectedIndex = n;
            }
        }