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); }
public GQuickHues(GHuePicker Picker, GBrightnessBar Brightness, GFlatButton Okay) : base(3, 0x57, 0x76, 20) { this.m_CompactHeight = 20; this.m_ExpandedHeight = Engine.GameHeight / 2; this.m_Picker = Picker; this.m_Brightness = Brightness; this.m_Okay = Okay; base.m_CanDrag = false; this.m_Timer = new Timer(new OnTick(this.Roll_OnTick), 0); GLabel toAdd = new GLabel("Quick Hues", Engine.GetUniFont(0), Hues.Default, 2, 2); this.Height = 20; this.m_CompactHeight = base.m_Height; base.m_Children.Add(toAdd); toAdd.Center(); QuickHues.Load(); int count = QuickHues.Entries.Count; int num2 = 0x16; Clipper clipper = new Clipper(base.m_X + 1, base.m_Y + 1, base.m_Width - 2, base.m_Height - 2); GTextButton button = new GTextButton("Create new..", Engine.GetUniFont(0), Hues.Default, Hues.Load(0x35), 2, 2, new OnClick(this.Add_OnClick)); base.m_Children.Add(button); button.Center(); button.Y = num2; button.Scissor(clipper); num2 += button.Height; OnClick onClick = new OnClick(this.Entry_OnClick); OnHighlight highlight = new OnHighlight(this.Entry_OnHighlight); for (int i = 0; i < count; i++) { QuickHueEntry entry = (QuickHueEntry)QuickHues.Entries[i]; GTextButton button2 = new GTextButton(entry.Name, Engine.GetUniFont(0), Hues.Load(0x58), Hues.Load(0x35), 2, 2, onClick); base.m_Children.Add(button2); button2.Center(); button2.Y = num2; button2.Scissor(clipper); button2.SetTag("HueID", entry.Hue); button2.SetTag("Index", i); num2 += button2.Height; button2.OnHighlight = highlight; button2.Tooltip = new Tooltip(string.Format("0x{0:X}", entry.Hue)); } num2 += 2; this.m_ExpandedHeight = num2; }
public GQuickHues(GHuePicker Picker, GBrightnessBar Brightness, GFlatButton Okay) : base(3, 0x57, 0x76, 20) { this.m_CompactHeight = 20; this.m_ExpandedHeight = Engine.GameHeight / 2; this.m_Picker = Picker; this.m_Brightness = Brightness; this.m_Okay = Okay; base.m_CanDrag = false; this.m_Timer = new Timer(new OnTick(this.Roll_OnTick), 0); GLabel toAdd = new GLabel("Quick Hues", Engine.GetUniFont(0), Hues.Default, 2, 2); this.Height = 20; this.m_CompactHeight = base.m_Height; base.m_Children.Add(toAdd); toAdd.Center(); QuickHues.Load(); int count = QuickHues.Entries.Count; int num2 = 0x16; Clipper clipper = new Clipper(base.m_X + 1, base.m_Y + 1, base.m_Width - 2, base.m_Height - 2); GTextButton button = new GTextButton("Create new..", Engine.GetUniFont(0), Hues.Default, Hues.Load(0x35), 2, 2, new OnClick(this.Add_OnClick)); base.m_Children.Add(button); button.Center(); button.Y = num2; button.Scissor(clipper); num2 += button.Height; OnClick onClick = new OnClick(this.Entry_OnClick); OnHighlight highlight = new OnHighlight(this.Entry_OnHighlight); for (int i = 0; i < count; i++) { QuickHueEntry entry = (QuickHueEntry) QuickHues.Entries[i]; GTextButton button2 = new GTextButton(entry.Name, Engine.GetUniFont(0), Hues.Load(0x58), Hues.Load(0x35), 2, 2, onClick); base.m_Children.Add(button2); button2.Center(); button2.Y = num2; button2.Scissor(clipper); button2.SetTag("HueID", entry.Hue); button2.SetTag("Index", i); num2 += button2.Height; button2.OnHighlight = highlight; button2.Tooltip = new Tooltip(string.Format("0x{0:X}", entry.Hue)); } num2 += 2; this.m_ExpandedHeight = num2; }
public GCombatGump() : base(0x2b02, 50, 50) { AbilityInfo[] abilities = AbilityInfo.Abilities; AbilityInfo active = AbilityInfo.Active; AbilityInfo primary = AbilityInfo.Primary; AbilityInfo secondary = AbilityInfo.Secondary; IFont uniFont = Engine.GetUniFont(1); OnClick onClick = new OnClick(this.Name_OnClick); GLabel toAdd = new GLabel("INDEX", Engine.GetFont(6), Hues.Default, 100, 4); base.m_Children.Add(toAdd); toAdd = new GLabel("INDEX", Engine.GetFont(6), Hues.Default, 0x106, 4); base.m_Children.Add(toAdd); for (int i = 0; i < abilities.Length; i++) { AbilityInfo a = abilities[i]; IHue hueFor = GetHueFor(a); toAdd = new GTextButton(Localization.GetString(a.Name), uniFont, hueFor, hueFor, 0x38 + ((i / 9) * 0xa2), 0x26 + ((i % 9) * 15), onClick); a.NameLabel = (GTextButton)toAdd; toAdd.SetTag("Ability", a); toAdd.Tooltip = new Tooltip(Localization.GetString(a.Tooltip), true, 240); toAdd.Tooltip.Delay = 0.25f; base.m_Children.Add(toAdd); } this.m_PrimaryIcon = new GAbilityIcon(true, true, primary.Icon, 0xda, 0x69); this.m_PrimaryIcon.Tooltip = new Tooltip(Localization.GetString(primary.Name), true); this.m_PrimaryIcon.Tooltip.Delay = 0.25f; this.m_PrimaryIcon.Hue = (primary == AbilityInfo.Active) ? Hues.Load(0x8026) : Hues.Default; base.m_Children.Add(this.m_PrimaryIcon); toAdd = new GLabel("Primary", Engine.GetFont(6), Hues.Default, 0x10c, 0x69); base.m_Children.Add(toAdd); toAdd = new GLabel("Ability Icon", Engine.GetFont(6), Hues.Default, 0x10c, 0x77); base.m_Children.Add(toAdd); this.m_SecondaryIcon = new GAbilityIcon(true, false, secondary.Icon, 0xda, 150); this.m_SecondaryIcon.Tooltip = new Tooltip(Localization.GetString(secondary.Name), true); this.m_SecondaryIcon.Tooltip.Delay = 0.25f; this.m_SecondaryIcon.Hue = (secondary == AbilityInfo.Active) ? Hues.Load(0x8026) : Hues.Default; base.m_Children.Add(this.m_SecondaryIcon); toAdd = new GLabel("Secondary", Engine.GetFont(6), Hues.Default, 0x10c, 150); base.m_Children.Add(toAdd); toAdd = new GLabel("Ability Icon", Engine.GetFont(6), Hues.Default, 0x10c, 0xa4); base.m_Children.Add(toAdd); }
public GCombatGump() : base(0x2b02, 50, 50) { AbilityInfo[] abilities = AbilityInfo.Abilities; AbilityInfo active = AbilityInfo.Active; AbilityInfo primary = AbilityInfo.Primary; AbilityInfo secondary = AbilityInfo.Secondary; IFont uniFont = Engine.GetUniFont(1); OnClick onClick = new OnClick(this.Name_OnClick); GLabel toAdd = new GLabel("INDEX", Engine.GetFont(6), Hues.Default, 100, 4); base.m_Children.Add(toAdd); toAdd = new GLabel("INDEX", Engine.GetFont(6), Hues.Default, 0x106, 4); base.m_Children.Add(toAdd); for (int i = 0; i < abilities.Length; i++) { AbilityInfo a = abilities[i]; IHue hueFor = GetHueFor(a); toAdd = new GTextButton(Localization.GetString(a.Name), uniFont, hueFor, hueFor, 0x38 + ((i / 9) * 0xa2), 0x26 + ((i % 9) * 15), onClick); a.NameLabel = (GTextButton) toAdd; toAdd.SetTag("Ability", a); toAdd.Tooltip = new Tooltip(Localization.GetString(a.Tooltip), true, 240); toAdd.Tooltip.Delay = 0.25f; base.m_Children.Add(toAdd); } this.m_PrimaryIcon = new GAbilityIcon(true, true, primary.Icon, 0xda, 0x69); this.m_PrimaryIcon.Tooltip = new Tooltip(Localization.GetString(primary.Name), true); this.m_PrimaryIcon.Tooltip.Delay = 0.25f; this.m_PrimaryIcon.Hue = (primary == AbilityInfo.Active) ? Hues.Load(0x8026) : Hues.Default; base.m_Children.Add(this.m_PrimaryIcon); toAdd = new GLabel("Primary", Engine.GetFont(6), Hues.Default, 0x10c, 0x69); base.m_Children.Add(toAdd); toAdd = new GLabel("Ability Icon", Engine.GetFont(6), Hues.Default, 0x10c, 0x77); base.m_Children.Add(toAdd); this.m_SecondaryIcon = new GAbilityIcon(true, false, secondary.Icon, 0xda, 150); this.m_SecondaryIcon.Tooltip = new Tooltip(Localization.GetString(secondary.Name), true); this.m_SecondaryIcon.Tooltip.Delay = 0.25f; this.m_SecondaryIcon.Hue = (secondary == AbilityInfo.Active) ? Hues.Load(0x8026) : Hues.Default; base.m_Children.Add(this.m_SecondaryIcon); toAdd = new GLabel("Secondary", Engine.GetFont(6), Hues.Default, 0x10c, 150); base.m_Children.Add(toAdd); toAdd = new GLabel("Ability Icon", Engine.GetFont(6), Hues.Default, 0x10c, 0xa4); base.m_Children.Add(toAdd); }
private GContextMenu(object owner, PopupEntry[] list) : base(100, 100) { this.m_VertexPool = VertexConstructor.Create(); this.m_Owner = owner; base.m_GUID = "MobilePopup"; int num = 0; int num2 = 0; int length = list.Length; IFont uniFont = Engine.GetUniFont(3); IHue bright = Hues.Bright; IHue focusHue = Hues.Load(0x35); IHue hue = Hues.Default; OnClick onClick = new OnClick(this.Entry_OnClick); for (int i = 0; i < length; i++) { PopupEntry entry = list[i]; GLabel toAdd = null; if (entry.Flags == 1) { toAdd = new GLabel(entry.Text, uniFont, hue, 7, 7 + num2); } else { toAdd = new GTextButton(entry.Text, uniFont, bright, focusHue, 7, 7 + num2, onClick); toAdd.SetTag("EntryID", entry.EntryID); } toAdd.X -= toAdd.Image.xMin; toAdd.Y -= toAdd.Image.yMin; num2 += (toAdd.Image.yMax - toAdd.Image.yMin) + 4; if (((toAdd.Image.xMax - toAdd.Image.xMin) + 1) > num) { num = (toAdd.Image.xMax - toAdd.Image.xMin) + 1; } base.m_Children.Add(toAdd); } num2 -= 3; this.m_Width = num + 14; this.m_Height = num2 + 14; }
public GQuickLogin() : base(0, 0, 200, 20) { this.m_CompactHeight = 20; this.m_ExpandedHeight = Engine.GameHeight / 2; base.m_CanDrag = false; this.m_Timer = new Timer(new OnTick(this.Roll_OnTick), 0); GLabel toAdd = new GLabel("Quick Login", Engine.GetUniFont(0), Hues.Default, 2, 2); this.Height = toAdd.Height + 4; this.m_CompactHeight = base.m_Height; base.m_Children.Add(toAdd); toAdd.Center(); QuickLogin.Load(); int count = QuickLogin.Entries.Count; if (count == 0) { base.Visible = false; } else { if (count > 12) { count = 12; } int num2 = (2 + toAdd.Height) + 4; if (count == 0) { num2 -= 2; } OnClick onClick = new OnClick(Engine.QuickLogin_OnClick); Clipper clipper = new Clipper(base.m_X + 1, base.m_Y + 1, base.m_Width - 2, base.m_Height - 2); for (int i = 0; i < count; i++) { Entry entry = (Entry)QuickLogin.Entries[i]; GTextButton button = new GTextButton(entry.CharName, Engine.GetUniFont(0), Hues.Load(0x58), Hues.Load(0x35), 2, 2, onClick); base.m_Children.Add(button); button.Center(); button.Y = num2; button.Scissor(clipper); button.SetTag("Index", i); num2 += button.Height; int num4 = 0; bool flag = false; for (int j = 0; j < count; j++) { Entry entry2 = (Entry)QuickLogin.Entries[j]; if (entry2.CharName == entry.CharName) { if (j <= i) { num4++; } if (j != i) { flag = true; } } } if (flag) { button.Tooltip = new Tooltip(string.Format("{0}\n{1}", num4, entry.ServerName)); } else { button.Tooltip = new Tooltip(entry.ServerName); } } if (count != 0) { num2 += 2; } if (num2 > 480) { num2 = 480; } this.m_ExpandedHeight = num2; } }
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 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); }
public GQuickLogin() : base(0, 0, 200, 20) { this.m_CompactHeight = 20; this.m_ExpandedHeight = Engine.GameHeight / 2; base.m_CanDrag = false; this.m_Timer = new Timer(new OnTick(this.Roll_OnTick), 0); GLabel toAdd = new GLabel("Quick Login", Engine.GetUniFont(0), Hues.Default, 2, 2); this.Height = toAdd.Height + 4; this.m_CompactHeight = base.m_Height; base.m_Children.Add(toAdd); toAdd.Center(); QuickLogin.Load(); int count = QuickLogin.Entries.Count; if (count == 0) { base.Visible = false; } else { if (count > 12) { count = 12; } int num2 = (2 + toAdd.Height) + 4; if (count == 0) { num2 -= 2; } OnClick onClick = new OnClick(Engine.QuickLogin_OnClick); Clipper clipper = new Clipper(base.m_X + 1, base.m_Y + 1, base.m_Width - 2, base.m_Height - 2); for (int i = 0; i < count; i++) { Entry entry = (Entry) QuickLogin.Entries[i]; GTextButton button = new GTextButton(entry.CharName, Engine.GetUniFont(0), Hues.Load(0x58), Hues.Load(0x35), 2, 2, onClick); base.m_Children.Add(button); button.Center(); button.Y = num2; button.Scissor(clipper); button.SetTag("Index", i); num2 += button.Height; int num4 = 0; bool flag = false; for (int j = 0; j < count; j++) { Entry entry2 = (Entry) QuickLogin.Entries[j]; if (entry2.CharName == entry.CharName) { if (j <= i) { num4++; } if (j != i) { flag = true; } } } if (flag) { button.Tooltip = new Tooltip(string.Format("{0}\n{1}", num4, entry.ServerName)); } else { button.Tooltip = new Tooltip(entry.ServerName); } } if (count != 0) { num2 += 2; } if (num2 > 480) { num2 = 480; } this.m_ExpandedHeight = num2; } }