private void OpenList_OnClick(Gump g) { if (this.m_Dropdown != null) { Gumps.Destroy(this.m_Dropdown); } Point point = base.PointToScreen(new Point(0, 0)); this.m_Dropdown = new GBackground(this.m_BackID, this.Width, (this.m_Count * 20) + (this.Height - base.UseHeight), point.X, point.Y, true); this.m_Dropdown.DestroyOnUnfocus = true; int offsetY = this.m_Dropdown.OffsetY; int num2 = 0; for (int i = 0; i < this.m_Count; i++) { GTextButton toAdd = new GTextButton(this.m_List[i], this.m_Font, this.m_HRegular, this.m_HOver, this.m_Dropdown.OffsetX, offsetY, new OnClick(this.SetIndex_OnClick)); toAdd.SetTag("Index", i); this.m_Dropdown.Children.Add(toAdd); offsetY += toAdd.Height; if ((toAdd.Width + 3) > num2) { num2 = toAdd.Width + 3; } } this.m_Dropdown.Height = offsetY + (this.m_Dropdown.Height - (this.m_Dropdown.OffsetY + this.m_Dropdown.UseHeight)); num2 += this.m_Dropdown.Width - this.m_Dropdown.UseWidth; if (num2 > this.m_Dropdown.Width) { this.m_Dropdown.Width = num2; } Gumps.Desktop.Children.Add(this.m_Dropdown); }
private Gump CreateLabel(string text, bool scroll) { text = text.Replace('\r', '\n'); GBackground background = new GBackground(0xbbc, 200, 100, true); GWrappedLabel toAdd = new GWrappedLabel(text, Engine.GetFont(1), Hues.Load(0x455), background.OffsetX, background.OffsetY, background.UseWidth); background.Height = toAdd.Height + (background.Height - background.UseHeight); background.Children.Add(toAdd); toAdd.Center(); background.SetMouseOverride(this); return background; }
private Gump CreateLabel(string text, bool scroll) { text = text.Replace('\r', '\n'); GBackground background = new GBackground(0xbbc, 200, 100, true); GWrappedLabel toAdd = new GWrappedLabel(text, Engine.GetFont(1), Hues.Load(0x455), background.OffsetX, background.OffsetY, background.UseWidth); background.Height = toAdd.Height + (background.Height - background.UseHeight); background.Children.Add(toAdd); toAdd.Center(); background.SetMouseOverride(this); return(background); }
public GTextBox(int GumpID, bool HasBorder, int X, int Y, int Width, int Height, string StartText, IFont f, IHue HNormal, IHue HOver, IHue HFocus, char PassChar) : base(X, Y) { this.m_String = ""; this.m_MaxChars = -1; this.m_Transparent = GumpID == 0; this.m_Back = new GBackground(GumpID, Width, Height, HasBorder); this.m_PassChar = PassChar; this.m_String = StartText; this.m_Font = f; this.m_HNormal = HNormal; this.m_HFocus = HFocus; this.m_HOver = HOver; this.m_Width = Width; this.m_Height = Height; base.m_OverCursor = 14; this.UpdateLabel(false, this.m_HNormal); }
public GUpdateScroll(string text) : base(0x13c2, 100, 100, 40, 30, true) { GLabel toAdd = new GLabel("Updates", Engine.DefaultFont, Hues.Load(0x1f0), base.OffsetX, base.OffsetY); GBackground background = new GBackground(0xbbc, 100, 100, base.OffsetX, (toAdd.Y + toAdd.Height) + 4, true); GWrappedLabel label2 = new GWrappedLabel(text, Engine.GetFont(1), Hues.Load(0x455), background.OffsetX + 2, background.OffsetY + 2, 250); background.Width = ((background.Width - background.UseWidth) + label2.Width) + 6; background.Height = ((background.Height - background.UseHeight) + label2.Height) + 2; background.Children.Add(label2); this.Width = (this.Width - base.UseWidth) + background.Width; this.Height = (((this.Height - base.UseHeight) + toAdd.Height) + 4) + background.Height; toAdd.X += (base.UseWidth - toAdd.Width) / 2; base.m_CanDrag = true; base.m_QuickDrag = true; base.CanClose = true; background.SetMouseOverride(this); base.m_Children.Add(toAdd); base.m_Children.Add(background); }
public static void AppearanceHueProperty_OnClick(Gump Sender) { string tag = (string) Sender.GetTag("Property"); Gump gump = (Gump) Sender.GetTag("Preview"); Gump gump2 = (Gump) Sender.GetTag("Image"); GBackground background = new GBackground(0xe14, 0x97, 310, 0x1db, 0x7d, true); Gump toAdd = null; string str = tag; if (str != null) { str = string.IsInterned(str); if (str == "Skin Tone") { toAdd = new GSkinHuePickerAll(background.OffsetX, background.OffsetY, background.UseWidth, background.UseHeight); ((GSkinHuePickerAll) toAdd).OnHueRelease = new OnHueSelect(Engine.AppearanceHuePicker_OnHueRelease); ((GSkinHuePickerAll) toAdd).OnHueSelect = new OnHueSelect(Engine.AppearanceHuePicker_OnHueSelect); toAdd.SetTag("Back", background); toAdd.SetTag("Preview", gump); toAdd.SetTag("Image", gump2); toAdd.SetTag("Sender", Sender); } else if (str == "Shirt Color") { toAdd = new GHuePickerAll(background.OffsetX, background.OffsetY, background.UseWidth, background.UseHeight); ((GHuePickerAll) toAdd).OnHueRelease = new OnHueSelect(Engine.AppearanceHuePicker_OnHueRelease); ((GHuePickerAll) toAdd).OnHueSelect = new OnHueSelect(Engine.AppearanceHuePicker_OnHueSelect); toAdd.SetTag("Back", background); toAdd.SetTag("Preview", gump); toAdd.SetTag("Image", gump2); toAdd.SetTag("Sender", Sender); } else if (str == "Pants Color") { toAdd = new GHuePickerAll(background.OffsetX, background.OffsetY, background.UseWidth, background.UseHeight); ((GHuePickerAll) toAdd).OnHueRelease = new OnHueSelect(Engine.AppearanceHuePicker_OnHueRelease); ((GHuePickerAll) toAdd).OnHueSelect = new OnHueSelect(Engine.AppearanceHuePicker_OnHueSelect); toAdd.SetTag("Back", background); toAdd.SetTag("Preview", gump); toAdd.SetTag("Image", gump2); toAdd.SetTag("Sender", Sender); } else if (str == "Hair Color") { toAdd = new GHairHuePickerAll(background.OffsetX, background.OffsetY, background.UseWidth, background.UseHeight); ((GHairHuePickerAll) toAdd).OnHueRelease = new OnHueSelect(Engine.AppearanceHuePicker_OnHueRelease); ((GHairHuePickerAll) toAdd).OnHueSelect = new OnHueSelect(Engine.AppearanceHuePicker_OnHueSelect); toAdd.SetTag("Back", background); toAdd.SetTag("Preview", gump); toAdd.SetTag("Image", gump2); toAdd.SetTag("Sender", Sender); } else { if (str != "Facial Hair Color") { return; } toAdd = new GHairHuePickerAll(background.OffsetX, background.OffsetY, background.UseWidth, background.UseHeight); ((GHairHuePickerAll) toAdd).OnHueRelease = new OnHueSelect(Engine.AppearanceHuePicker_OnHueRelease); ((GHairHuePickerAll) toAdd).OnHueSelect = new OnHueSelect(Engine.AppearanceHuePicker_OnHueSelect); toAdd.SetTag("Back", background); toAdd.SetTag("Preview", gump); toAdd.SetTag("Image", gump2); toAdd.SetTag("Sender", Sender); } toAdd.X += (background.UseWidth - toAdd.Width) / 2; toAdd.Y += (background.UseHeight - toAdd.Height) / 2; background.Children.Add(toAdd); Gumps.Desktop.Children.Add(background); } }
public static void ShowCharCreationSkills(int Str, int Dex, int Int, int vSkill1, int vSkill2, int vSkill3, int iSkill1, int iSkill2, int iSkill3) { GButton button2; GVSlider slider; GTextButton button3; GTextButton button4; GTextButton button5; Cursor.Hourglass = false; GBackground toAdd = new GBackground(0xa2c, 0x222, 0x160, 80, 80, true); toAdd.Children.Add(new GImage(0x58b, 0x42, -22)); toAdd.Children.Add(new GImage(0x589, 0x8e, -38)); toAdd.Children.Add(new GImage(0x1580, 0x97, -30)); toAdd.Children.Add(new GButton(0x119c, 120, 0x114, null)); GListBox box = new GListBox(GetFont(9), Hues.Load(0x76b), Hues.Load(0x961), 0xbbc, 40, 0x39, 0xcc, 0xd6, true); Client.Skills skills = Skills; for (int i = 0; i < 0x100; i++) { Skill skill = skills[i]; if (skill == null) { break; } box.AddItem(skill.Name); } box.OnClick = new OnClick(Engine.CharSkill_OnClick); toAdd.Children.Add(box); int num2 = 0x31 - box.ItemCount; if (num2 < 0) { num2 = 0; } GButton button = new GButton(250, 250, 0xfb, box.X + box.Width, box.Y, new OnClick(Engine.ScrollUp_OnClick)); toAdd.Children.Add(button); button2 = new GButton(0xfc, 0xfc, 0xfd, box.X + box.Width, box.Y + box.Height, new OnClick(Engine.ScrollDown_OnClick)) { Y = button2.Y - button2.Height }; toAdd.Children.Add(button2); toAdd.Children.Add(new GBackground(0x100, button.Width, button2.Y - (button.Y + button.Height), button.X, button.Y + button.Height, false)); slider = new GVSlider(0xfe, (box.X + box.Width) + 1, button.Y + button.Height, 13, button2.Y - (button.Y + button.Height), 0.0, 0.0, (double) num2, 1.0) { Y = slider.Y + slider.HalfHeight, Height = slider.Height - (slider.HalfHeight * 2), OnValueChange = new OnValueChange(Engine.ListView_OnValueChange) }; slider.SetTag("ListBox", box); slider.SetValue(0.0, false); toAdd.Children.Add(slider); button.SetTag("Scroller", slider); button2.SetTag("Scroller", slider); toAdd.Children.Add(new GBackground(0xbbc, 0x69, 0x19, 270, 0xba, true)); toAdd.Children.Add(new GBackground(0xbbc, 0x69, 0x19, 270, 0xd8, true)); toAdd.Children.Add(new GBackground(0xbbc, 0x69, 0x19, 270, 0xf6, true)); toAdd.Children.Add(new GLabel("Strength", GetFont(1), Hues.Load(1), 280, 0x38)); toAdd.Children.Add(new GLabel("Dexterity", GetFont(1), Hues.Load(1), 280, 0x56)); toAdd.Children.Add(new GLabel("Intelligence", GetFont(1), Hues.Load(1), 280, 0x74)); int[] numArray = new int[] { 0x39, 0x57, 0x75, 0xc1, 0xdf, 0xfd }; int[] numArray2 = new int[] { Str, Dex, Int, vSkill1, vSkill2, vSkill3 }; double[] numArray3 = new double[] { 10.0, 10.0, 10.0, 0.0, 0.0, 0.0 }; double[] numArray4 = new double[] { 60.0, 60.0, 60.0, 50.0, 50.0, 50.0 }; double[] numArray5 = new double[] { 80.0, 80.0, 80.0, 100.0, 100.0, 100.0 }; GSlider[] sliderArray = new GSlider[6]; GLabel[] labelArray = new GLabel[6]; for (int j = 0; j < 6; j++) { toAdd.Children.Add(new GImage(0xd5, 420, numArray[j])); toAdd.Children.Add(new GBackground(0xd6, 0x4b, 14, 0x1b1, numArray[j], false)); toAdd.Children.Add(new GImage(0xd7, 0x1fc, numArray[j])); GLabel label = new GLabel(numArray2[j].ToString(), GetFont(1), Hues.Load(1), 380, numArray[j] - 1); GSlider slider2 = new GSlider(0xd8, 0x1a8, numArray[j], 0x5d, 14, (double) numArray2[j], numArray3[j], numArray4[j], 1.0) { OnValueChange = new OnValueChange(Engine.UpdateStaticSlider_OnValueChange) }; slider2.SetTag("Static", label); slider2.SetTag("Font", GetFont(1)); slider2.SetTag("Hue", Hues.Load(1)); slider2.SetTag("Max", numArray5[j]); sliderArray[j] = slider2; labelArray[j] = label; toAdd.Children.Add(label); toAdd.Children.Add(slider2); } for (int k = 0; k < 3; k++) { string name = string.Format("Slider{0}", k + 1); sliderArray[0].SetTag(name, sliderArray[k]); sliderArray[1].SetTag(name, sliderArray[k]); sliderArray[2].SetTag(name, sliderArray[k]); sliderArray[3].SetTag(name, sliderArray[k + 3]); sliderArray[4].SetTag(name, sliderArray[k + 3]); sliderArray[5].SetTag(name, sliderArray[k + 3]); } OnClick onClick = new OnClick(Engine.CharSkillBox_OnClick); button3 = new GTextButton((iSkill1 == -1) ? "Click Here" : Skills[iSkill1].Name, GetFont(9), Hues.Load(0x76b), Hues.Load(0x961), 0x113, 0xbf, onClick) { X = 0x112, Y = 0xd1 - button3.Height }; button3.SetTag("List", box); button3.SetTag("Skill", iSkill1); toAdd.Children.Add(button3); button4 = new GTextButton((iSkill2 == -1) ? "Click Here" : Skills[iSkill2].Name, GetFont(9), Hues.Load(0x76b), Hues.Load(0x961), 0x113, 0xbf, onClick) { X = 0x112, Y = 0xef - button4.Height }; button4.SetTag("List", box); button4.SetTag("Skill", iSkill2); toAdd.Children.Add(button4); button5 = new GTextButton((iSkill3 == -1) ? "Click Here" : Skills[iSkill3].Name, GetFont(9), Hues.Load(0x76b), Hues.Load(0x961), 0x113, 0xbf, onClick) { X = 0x112, Y = 0x10d - button5.Height }; button5.SetTag("List", box); button5.SetTag("Skill", iSkill3); toAdd.Children.Add(button5); toAdd.Children.Add(new GHotspot(270, 0xba, 0x69, 0x19, button3)); toAdd.Children.Add(new GHotspot(270, 0xd8, 0x69, 0x19, button4)); toAdd.Children.Add(new GHotspot(270, 0xf6, 0x69, 0x19, button5)); 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 button6 = new GButton(0x1589, 0x22b, 4, new OnClick(Engine.Quit_OnClick)) { Tooltip = new Tooltip(Strings.GetString("Tooltips.Quit")) }; Gumps.Desktop.Children.Add(button6); GButton button7 = new GButton(0x15a4, 610, 0x1bd, new OnClick(Engine.CharCreationSkillsArrow_OnClick)); button7.SetTag("Strength", labelArray[0]); button7.SetTag("Dexterity", labelArray[1]); button7.SetTag("Intelligence", labelArray[2]); button7.SetTag("vSkill1", labelArray[3]); button7.SetTag("vSkill2", labelArray[4]); button7.SetTag("vSkill3", labelArray[5]); button7.SetTag("iSkill1", button3); button7.SetTag("iSkill2", button4); button7.SetTag("iSkill3", button5); Gumps.Desktop.Children.Add(button7); Gumps.Desktop.Children.Add(toAdd); }
public static void ShowCharCreationProf() { Cursor.Hourglass = false; Gumps.Desktop.Children.Clear(); GBackground toAdd = new GBackground(0xa2c, 0x222, 0x160, 80, 80, true); toAdd.Children.Add(new GImage(0x58b, 0x42, -22)); toAdd.Children.Add(new GImage(0x589, 0x8e, -38)); toAdd.Children.Add(new GImage(0x1580, 0x97, -30)); toAdd.Children.Add(new GButton(0x119c, 120, 0x114, null)); toAdd.Children.Add(new GBackground(0xbbc, 0xcc, 0xd6, 40, 0x39, true)); int num = ((toAdd.UseHeight - 0x13c) + 1) / 2; num += toAdd.OffsetY; string[] strArray = new string[] { "Warrior", "Magician", "Blacksmith", "Advanced" }; int[] numArray = new int[] { 0x15c9, 0x15c1, 0x15b3, 0x15a9 }; int[] numArray2 = new int[] { 0x23, 0x23, 10, 0x19, 10, 0x2d, 60, 10, 10, 60, 10, 10 }; int[] numArray3 = new int[] { 50, 0x2d, 5, 50, 50, 0, 50, 0x2d, 5, 50, 50, 0 }; int[] numArray4 = new int[] { 0x1b, 0x11, 40, 0x19, 0x2e, 0x2b, 7, 0x25, 0x2d, -1, -1, -1 }; for (int i = 0; i < 4; i++) { GLabel label; GButton target = new GButton(numArray[i], numArray[i], numArray[i] + 1, 0x1ad, (num + (i * 0x4f)) + 8, new OnClick(Engine.Profession_OnClick)); target.SetTag("Strength", numArray2[i * 3]); target.SetTag("Dexterity", numArray2[(i * 3) + 1]); target.SetTag("Intelligence", numArray2[(i * 3) + 2]); target.SetTag("vSkill1", numArray3[i * 3]); target.SetTag("vSkill2", numArray3[(i * 3) + 1]); target.SetTag("vSkill3", numArray3[(i * 3) + 2]); target.SetTag("iSkill1", numArray4[i * 3]); target.SetTag("iSkill2", numArray4[(i * 3) + 1]); target.SetTag("iSkill3", numArray4[(i * 3) + 2]); toAdd.Children.Add(new GMouseRouter(0x589, 420, num + (i * 0x4f), target)); toAdd.Children.Add(target); label = new GLabel(strArray[i], GetFont(9), Hues.Load(0x76b), 0, 0) { X = 410 - label.Width, Y = (num + (i * 0x4f)) + ((80 - label.Height) / 2) }; toAdd.Children.Add(label); } Gumps.Desktop.Children.Add(new GBackground(0x588, ScreenWidth, ScreenHeight, false)); Gumps.Desktop.Children.Add(toAdd); Gumps.Desktop.Children.Add(new GImage(0x157c, 0, 0)); Gumps.Desktop.Children.Add(new GImage(0x15a0, 0, 4)); GButton button2 = new GButton(0x1589, 0x22b, 4, new OnClick(Engine.Quit_OnClick)) { Tooltip = new Tooltip(Strings.GetString("Tooltips.Quit")) }; Gumps.Desktop.Children.Add(button2); }
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); }
public static void City_OnClick(Gump Sender) { int tag = (int) Sender.GetTag("Strength"); int num2 = (int) Sender.GetTag("Dexterity"); int num3 = (int) Sender.GetTag("Intelligence"); int num4 = (int) Sender.GetTag("vSkill1"); int num5 = (int) Sender.GetTag("vSkill2"); int num6 = (int) Sender.GetTag("vSkill3"); int num7 = (int) Sender.GetTag("iSkill1"); int num8 = (int) Sender.GetTag("iSkill2"); int num9 = (int) Sender.GetTag("iSkill3"); int num10 = (int) Sender.GetTag("Skin Tone"); int num11 = (int) Sender.GetTag("Shirt Color"); int num12 = (int) Sender.GetTag("Pants Color"); int num13 = (int) Sender.GetTag("Hair Color"); int num14 = (int) Sender.GetTag("Facial Hair Color"); int num15 = (int) Sender.GetTag("CityID"); string name = (string) Sender.GetTag("Name"); int num16 = (int) Sender.GetTag("Gender"); if (((((((num4 + num5) + num6) == 100) && ((num7 != num8) && (num7 != num9))) && ((num8 != num9) && (((tag + num2) + num3) == 80))) && (((name != null) && (name.Length > 1)) && ((num15 >= 0) && (num15 < 9)))) && ((num16 >= 0) && (num16 <= 1))) { GLabel label; Cursor.Hourglass = true; int num17 = 0; for (int i = 0; i < 5; i++) { if ((m_CharacterNames[i] == null) || (m_CharacterNames[i].Length <= 0)) { num17 = i; break; } } Network.Send(new PCreateCharacter(name, (byte) num16, (byte) tag, (byte) num2, (byte) num3, (byte) num7, (byte) num4, (byte) num8, (byte) num5, (byte) num9, (byte) num6, (short) (num10 | 0x8000), 0x203b, (short) (num13 & 0x7fff), 0x2040, (short) (num14 & 0x7fff), (short) num15, (short) num17, Network.ClientIP, (short) (num11 & 0x7fff), (short) (num12 & 0x7fff))); if (Animations.IsLoading) { Gumps.Desktop.Children.Clear(); xGumps.Display("AnimationLoad"); do { DrawNow(); } while (!Animations.WaitLoading()); } Gumps.Desktop.Children.Clear(); GBackground toAdd = new GBackground(0xa2c, 0x164, 0xd4, 0x8e, 0x86, true); label = new GLabel("Entering Britannia..", GetFont(2), Hues.Load(0x75f), 0x74, 0x2a) { X = (toAdd.Width - label.Width) / 2 }; toAdd.Children.Add(label); toAdd.Children.Add(new GButton(0x47e, 0xa4, 170, null)); Gumps.Desktop.Children.Add(new GBackground(0x588, ScreenWidth, ScreenHeight, false)); Gumps.Desktop.Children.Add(toAdd); Gumps.Desktop.Children.Add(new GImage(0x157c, 0, 0)); Gumps.Desktop.Children.Add(new GImage(0x15a0, 0, 4)); GButton button = new GButton(0x1589, 0x22b, 4, new OnClick(Engine.Quit_OnClick)) { Tooltip = new Tooltip(Strings.GetString("Tooltips.Quit")) }; Gumps.Desktop.Children.Add(button); DrawNow(); } }
public static void MessageBoxOk(string Prompt, bool Modal, OnClick ClickHandler) { GBackground background = new GBackground(0xa2c, 0x164, 0xd4, 0x8e, 0x86, true); GButton toAdd = new GButton(0x481, 0xa4, 170, new OnClick(Gumps.MessageBoxOk_OnClick)); toAdd.SetTag("Dialog", background); toAdd.SetTag("ClickHandler", ClickHandler); GWrappedLabel label = new GWrappedLabel(Prompt, Engine.GetFont(1), Hues.Load(0x76b), background.OffsetX, background.OffsetY, (Engine.ScreenWidth / 2) - (background.OffsetX * 2)); background.Width = label.Width + (background.OffsetX * 2); background.Height = (label.Height + 10) + (background.OffsetY * 2); if (background.Width < 150) { background.Width = 150; } background.Center(); toAdd.X = (background.Width - toAdd.Width) / 2; toAdd.Y = background.Height - background.OffsetY; background.Children.Add(label); background.Children.Add(toAdd); if (Modal) { background.Modal = true; } background.m_CanDrag = true; background.m_QuickDrag = true; m_Desktop.Children.Add(background); }
private static bool Parse_Background(XmlTextReader xml, Gump Parent, string Name) { int backID = 0; int width = 0; int height = 0; int x = 0; int y = 0; bool hasBorder = false; bool flag2 = false; int @int = 0; int num7 = 0; int num8 = 0; int num9 = 0; int num10 = 0; int num11 = 0; int num12 = 0; int num13 = 0; int num14 = 0; bool isEmptyElement = xml.IsEmptyElement; while (xml.MoveToNextAttribute()) { switch (xml.Name) { case "GumpID": { backID = GetInt(xml.Value); continue; } case "GumpIDi": { backID = Convert.ToInt32(xml.Value); continue; } case "GumpIDh": { backID = Convert.ToInt32(xml.Value.Substring(2), 0x10); continue; } case "Width": { width = GetInt(xml.Value); continue; } case "Widthi": { width = Convert.ToInt32(xml.Value); continue; } case "Widthh": { width = Convert.ToInt32(xml.Value.Substring(2), 0x10); continue; } case "Height": { height = GetInt(xml.Value); continue; } case "Heighti": { height = Convert.ToInt32(xml.Value); continue; } case "Heighth": { height = 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 "Border": { hasBorder = GetBool(xml.Value); continue; } case "Borderb": { hasBorder = Convert.ToBoolean(xml.Value); continue; } case "G1": { @int = GetInt(xml.Value); flag2 = true; continue; } case "G1i": { @int = Convert.ToInt32(xml.Value); flag2 = true; continue; } case "G1h": { @int = Convert.ToInt32(xml.Value.Substring(2), 0x10); flag2 = true; continue; } case "G2": { num7 = GetInt(xml.Value); flag2 = true; continue; } case "G2i": { num7 = Convert.ToInt32(xml.Value); flag2 = true; continue; } case "G2h": { num7 = Convert.ToInt32(xml.Value.Substring(2), 0x10); flag2 = true; continue; } case "G3": { num8 = GetInt(xml.Value); flag2 = true; continue; } case "G3i": { num8 = Convert.ToInt32(xml.Value); flag2 = true; continue; } case "G3h": { num8 = Convert.ToInt32(xml.Value.Substring(2), 0x10); flag2 = true; continue; } case "G4": { num9 = GetInt(xml.Value); flag2 = true; continue; } case "G4i": { num9 = Convert.ToInt32(xml.Value); flag2 = true; continue; } case "G4h": { num9 = Convert.ToInt32(xml.Value.Substring(2), 0x10); flag2 = true; continue; } case "G5": { num10 = GetInt(xml.Value); flag2 = true; continue; } case "G5i": { num10 = Convert.ToInt32(xml.Value); flag2 = true; continue; } case "G5h": { num10 = Convert.ToInt32(xml.Value.Substring(2), 0x10); flag2 = true; continue; } case "G6": { num11 = GetInt(xml.Value); flag2 = true; continue; } case "G6i": { num11 = Convert.ToInt32(xml.Value); flag2 = true; continue; } case "G6h": { num11 = Convert.ToInt32(xml.Value.Substring(2), 0x10); flag2 = true; continue; } case "G7": { num12 = GetInt(xml.Value); flag2 = true; continue; } case "G7i": { num12 = Convert.ToInt32(xml.Value); flag2 = true; continue; } case "G7h": { num12 = Convert.ToInt32(xml.Value.Substring(2), 0x10); flag2 = true; continue; } case "G8": { num13 = GetInt(xml.Value); flag2 = true; continue; } case "G8i": { num13 = Convert.ToInt32(xml.Value); flag2 = true; continue; } case "G8h": { num13 = Convert.ToInt32(xml.Value.Substring(2), 0x10); flag2 = true; continue; } case "G9": { num14 = GetInt(xml.Value); flag2 = true; continue; } case "G9i": { num14 = Convert.ToInt32(xml.Value); flag2 = true; continue; } case "G9h": { num14 = Convert.ToInt32(xml.Value.Substring(2), 0x10); flag2 = true; continue; } } return false; } Gump toAdd = null; if (!flag2) { toAdd = new GBackground(backID, width, height, x, y, hasBorder); } else { toAdd = new GBackground(x, y, width, height, @int, num7, num8, num9, num10, num11, num12, num13, num14); } Parent.Children.Add(toAdd); 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, toAdd, Name)) { return false; } } return false; }