public GSellGump_InventoryItem(GSellGump owner, SellInfo si, int y, bool seperate) : base(0x20, y, 0xc3, 0) { this.m_Owner = owner; this.m_yBase = y; this.m_Info = si; IFont uniFont = Engine.GetUniFont(3); IHue hue = Hues.Load(0x288); this.m_Image = new GItemArt(0, 0, si.ItemID, si.Hue); this.m_Description = new GWrappedLabel(string.Format("{0} at {1} gp", si.Name, si.Price), uniFont, hue, 0x3a, 0, 0x69); this.m_Available = new GLabel(si.Amount.ToString(), uniFont, hue, 0xc3, 0); int num = (this.m_Image.Image.yMax - this.m_Image.Image.yMin) + 1; base.m_Height = num; num = (this.m_Description.Image.yMax - this.m_Description.Image.yMin) + 1; if (num > base.m_Height) { base.m_Height = num; } num = (this.m_Available.Image.yMax - this.m_Available.Image.yMin) + 1; if (num > base.m_Height) { base.m_Height = num; } this.m_Image.X += (0x38 - ((this.m_Image.Image.xMax - this.m_Image.Image.xMin) + 1)) / 2; this.m_Image.Y += (base.m_Height - ((this.m_Image.Image.yMax - this.m_Image.Image.yMin) + 1)) / 2; this.m_Image.X -= this.m_Image.Image.xMin; this.m_Image.Y -= this.m_Image.Image.yMin; this.m_Description.X -= this.m_Description.Image.xMin; this.m_Description.Y += (base.m_Height - ((this.m_Description.Image.yMax - this.m_Description.Image.yMin) + 1)) / 2; this.m_Description.Y -= this.m_Description.Image.yMin; this.m_Available.X -= this.m_Available.Image.xMax + 1; this.m_Available.Y += (base.m_Height - ((this.m_Available.Image.yMax - this.m_Available.Image.yMin) + 1)) / 2; this.m_Available.Y -= this.m_Available.Image.yMin; base.m_Children.Add(this.m_Image); base.m_Children.Add(this.m_Description); base.m_Children.Add(this.m_Available); this.m_xAvailable = si.Amount; if (seperate) { GImage image; this.m_Separator = new GImage[11]; this.m_Separator[0] = image = new GImage(0x39, 0, base.m_Height); base.m_Children.Add(image); for (int i = 0; i < 9; i++) { this.m_Separator[i + 1] = image = new GImage(0x3a, 30 + (i * 0x10), base.m_Height); base.m_Children.Add(image); } this.m_Separator[10] = image = new GImage(0x3b, 0xa5, base.m_Height); base.m_Children.Add(image); } else { this.m_Separator = new GImage[0]; } if (Engine.Features.AOS) { base.Tooltip = new ItemTooltip(si.Item); } }
protected internal override void OnDragLeave(Gump g) { if (this.m_Image != null) { Gumps.Destroy(this.m_Image); this.m_Image = null; } }
protected internal override void OnDragEnter(Gump g) { if ((g != null) && (g.GetType() == typeof(GDraggedItem))) { GDraggedItem item = (GDraggedItem)g; Item item2 = item.Item; int iD = item2.ID; int hue = item2.Hue; Engine.ItemArt.Translate(ref iD, ref hue); if (Map.m_ItemFlags[iD][TileFlag.Wearable]) { if (this.m_Image != null) { Gumps.Destroy(this.m_Image); } this.m_Image = new GImage(Gumps.GetEquipGumpID(iD, this.m_Gender, ref hue), Hues.GetItemHue(iD, hue), 8, 0x13); this.m_Image.Alpha = 0.5f; int count = base.m_Children.Count; LayerComparer paperdoll = LayerComparer.Paperdoll; int num4 = paperdoll.GetValue(iD, (Layer)Map.GetQuality(iD)); for (int i = 0; i < base.m_Children.Count; i++) { Gump gump = base.m_Children[i]; if (gump.GetType() == typeof(GPaperdollItem)) { GPaperdollItem item3 = (GPaperdollItem)gump; if (paperdoll.GetValue(item3.Item.ID, (Layer)((byte)item3.Layer)) < num4) { count = i; break; } } } base.m_Children.Insert(count, this.m_Image); } } }
protected internal override void OnDragDrop(Gump g) { if ((g != null) && (g.GetType() == typeof(GDraggedItem))) { GDraggedItem item = (GDraggedItem)g; Item toEquip = item.Item; Item item3 = null; Gump[] gumpArray = base.m_Children.ToArray(); Point point = base.PointToClient(new Point(Engine.m_xMouse, Engine.m_yMouse)); for (int i = gumpArray.Length - 1; i >= 0; i--) { if ((gumpArray[i] is GPaperdollItem) && gumpArray[i].HitTest(point.X - gumpArray[i].X, point.Y - gumpArray[i].Y)) { item3 = ((GPaperdollItem)gumpArray[i]).Item; break; } } if ((item3 != null) && Map.m_ItemFlags[item3.ID & 0x3fff][TileFlag.Container]) { Network.Send(new PDropItem(toEquip.Serial, -1, -1, 0, item3.Serial)); } else if (Map.m_ItemFlags[toEquip.ID & 0x3fff][TileFlag.Wearable]) { Network.Send(new PEquipItem(toEquip, this.m_Mobile)); } else { Network.Send(new PDropItem(toEquip.Serial, -1, -1, 0, World.Serial)); } Gumps.Destroy(item); } if (this.m_Image != null) { Gumps.Destroy(this.m_Image); this.m_Image = null; } }
protected internal override void OnDragDrop(Gump g) { if ((g != null) && (g.GetType() == typeof(GDraggedItem))) { GDraggedItem item = (GDraggedItem) g; Item toEquip = item.Item; Item item3 = null; Gump[] gumpArray = base.m_Children.ToArray(); Point point = base.PointToClient(new Point(Engine.m_xMouse, Engine.m_yMouse)); for (int i = gumpArray.Length - 1; i >= 0; i--) { if ((gumpArray[i] is GPaperdollItem) && gumpArray[i].HitTest(point.X - gumpArray[i].X, point.Y - gumpArray[i].Y)) { item3 = ((GPaperdollItem) gumpArray[i]).Item; break; } } if ((item3 != null) && Map.m_ItemFlags[item3.ID & 0x3fff][TileFlag.Container]) { Network.Send(new PDropItem(toEquip.Serial, -1, -1, 0, item3.Serial)); } else if (Map.m_ItemFlags[toEquip.ID & 0x3fff][TileFlag.Wearable]) { Network.Send(new PEquipItem(toEquip, this.m_Mobile)); } else { Network.Send(new PDropItem(toEquip.Serial, -1, -1, 0, World.Serial)); } Gumps.Destroy(item); } if (this.m_Image != null) { Gumps.Destroy(this.m_Image); this.m_Image = null; } }
protected internal override void OnDragEnter(Gump g) { if ((g != null) && (g.GetType() == typeof(GDraggedItem))) { GDraggedItem item = (GDraggedItem) g; Item item2 = item.Item; int iD = item2.ID; int hue = item2.Hue; Engine.ItemArt.Translate(ref iD, ref hue); if (Map.m_ItemFlags[iD][TileFlag.Wearable]) { if (this.m_Image != null) { Gumps.Destroy(this.m_Image); } this.m_Image = new GImage(Gumps.GetEquipGumpID(iD, this.m_Gender, ref hue), Hues.GetItemHue(iD, hue), 8, 0x13); this.m_Image.Alpha = 0.5f; int count = base.m_Children.Count; LayerComparer paperdoll = LayerComparer.Paperdoll; int num4 = paperdoll.GetValue(iD, (Layer) Map.GetQuality(iD)); for (int i = 0; i < base.m_Children.Count; i++) { Gump gump = base.m_Children[i]; if (gump.GetType() == typeof(GPaperdollItem)) { GPaperdollItem item3 = (GPaperdollItem) gump; if (paperdoll.GetValue(item3.Item.ID, (Layer) ((byte) item3.Layer)) < num4) { count = i; break; } } } base.m_Children.Insert(count, this.m_Image); } } }
public static void ShowCharCitySelection(int Str, int Dex, int Int, int vSkill1, int vSkill2, int vSkill3, int iSkill1, int iSkill2, int iSkill3, int hSkinTone, int hShirtColor, int hPantsColor, int hHairColor, int hFacialHairColor, string Name, int Gender) { Cursor.Hourglass = false; Point[] pointArray = new Point[] { new Point(0x2c, 0x5e), new Point(190, 0x2f), new Point(0x74, 0x9a), new Point(0x152, 0x6f), new Point(0x8f, 0x102), new Point(0x116, 0xcb), new Point(0x68, 0x15b), new Point(0x2a, 0xc6), new Point(220, 0x54) }; string[] strArray = new string[] { "Yew", "Minoc", "Britain", "Moonglow", "Trinsic", "Magincia", "Jhelom", "Skara Brae", "Vesper" }; Gumps.Desktop.Children.Clear(); Gumps.Desktop.Children.Add(new GBackground(0x588, ScreenWidth, ScreenHeight, false)); Gumps.Desktop.Children.Add(new GImage(0x157c, 0, 0)); Gumps.Desktop.Children.Add(new GImage(0x15a0, 0, 4)); GButton toAdd = new GButton(0x1589, 0x22b, 4, new OnClick(Engine.Quit_OnClick)) { Tooltip = new Tooltip(Strings.GetString("Tooltips.Quit")) }; Gumps.Desktop.Children.Add(toAdd); Gumps.Desktop.Children.Add(new GBackground(0xbbc, 0x9e, 0x16f, 0x1c4, 60, true)); GImage image = new GImage(0x1598, 0x39, 0x31); for (int i = 0; i < 9; i++) { GTextButton button2; GImage image2 = new GImage(0x4b9, pointArray[i].X, pointArray[i].Y); image.Children.Add(image2); button2 = new GTextButton(strArray[i], GetUniFont(0), Hues.Load(0x58), Hues.Load(0x35), pointArray[i].X, 0, new OnClick(Engine.City_OnClick)) { Y = (pointArray[i].Y - button2.Height) - 1 }; if (i == 3) { button2.X = (pointArray[i].X + 14) - button2.Width; } button2.SetTag("Strength", Str); button2.SetTag("Dexterity", Dex); button2.SetTag("Intelligence", Int); button2.SetTag("vSkill1", vSkill1); button2.SetTag("vSkill2", vSkill2); button2.SetTag("vSkill3", vSkill3); button2.SetTag("iSkill1", iSkill1); button2.SetTag("iSkill2", iSkill2); button2.SetTag("iSkill3", iSkill3); button2.SetTag("Skin Tone", hSkinTone); button2.SetTag("Shirt Color", hShirtColor); button2.SetTag("Pants Color", hPantsColor); button2.SetTag("Hair Color", hHairColor); button2.SetTag("Facial Hair Color", hFacialHairColor); button2.SetTag("CityID", i); button2.SetTag("Name", Name); button2.SetTag("Gender", Gender); image.Children.Add(button2); int x = Smallest(image2.X, button2.X); int y = Smallest(image2.Y, button2.Y); int width = Biggest(image2.X + image2.Width, button2.X + button2.Width) - x; int height = Biggest(image2.Y + image2.Height, button2.Y + button2.Height) - y; GHotspot hotspot = new GHotspot(x, y, width, height, button2) { Tooltip = new Tooltip("Click here to enter this city") }; image.Children.Add(hotspot); } Gumps.Desktop.Children.Add(image); }
public static void ShowCharAppearance(int Str, int Dex, int Int, int vSkill1, int vSkill2, int vSkill3, int iSkill1, int iSkill2, int iSkill3) { Cursor.Hourglass = false; Gumps.Desktop.Children.Clear(); Gumps.Desktop.Children.Add(new GBackground(0x588, ScreenWidth, ScreenHeight, false)); Gumps.Desktop.Children.Add(new GImage(0x157c, 0, 0)); Gumps.Desktop.Children.Add(new GImage(0x15a0, 0, 4)); GButton toAdd = new GButton(0x1589, 0x22b, 4, new OnClick(Engine.Quit_OnClick)) { Tooltip = new Tooltip(Strings.GetString("Tooltips.Quit")) }; Gumps.Desktop.Children.Add(toAdd); Gumps.Desktop.Children.Add(new GImage(0x709, 280, 0x35)); GTextBox box = new GTextBox(0, false, 0xf8, 0x4b, 0xd7, 0x10, "Name", GetFont(5), Hues.Load(0x76b), Hues.Load(0x835), Hues.Load(0x25)) { Tooltip = new Tooltip(Strings.GetString("Tooltips.CharCreateName")) }; Gumps.Desktop.Children.Add(new GImage(0x70a, 240, 0x49)); Gumps.Desktop.Children.Add(new GBackground(0x70b, 0xd7, 0x10, 0xf8, 0x49, false)); Gumps.Desktop.Children.Add(new GImage(0x70c, 0x1cf, 0x49)); Gumps.Desktop.Children.Add(box); GImage image = new GImage(0x708, 0xee, 0x62); GButton button2 = new GButton(0x710, 0x48, 320, new OnClick(Engine.CharGender_OnClick)); button2.SetTag("Gender", 0); image.Children.Add(button2); Gumps.Desktop.Children.Add(image); Gumps.Desktop.Children.Add(new GBackground(0xe14, 0x97, 310, 0x52, 0x7d, true)); GBackground background = new GBackground(0xe14, 0x97, 310, 0x1db, 0x7d, true); string[] strArray = new string[] { "Skin Tone", "Shirt Color", "Pants Color", "Hair Color", "Facial Hair Color" }; string[] strArray2 = new string[] { Strings.GetString("Tooltips.CharCreateSkinTone"), Strings.GetString("Tooltips.CharCreateShirtHue"), Strings.GetString("Tooltips.CharCreatePantsHue"), Strings.GetString("Tooltips.CharCreateHairHue"), Strings.GetString("Tooltips.CharCreateFHairHue") }; int[] numArray = new int[] { GetRandomSkinHue(), GetRandomHue(), GetRandomHue(), GetRandomHairHue(), GetRandomHairHue(), GetRandomYellowHue() }; numArray[0] ^= 0x8000; if (!Map.m_ItemFlags[0x1517][TileFlag.PartialHue]) { numArray[1] ^= 0x8000; } if (!Map.m_ItemFlags[0x152e][TileFlag.PartialHue]) { numArray[2] ^= 0x8000; } if (!Map.m_ItemFlags[0x203b][TileFlag.PartialHue]) { numArray[3] ^= 0x8000; } if (!Map.m_ItemFlags[0x2040][TileFlag.PartialHue]) { numArray[4] ^= 0x8000; } if (!Map.m_ItemFlags[0x170f][TileFlag.PartialHue]) { numArray[5] ^= 0x8000; } Gump[] gumpArray = new Gump[] { new GImage(0x761, Hues.Load(numArray[0]), 0, 0), new GImage(0x739, Hues.Load(numArray[1]), 0, 0), new GImage(0x738, Hues.Load(numArray[2]), 0, 0), new GImage(0x753, Hues.Load(numArray[3]), 0, 0), new GImage(0x759, Hues.Load(numArray[4]), 0, 0), new GImage(0x762, Hues.Load(numArray[5]), 0, 0) }; gumpArray[0].SetTag("ItemID", 0); gumpArray[1].SetTag("ItemID", 0x1517); gumpArray[2].SetTag("ItemID", 0x152e); gumpArray[3].SetTag("ItemID", 0x203b); gumpArray[4].SetTag("ItemID", 0x2040); gumpArray[5].SetTag("ItemID", 0x170f); button2.SetTag("Image", gumpArray[0]); int offsetY = background.OffsetY; image.Children.Add(gumpArray[0]); image.Children.Add(gumpArray[5]); image.Children.Add(gumpArray[1]); image.Children.Add(gumpArray[2]); image.Children.Add(gumpArray[4]); image.Children.Add(gumpArray[3]); GButton button3 = new GButton(0x15a4, 610, 0x1bd, new OnClick(Engine.CharCreationAppearanceArrow_OnClick)); button2.SetTag("Image[5]", gumpArray[5]); button2.SetTag("Arrow", button3); UnicodeFont uniFont = GetUniFont(0); for (int i = 0; i < 5; i++) { GTextButton button4 = new GTextButton(strArray[i], uniFont, Hues.Bright, Hues.Load(0x26), background.OffsetX, offsetY, new OnClick(Engine.AppearanceHueProperty_OnClick)) { SpaceWidth = 6 }; offsetY += button4.Height - 2; GHuePreview preview = new GHuePreview(background.OffsetX, offsetY, 100, 0x10, numArray[i], false); offsetY += 0x10; button4.Tooltip = new Tooltip(strArray2[i]); button4.SetTag("Property", strArray[i]); button4.SetTag("Preview", preview); button4.SetTag("Image", gumpArray[i]); button2.SetTag(string.Format("Image[{0}]", i), gumpArray[i]); button3.SetTag(strArray[i], preview); background.Children.Add(button4); background.Children.Add(preview); GHotspot hotspot = new GHotspot(button4.X, button4.Y, Biggest(button4.Width, preview.Width), (preview.Y + preview.Height) - button4.Y, button4) { Tooltip = new Tooltip(strArray2[i]) }; background.Children.Add(hotspot); if (i == 4) { button2.SetTag("HideHS", hotspot); button2.SetTag("HideTB", button4); button2.SetTag("HideHP", preview); } } Gumps.Desktop.Children.Add(background); button3.SetTag("Strength", Str); button3.SetTag("Dexterity", Dex); button3.SetTag("Intelligence", Int); button3.SetTag("vSkill1", vSkill1); button3.SetTag("vSkill2", vSkill2); button3.SetTag("vSkill3", vSkill3); button3.SetTag("iSkill1", iSkill1); button3.SetTag("iSkill2", iSkill2); button3.SetTag("iSkill3", iSkill3); button3.SetTag("Name", box); button3.SetTag("Gender", 0); Gumps.Desktop.Children.Add(button3); }
private static void StringQuery(PacketReader pvSrc) { GDragable dragable; GWrappedLabel label2; int num = pvSrc.ReadInt32(); short num2 = pvSrc.ReadInt16(); int fixedLength = pvSrc.ReadInt16(); string text = pvSrc.ReadString(fixedLength); bool flag = pvSrc.ReadBoolean(); byte num4 = pvSrc.ReadByte(); int num5 = pvSrc.ReadInt32(); int num6 = pvSrc.ReadInt16(); string str2 = pvSrc.ReadString(num6); dragable = new GDragable(0x474, 0, 0) { CanClose = false, Modal = true, X = (Engine.ScreenWidth - dragable.Width) / 2, Y = (Engine.ScreenHeight - dragable.Height) / 2 }; GButton toAdd = new GButton(0x47b, 0x47d, 0x47c, 0x75, 190, new OnClick(Engine.StringQueryOkay_OnClick)); GButton button2 = new GButton(0x478, 0x47a, 0x479, 0xcc, 190, flag ? new OnClick(Engine.StringQueryCancel_OnClick) : null); if (!flag) { button2.Enabled = false; } GImage image = new GImage(0x477, 60, 0x91); GWrappedLabel label = new GWrappedLabel(text, Engine.GetFont(2), Hues.Load(0x455), 60, 0x30, 0x110); label2 = new GWrappedLabel(str2, Engine.GetFont(2), Hues.Load(0x455), 60, 0x30, 0x110) { Y = image.Y - label2.Height }; GTextBox box = new GTextBox(0, false, 0x44, 140, image.Width - 8, image.Height, "", Engine.GetFont(1), Hues.Load(0x455), Hues.Load(0x455), Hues.Load(0x455)); box.Focus(); if (num4 == 1) { box.MaxChars = num5; } toAdd.SetTag("Dialog", dragable); toAdd.SetTag("Serial", num); toAdd.SetTag("Type", num2); toAdd.SetTag("Text", box); button2.SetTag("Dialog", dragable); button2.SetTag("Serial", num); button2.SetTag("Type", num2); dragable.Children.Add(label); dragable.Children.Add(label2); dragable.Children.Add(image); dragable.Children.Add(box); dragable.Children.Add(button2); dragable.Children.Add(toAdd); dragable.m_CanDrag = true; Gumps.Desktop.Children.Add(dragable); }
public static void OpenPaperdoll(Mobile m, string Name, bool canDrag) { if (m != null) { GPaperdoll paperdoll; bool flag = m.Paperdoll != null; bool flag2 = flag && (m_LastOver == m.Paperdoll); bool flag3 = flag && (m_Drag == m.Paperdoll); int num = flag3 ? m_Drag.m_OffsetX : 0; int num2 = flag3 ? m_Drag.m_OffsetY : 0; int index = flag ? m.Paperdoll.Parent.Children.IndexOf(m.Paperdoll) : -1; int x = 0x7fffffff; int y = 5; if (flag) { x = m.Paperdoll.X; y = m.Paperdoll.Y; Destroy(m.Paperdoll); } else if ((m.PaperdollX < 0x7fffffff) && (m.PaperdollY < 0x7fffffff)) { x = m.PaperdollX; y = m.PaperdollY; m.PaperdollX = 0x7fffffff; m.PaperdollY = 0x7fffffff; } OnClick[] clickArray2 = new OnClick[8]; clickArray2[0] = new OnClick(Engine.Help_OnClick); clickArray2[1] = new OnClick(Engine.Options_OnClick); clickArray2[2] = new OnClick(Engine.LogOut_OnClick); clickArray2[3] = new OnClick(Engine.Journal_OnClick); clickArray2[4] = new OnClick(Engine.Skills_OnClick); clickArray2[6] = new OnClick(Engine.AttackModeToggle_OnClick); clickArray2[7] = new OnClick(Engine.Status_OnClick); OnClick[] clickArray = clickArray2; int[] numArray = new int[] { 0x2c, 0x47, 0x62, 0x7c, 0x97, 0xb3, 0xcd, 0xe9 }; int[] numArray3 = new int[] { 0x7ef, 0x7d6, 0x7d9, 0x7dc, 0x7df, 0x7e2, 0, 0x7eb }; numArray3[6] = World.Player.Flags[MobileFlag.Warmode] ? 0x7e8 : 0x7e5; int[] numArray2 = numArray3; if (m.Player) { paperdoll = new GPaperdoll(m, 0x7d0, x, y); if (!flag && (x >= 0x7fffffff)) { paperdoll.X = (Engine.ScreenWidth - paperdoll.Width) - 5; } paperdoll.Children.Add(new GButton(0x7ef, 0x7f1, 0x7f0, 0xb9, 0x2c, null)); GButton[] buttonArray = new GButton[7]; for (int i = 0; i < 7; i++) { buttonArray[i] = new GButton(numArray2[i], numArray2[i] + 2, numArray2[i] + 1, 0xb9, numArray[i], clickArray[i]); buttonArray[i].Enabled = clickArray[i] != null; paperdoll.Children.Add(buttonArray[i]); } } else { paperdoll = new GPaperdoll(m, 0x7d1, x, y); if (!flag && (x >= 0x7fffffff)) { paperdoll.X = (Engine.ScreenWidth - paperdoll.Width) - 5; } } paperdoll.Children.Add(new GVirtueTrigger(m)); GButton toAdd = new GButton(numArray2[7], numArray2[7] + 2, numArray2[7] + 1, 0xb9, numArray[7], clickArray[7]); toAdd.SetTag("Serial", m.Serial); paperdoll.Children.Add(toAdd); int hueID = (ushort) m.Hue; bool flag4 = false; int gender = 0; int body = m.Body; hueID ^= 0x8000; IHue h = Hues.Load(hueID); Engine.m_Animations.Translate(ref body, ref h); switch (body) { case 400: gender = 0; paperdoll.Children.Add(new GImage(12, h, 8, 0x13)); break; case 0x191: gender = 1; paperdoll.Children.Add(new GImage(13, h, 8, 0x13)); break; case 0x192: case 0x193: { GImage image = new GImage((m.Gender == 0) ? 12 : 13, 8, 0x13) { Alpha = 0.25f }; paperdoll.Children.Add(image); flag4 = true; break; } case 0x3db: gender = m.Gender; paperdoll.Children.Add(new GImage((m.Gender == 0) ? 12 : 13, Hues.Load(0x3ea), 8, 0x13)); paperdoll.Children.Add(new GImage(0xee3b, h, 8, 0x13)); break; default: { int paperdollGump = Config.GetPaperdollGump(body); if (paperdollGump != 0) { paperdoll.Children.Add(new GImage(paperdollGump, h, 8, 0x13)); } break; } } paperdoll.Gender = gender; if (flag4) { for (int j = 0; j < m.Equip.Count; j++) { EquipEntry entry = (EquipEntry) m.Equip[j]; if (entry.m_Layer == Layer.OuterTorso) { int iD = entry.m_Item.ID; int hue = entry.m_Item.Hue; int gumpID = GetEquipGumpID(iD, gender, ref hue); GPaperdollItem item = new GPaperdollItem(8, 0x13, gumpID, entry.m_Item.Serial, Hues.GetItemHue(iD, hue), (int) entry.m_Layer, m, canDrag) { Alpha = 0.5f }; paperdoll.Children.Add(item); } } } else { LayerComparer comparer = LayerComparer.Paperdoll; m.Equip.Sort(comparer); for (int k = 0; k < m.Equip.Count; k++) { EquipEntry entry2 = (EquipEntry) m.Equip[k]; if (comparer.IsValid(entry2.m_Layer)) { int itemID = entry2.m_Item.ID; int num17 = entry2.m_Item.Hue; int num18 = GetEquipGumpID(itemID, gender, ref num17); paperdoll.Children.Add(new GPaperdollItem(8, 0x13, num18, entry2.m_Item.Serial, Hues.GetItemHue(itemID, num17), (int) entry2.m_Layer, m, canDrag)); } } m.Equip.Sort(LayerComparer.FromDirection(m.Direction)); } paperdoll.Children.Add(new GProfileScroll(m)); paperdoll.Children.Add(new GWrappedLabel(Name, Engine.GetFont(1), Hues.Load(0x769), 0x27, 0x108, 0xb8)); paperdoll.SetTag("Dispose", "Paperdoll"); paperdoll.SetTag("Serial", m.Serial); if (flag2) { m_LastOver = paperdoll; } if (flag3) { paperdoll.m_IsDragging = true; paperdoll.OffsetX = num; paperdoll.OffsetY = num2; m_Drag = paperdoll; } if (((paperdoll.X + paperdoll.Width) - paperdoll.m_DragClipX) < 0) { paperdoll.X = paperdoll.m_DragClipX - paperdoll.Width; } else if ((paperdoll.X + paperdoll.m_DragClipX) >= Engine.ScreenWidth) { paperdoll.X = Engine.ScreenWidth - paperdoll.m_DragClipX; } if (((paperdoll.Y + paperdoll.Height) - paperdoll.m_DragClipY) < 0) { paperdoll.Y = paperdoll.m_DragClipY - paperdoll.Height; } else if ((paperdoll.Y + paperdoll.m_DragClipY) >= Engine.ScreenHeight) { paperdoll.Y = Engine.ScreenHeight - paperdoll.m_DragClipY; } if (index != -1) { Desktop.Children.Insert(index, paperdoll); } else { Desktop.Children.Add(paperdoll); } m.Paperdoll = paperdoll; } }
private static bool Parse_Image(XmlTextReader xml, Gump Parent, string Name) { Gump gump; int gumpID = 0; int x = 0; int y = 0; bool @bool = false; float num4 = 1f; bool isEmptyElement = xml.IsEmptyElement; while (xml.MoveToNextAttribute()) { switch (xml.Name) { case "GumpID": { gumpID = GetInt(xml.Value); continue; } case "GumpIDi": { gumpID = Convert.ToInt32(xml.Value); continue; } case "GumpIDh": { gumpID = Convert.ToInt32(xml.Value.Substring(2), 0x10); continue; } case "X": { x = GetInt(xml.Value); continue; } case "Xi": { x = Convert.ToInt32(xml.Value); continue; } case "Xh": { x = Convert.ToInt32(xml.Value.Substring(2), 0x10); continue; } case "Y": { y = GetInt(xml.Value); continue; } case "Yi": { y = Convert.ToInt32(xml.Value); continue; } case "Yh": { y = Convert.ToInt32(xml.Value.Substring(2), 0x10); continue; } case "HitTest": { @bool = GetBool(xml.Value); continue; } case "HitTestb": { @bool = Convert.ToBoolean(xml.Value); continue; } case "Alpha": { num4 = ((float) GetInt(xml.Value)) / 255f; continue; } case "Alphai": { num4 = ((float) Convert.ToInt32(xml.Value)) / 255f; continue; } case "Alphah": { num4 = ((float) Convert.ToInt32(xml.Value.Substring(2), 0x10)) / 255f; continue; } } return false; } if (!@bool) { gump = new GImage(gumpID, x, y); ((GImage) gump).Alpha = num4; } else { gump = new GDragable(gumpID, x, y) { m_CanDrag = false }; ((GDragable) gump).Alpha = num4; } Parent.Children.Add(gump); if (isEmptyElement) { return true; } while (xml.Read()) { XmlNodeType nodeType = xml.NodeType; if (nodeType != XmlNodeType.Element) { if (nodeType != XmlNodeType.Comment) { return (nodeType == XmlNodeType.EndElement); } } else if (!Parse_Element(xml, gump, Name)) { return false; } } return false; }