Esempio n. 1
0
        private void UpdateDetail(int id)
        {
            Ultima.ItemData item = Ultima.TileData.ItemTable[id];
            Bitmap          bit  = Ultima.Art.GetStatic(id);

            DetailPictureBox.Tag = id;
            if (bit == null)
            {
                splitContainer2.SplitterDistance = 10;
            }
            else
            {
                splitContainer2.SplitterDistance = bit.Size.Height + 10;
            }
            DetailPictureBox.Invalidate();
            DetailTextBox.Clear();
            DetailTextBox.AppendText(String.Format("Name: {0}\n", item.Name));
            DetailTextBox.AppendText(String.Format("Graphic: 0x{0:X4}\n", id));
            DetailTextBox.AppendText(String.Format("Height/Capacity: {0}\n", item.Height));
            DetailTextBox.AppendText(String.Format("Weight: {0}\n", item.Weight));
            DetailTextBox.AppendText(String.Format("Animation: {0}\n", item.Animation));
            DetailTextBox.AppendText(String.Format("Quality/Layer/Light: {0}\n", item.Quality));
            DetailTextBox.AppendText(String.Format("Quantity: {0}\n", item.Quantity));
            DetailTextBox.AppendText(String.Format("Hue: {0}\n", item.Hue));
            DetailTextBox.AppendText(String.Format("StackingOffset/Unk4: {0}\n", item.StackingOffset));
            DetailTextBox.AppendText(String.Format("Flags: {0}\n", item.Flags));
            if ((item.Flags & TileFlag.Animation) != 0)
            {
                Animdata.Data info = Animdata.GetAnimData(id);
                if (info != null)
                {
                    DetailTextBox.AppendText(String.Format("Animation FrameCount: {0} Interval: {1}\n", info.FrameCount, info.FrameInterval));
                }
            }
        }
Esempio n. 2
0
        private void DetailSplitContainer_SizeChange(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count > 0)
            {
                int id = (int)DetailPictureBox.Tag;
                if (id >= 0)
                {
                    Bitmap bit = Art.GetStatic(id);
                    splitContainer2.SplitterDistance = bit == null ? 10 : bit.Size.Height + 10;

                    DetailPictureBox.Invalidate();
                }
            }
        }
Esempio n. 3
0
        private void UpdateDetail(int id)
        {
            ItemData item = TileData.ItemTable[id];
            Bitmap   bit  = Art.GetStatic(id);

            splitContainer2.SplitterDistance = bit?.Size.Height + 10 ?? 10;

            int xMin = 0;
            int xMax = 0;
            int yMin = 0;
            int yMax = 0;

            if (bit != null)
            {
                Art.Measure(bit, out xMin, out yMin, out xMax, out yMax);
            }

            DetailPictureBox.Tag = id;
            DetailPictureBox.Invalidate();

            DetailTextBox.Clear();
            DetailTextBox.AppendText($"Name: {item.Name}\n");
            DetailTextBox.AppendText($"Graphic: 0x{id:X4}\n");
            DetailTextBox.AppendText($"Height/Capacity: {item.Height}\n");
            DetailTextBox.AppendText($"Weight: {item.Weight}\n");
            DetailTextBox.AppendText($"Animation: {item.Animation}\n");
            DetailTextBox.AppendText($"Quality/Layer/Light: {item.Quality}\n");
            DetailTextBox.AppendText($"Quantity: {item.Quantity}\n");
            DetailTextBox.AppendText($"Hue: {item.Hue}\n");
            DetailTextBox.AppendText($"StackingOffset/Unk4: {item.StackingOffset}\n");
            DetailTextBox.AppendText($"Flags: {item.Flags}\n");
            DetailTextBox.AppendText($"Graphic pixel size width, height: {bit?.Width ?? 0} {bit?.Height ?? 0} \n");
            DetailTextBox.AppendText($"Graphic pixel offset xMin, yMin, xMax, yMax: {xMin} {yMin} {xMax} {yMax}\n");

            if ((item.Flags & TileFlag.Animation) == 0)
            {
                return;
            }

            Animdata.AnimdataEntry info = Animdata.GetAnimData(id);
            if (info != null)
            {
                DetailTextBox.AppendText(
                    $"Animation FrameCount: {info.FrameCount} Interval: {info.FrameInterval}\n");
            }
        }