private void UpdateListItem(ListViewItem item, CollisionEntry entry)
        {
            item.SubItems.Clear();

            item.Tag  = entry;
            item.Text = entry.Name;
            item.SubItems.Add(entry.TypeID.ToString());
            item.SubItems.Add(entry.Type);
        }
 private void listView1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count > 0)
     {
         ItemLoaded = false;
         CollisionEntry tag = (CollisionEntry)listView1.SelectedItems[0].Tag;
         comboBox1.SelectedItem = tag.Type;
         numericUpDown1.Value   = tag.TypeID;
         ItemLoaded             = true;
     }
 }
        private void UpdateListItem(ListViewItem item, CollisionEntry entry)
        {
            item.SubItems.Clear();

            item.Tag  = entry;
            item.Text = entry.Name;
            item.SubItems.Add(entry.CameraCode);
            item.SubItems.Add(entry.FloorCode);
            item.SubItems.Add(entry.MaterialCode);
            item.SubItems.Add(entry.WallCode);
        }
        private void UpdateListItem(ListViewItem item, CollisionEntry entry)
        {
            item.SubItems.Clear();

            item.Tag  = entry;
            item.Text = entry.Name;
            item.SubItems.Add(entry.UnknownCode.ToString());
            item.SubItems.Add(entry.CameraThrough.ToString());
            item.SubItems.Add(entry.FloorCode);
            item.SubItems.Add(entry.WallCode);
            item.SubItems.Add(entry.SoundCode);
        }
        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count > 0)
            {
                ItemLoaded = false;

                CollisionEntry tag = (CollisionEntry)listView1.SelectedItems[0].Tag;
                cameraCodeCB.SelectedItem   = tag.CameraCode;
                floorCodeCB.SelectedItem    = tag.FloorCode;
                materialCodeCB.SelectedItem = tag.MaterialCode;
                wallCodeCB.SelectedItem     = tag.WallCode;

                ItemLoaded = true;
            }
        }
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count > 0 && ItemLoaded)
            {
                foreach (ListViewItem item in listView1.SelectedItems)
                {
                    CollisionEntry tag  = (CollisionEntry)item.Tag;
                    string         type = comboBox1.SelectedItem.ToString();
                    tag.TypeID           = MaterialSetForm.ActiveGamePreset.GetMaterialID(type);
                    numericUpDown1.Value = tag.TypeID;
                    UpdateListItem(item, tag);
                }

                listView1.Refresh();
            }
        }
        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count > 0)
            {
                ItemLoaded = false;

                CollisionEntry tag = (CollisionEntry)listView1.SelectedItems[0].Tag;
                unknownCodeUD.Value      = tag.UnknownCode;
                chkCameraThrough.Checked = tag.CameraThrough;
                floorCodeCB.SelectedItem = tag.FloorCode;
                soundCodeCB.SelectedItem = tag.SoundCode;
                wallCodeCB.SelectedItem  = tag.WallCode;

                ItemLoaded = true;
            }
        }
        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count > 0 && ItemLoaded)
            {
                foreach (ListViewItem item in listView1.SelectedItems)
                {
                    ItemLoaded = false;
                    CollisionEntry tag = (CollisionEntry)item.Tag;
                    tag.TypeID             = (ushort)numericUpDown1.Value;
                    comboBox1.SelectedItem = tag.Type;

                    UpdateListItem(item, tag);

                    ItemLoaded = true;
                }
            }
        }
Exemplo n.º 9
0
        private void UpdateListItem(ListViewItem item, CollisionEntry entry)
        {
            item.SubItems.Clear();

            item.Tag  = entry;
            item.Text = entry.Name;
            item.SubItems.Add(entry.CameraCode);
            item.SubItems.Add(entry.FloorCode);
            if (entry.MaterialPrefixCode != "NONE")
            {
                item.SubItems.Add($"{entry.MaterialPrefixCode}_{entry.MaterialCode}");
            }
            else
            {
                item.SubItems.Add($"{entry.MaterialCode}");
            }
            item.SubItems.Add(entry.WallCode);
        }
        private void EditItem(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count > 0 && ItemLoaded)
            {
                foreach (ListViewItem item in listView1.SelectedItems)
                {
                    CollisionEntry tag = (CollisionEntry)item.Tag;

                    tag.CameraCode   = cameraCodeCB.SelectedItem.ToString();
                    tag.FloorCode    = floorCodeCB.SelectedItem.ToString();
                    tag.MaterialCode = materialCodeCB.SelectedItem.ToString();
                    tag.WallCode     = wallCodeCB.SelectedItem.ToString();

                    UpdateListItem(item, tag);
                }

                listView1.Refresh();
            }
        }
        private void EditItem(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count > 0 && ItemLoaded)
            {
                foreach (ListViewItem item in listView1.SelectedItems)
                {
                    CollisionEntry tag = (CollisionEntry)item.Tag;

                    tag.CameraThrough = chkCameraThrough.Checked;
                    tag.UnknownCode   = (int)unknownCodeUD.Value;
                    tag.FloorCode     = floorCodeCB.SelectedItem.ToString();
                    tag.SoundCode     = soundCodeCB.SelectedItem.ToString();
                    tag.WallCode      = wallCodeCB.SelectedItem.ToString();

                    UpdateListItem(item, tag);
                }

                listView1.Refresh();
            }
        }