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)); } } }
private void onLoad(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; Options.LoadedUltimaClass["Animdata"] = true; Options.LoadedUltimaClass["TileData"] = true; Options.LoadedUltimaClass["Art"] = true; treeView1.BeginUpdate(); treeView1.Nodes.Clear(); treeView1.TreeViewNodeSorter = new AnimdataSorter(); foreach (int id in Animdata.AnimData.Keys) { Animdata.Data data = (Animdata.Data)Animdata.AnimData[id]; TreeNode node = new TreeNode(); node.Tag = id; node.Text = String.Format("0x{0:X4} {1}", id, TileData.ItemTable[id].Name); if (!Art.IsValidStatic(id)) { node.ForeColor = Color.Red; } else if ((TileData.ItemTable[id].Flags & TileFlag.Animation) == 0) { node.ForeColor = Color.Blue; } treeView1.Nodes.Add(node); for (int i = 0; i < data.FrameCount; ++i) { int frame = id + data.FrameData[i]; if (Art.IsValidStatic(frame)) { TreeNode subnode = new TreeNode(); subnode.Text = String.Format("0x{0:X4} {1}", frame, TileData.ItemTable[frame].Name); node.Nodes.Add(subnode); } else { break; } } } treeView1.EndUpdate(); if (treeView1.Nodes.Count > 0) { treeView1.SelectedNode = treeView1.Nodes[0]; } if (!Loaded) { FiddlerControls.Events.FilePathChangeEvent += new FiddlerControls.Events.FilePathChangeHandler(OnFilePathChangeEvent); } Loaded = true; Cursor.Current = Cursors.Default; }
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.Data info = Animdata.GetAnimData(id); if (info != null) { DetailTextBox.AppendText( $"Animation FrameCount: {info.FrameCount} Interval: {info.FrameInterval}\n"); } }
private void onLoad(object sender, EventArgs e) { this.animateToolStripMenuItem.Visible = false; Ultima.ItemData item = Ultima.TileData.ItemTable[index]; Bitmap bit = Ultima.Art.GetStatic(index); this.Text = String.Format("Item Detail 0x{0:X} '{1}'", index, item.Name); if (bit == null) { this.splitContainer1.SplitterDistance = 10; } else { this.Size = new System.Drawing.Size(300, bit.Size.Height + this.Data.Size.Height + 10); this.splitContainer1.SplitterDistance = bit.Size.Height + 10; this.Graphic.Size = new System.Drawing.Size(300, bit.Size.Height + 10); Graphic.Tag = bit; Graphic.Invalidate(); } this.Data.AppendText(String.Format("Name: {0}\n", item.Name)); this.Data.AppendText(String.Format("Graphic: 0x{0:X4} ({0})\n", index)); this.Data.AppendText(String.Format("Height/Capacity: {0}\n", item.Height)); this.Data.AppendText(String.Format("Weight: {0}\n", item.Weight)); this.Data.AppendText(String.Format("Animation: {0}\n", item.Animation)); this.Data.AppendText(String.Format("Quality/Layer/Light: {0}\n", item.Quality)); this.Data.AppendText(String.Format("Quantity: {0}\n", item.Quantity)); this.Data.AppendText(String.Format("Hue: {0}\n", item.Hue)); this.Data.AppendText(String.Format("StackingOffset/Unk4: {0}\n", item.StackingOffset)); this.Data.AppendText(String.Format("Flags: {0}\n", item.Flags)); if ((item.Flags & TileFlag.PartialHue) != 0) { partialHue = true; } if ((item.Flags & TileFlag.Animation) != 0) { info = Animdata.GetAnimData(index); if (info != null) { this.animateToolStripMenuItem.Visible = true; this.Data.AppendText(String.Format("Animation FrameCount: {0} Interval: {1}\n", info.FrameCount, info.FrameInterval)); } } }
private void UpdateDetail(int id) { Ultima.ItemData item = Ultima.TileData.ItemTable[id]; Bitmap bit = Ultima.Art.GetStatic(id); if (bit == null) { splitContainer2.SplitterDistance = 10; Bitmap newbit = new Bitmap(DetailPictureBox.Size.Width, DetailPictureBox.Size.Height); Graphics newgraph = Graphics.FromImage(newbit); newgraph.Clear(Color.FromArgb(-1)); DetailPictureBox.Image = newbit; } else { splitContainer2.SplitterDistance = bit.Size.Height + 10; Bitmap newbit = new Bitmap(DetailPictureBox.Size.Width, DetailPictureBox.Size.Height); Graphics newgraph = Graphics.FromImage(newbit); newgraph.Clear(Color.FromArgb(-1)); newgraph.DrawImage(bit, (DetailPictureBox.Size.Width - bit.Width) / 2, 5); DetailPictureBox.Image = newbit; } 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)); } } }