Exemplo n.º 1
0
        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            textBox1.Text = "";
            if (listView1.SelectedItems.Count != 1)
            {
                return;
            }
            uint fnum = uint.Parse(listView1.SelectedItems[0].SubItems[0].Text);

            SkyDisk.FileHeader fh = SkyDisk.get().readHeader(fnum);
            String             s  = String.Format(@"flags=0x{0:X}
x={1:d} (0x{1:X})
y={2:d} (0x{2:X})
width={3:d} (0x{3:X})
height={4:d} (0x{4:X})
sp_size=0x{5:X}
tot_size=0x{6:X}
n_sprites={7:d} (0x{7:X})
offset_x={8:d} (0x{8:X})
offset_y={9:d} (0x{9:X})
compressed_size=0x{10:X}
-------
total_size=0x{11:X}
flags_byte=0x{12:X}
"
                                                  , fh.flags, fh.x, fh.y, fh.width, fh.height, fh.sp_size, fh.tot_size,
                                                  fh.n_sprites, fh.offset_x, fh.offset_y, fh.compressed_size, fh.totalsize, fh.flagbyte
                                                  );

            textBox1.Text = s;
            clearRes();
            Config.FileInfo fi = Config.get().findFile(fnum);
            if (fi.fid != 0)
            {
                BResource res = BResourceHelper.getResource(fi.node);
                if (res.control != null)
                {
                    cntrl = res.control;
                    panel1.Controls.Add(cntrl);
                    res.initControl();
                }
                textBox2.Text = fi.comment;
                label2.Text   = String.Format("{0:d} unused bytes", res.unusedBytes);
            }
        }
Exemplo n.º 2
0
 public void load()
 {
     listView1.ListViewItemSorter = null;
     listView1.Items.Clear();
     srt.clear();
     foreach (SkyDisk.DinnerEntry e in SkyDisk.get().dinners)
     {
         ListViewItem li = listView1.Items.Add(e.id.ToString());
         li.SubItems.Add(String.Format("{0:X}", e.offset));
         li.SubItems.Add(String.Format("{0:X}", e.size));
         //li.SubItems.Add(String.Format("{0:X}", e.flags));
         li.SubItems.Add(String.Format("{0:s}", e.compressed ? "yes" : "no"));
         li.SubItems.Add(String.Format("{0:s}", e.header ? "yes" : "no"));
         Config.FileInfo fi = Config.get().findFile(e.id);
         li.SubItems.Add(fi.type);
         li.SubItems.Add(fi.comment);
     }
     listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
     listView1.ListViewItemSorter = srt;
 }
Exemplo n.º 3
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count != 1)
            {
                return;
            }
            if (cntrl != null)
            {
                cntrl.saveConfig(textBox2.Text);
            }
            uint fid = uint.Parse(listView1.SelectedItems[0].SubItems[0].Text);

            Config.FileInfo fi = Config.get().findFile(fid);
            listView1.SelectedItems[0].SubItems[5].Text = fi.type;
            listView1.SelectedItems[0].SubItems[6].Text = fi.comment;
            ListViewItem li = listView1.SelectedItems[0];

            li.Selected = false;
            li.Selected = true;
        }