public GItemList(int serial, int menuID, string question, AnswerEntry[] answers) : base(0x910, 0x19, 0x19) { this.m_xLast = -1234; this.m_yLast = -1234; this.m_Serial = serial; this.m_MenuID = menuID; this.m_EntryLabel = new GLabel("", Engine.GetFont(1), Hues.Load(0x75f), 0x27, 0x6a); base.m_Children.Add(this.m_EntryLabel); GLabel toAdd = new GLabel(question, Engine.GetFont(1), Hues.Load(0x75f), 0x27, 0x13); toAdd.Scissor(0, 0, 0xda, 11); base.m_Children.Add(toAdd); int x = 0x25; for (int i = 0; i < answers.Length; i++) { GItemListEntry entry = new GItemListEntry(x, answers[i], this); base.m_Children.Add(entry); x += entry.Width; } x -= 0x25; if (x >= 0xde) { this.m_xOffsetCap = -(x - 0xde); this.m_Left = new GItemListScroller(0x17, this, 150); this.m_Right = new GItemListScroller(0x105, this, -150); base.m_Children.Add(this.m_Left); base.m_Children.Add(this.m_Right); } }
private void ProcessLayout(LayoutEntry[] list, string[] text) { int page = 0; int num2 = 0; bool flag = false; for (int i = 0; i < list.Length; i++) { string str; IHue hue; int num5; string str3; int num6; IFont uniFont; GLabel label; object obj2; LayoutEntry le = list[i]; if (((obj2 = le.Name) != null) && ((obj2 = < PrivateImplementationDetails >.$$method0x60000f4 - 1[obj2]) != null)) { switch (((int)obj2)) { case 0: case 1: { continue; } case 2: goto Label_020B; case 3: goto Label_0243; case 4: { this.m_CanClose = false; continue; } case 5: { this.m_CanMove = false; continue; } case 6: { this.Pages(page).Add(new GServerBackground(this, le[0], le[1], le[3], le[4], le[2] + 4, true)); continue; } case 7: { this.Pages(page).Add(new GServerBackground(this, le[0], le[1], le[2], le[3], le[4], false)); continue; } case 8: goto Label_0301; case 9: { this.Pages(page).Add(new GServerTextBox(text[le[6]], le)); continue; } case 10: { this.Pages(page).Add(new GItemArt(le[0], le[1], le[2])); continue; } case 11: { this.Pages(page).Add(new GServerButton(this, le)); continue; } case 12: { this.Pages(page).Add(new GServerRadio(this, le)); continue; } case 13: { this.Pages(page).Add(new GServerCheckBox(this, le)); continue; } case 14: { int num4 = le[2]; this.Pages(page).Add(new GLabel(text[le[3]], Engine.GetUniFont(1), Hues.Load(num4 + 1), le[0] - 1, le[1])); continue; } case 15: num5 = le[4]; str3 = text[le[5]]; num6 = le[2]; uniFont = Engine.GetUniFont(1); if (uniFont.GetStringWidth(str3) <= num6) { goto Label_051A; } goto Label_04EB; case 0x10: { this.ProcessHtmlGump(page, le[0], le[1], le[2], le[3], Localization.GetString(le[4]), le[5] != 0, le[6] != 0, ((le[5] == 0) && (le[6] != 0)) ? 0xffffff : 0); continue; } case 0x11: { this.ProcessHtmlGump(page, le[0], le[1], le[2], le[3], Localization.GetString(le[4]), le[5] != 0, le[6] != 0, Engine.C16232(le[7])); continue; } case 0x12: { this.ProcessHtmlGump(page, le[0], le[1], le[2], le[3], text[le[4]], le[5] != 0, le[6] != 0, ((le[5] == 0) && (le[6] != 0)) ? 0xffffff : 0); continue; } } } goto Label_06A2; Label_020B: this.Pages(page).Add(new GTransparentRegion(this, le[0], le[1], le[2], le[3])); continue; Label_0243: page = le[0]; if (page == 0) { flag = false; num2 = 0; } else if (!flag || (page < num2)) { num2 = page; flag = true; } continue; Label_0301: str = le.GetAttribute("hue"); if (str != null) { try { hue = Hues.Load(Convert.ToInt32(str) + 1); } catch { hue = Hues.Default; } } else { hue = Hues.Default; } if (le.GetAttribute("class") == "VirtueGumpItem") { this.Pages(page).Add(new GVirtueItem(this, le[0], le[1], le[2], hue)); } else { this.Pages(page).Add(new GServerImage(this, le[0], le[1], le[2], hue)); } continue; Label_04D8: str3 = str3.Substring(0, str3.Length - 1); Label_04EB: if ((str3.Length > 0) && (uniFont.GetStringWidth(str3 + "...") > num6)) { goto Label_04D8; } str3 = str3 + "..."; Label_051A: label = new GLabel(str3, uniFont, Hues.Load(num5 + 1), le[0] - 1, le[1]); label.Scissor(0, 0, num6, le[3]); this.Pages(page).Add(label); continue; Label_06A2: Engine.AddTextMessage(le.Name); } this.Page = (num2 == 0) ? 1 : num2; }
private void ProcessLayout(LayoutEntry[] list, string[] text) { int page = 0; int num2 = 0; bool flag = false; for (int i = 0; i < list.Length; i++) { string str; IHue hue; int num5; string str3; int num6; IFont uniFont; GLabel label; object obj2; LayoutEntry le = list[i]; if (((obj2 = le.Name) != null) && ((obj2 = <PrivateImplementationDetails>.$$method0x60000f4-1[obj2]) != null)) { switch (((int) obj2)) { case 0: case 1: { continue; } case 2: goto Label_020B; case 3: goto Label_0243; case 4: { this.m_CanClose = false; continue; } case 5: { this.m_CanMove = false; continue; } case 6: { this.Pages(page).Add(new GServerBackground(this, le[0], le[1], le[3], le[4], le[2] + 4, true)); continue; } case 7: { this.Pages(page).Add(new GServerBackground(this, le[0], le[1], le[2], le[3], le[4], false)); continue; } case 8: goto Label_0301; case 9: { this.Pages(page).Add(new GServerTextBox(text[le[6]], le)); continue; } case 10: { this.Pages(page).Add(new GItemArt(le[0], le[1], le[2])); continue; } case 11: { this.Pages(page).Add(new GServerButton(this, le)); continue; } case 12: { this.Pages(page).Add(new GServerRadio(this, le)); continue; } case 13: { this.Pages(page).Add(new GServerCheckBox(this, le)); continue; } case 14: { int num4 = le[2]; this.Pages(page).Add(new GLabel(text[le[3]], Engine.GetUniFont(1), Hues.Load(num4 + 1), le[0] - 1, le[1])); continue; } case 15: num5 = le[4]; str3 = text[le[5]]; num6 = le[2]; uniFont = Engine.GetUniFont(1); if (uniFont.GetStringWidth(str3) <= num6) { goto Label_051A; } goto Label_04EB; case 0x10: { this.ProcessHtmlGump(page, le[0], le[1], le[2], le[3], Localization.GetString(le[4]), le[5] != 0, le[6] != 0, ((le[5] == 0) && (le[6] != 0)) ? 0xffffff : 0); continue; } case 0x11: { this.ProcessHtmlGump(page, le[0], le[1], le[2], le[3], Localization.GetString(le[4]), le[5] != 0, le[6] != 0, Engine.C16232(le[7])); continue; } case 0x12: { this.ProcessHtmlGump(page, le[0], le[1], le[2], le[3], text[le[4]], le[5] != 0, le[6] != 0, ((le[5] == 0) && (le[6] != 0)) ? 0xffffff : 0); continue; } } } goto Label_06A2; Label_020B: this.Pages(page).Add(new GTransparentRegion(this, le[0], le[1], le[2], le[3])); continue; Label_0243: page = le[0]; if (page == 0) { flag = false; num2 = 0; } else if (!flag || (page < num2)) { num2 = page; flag = true; } continue; Label_0301: str = le.GetAttribute("hue"); if (str != null) { try { hue = Hues.Load(Convert.ToInt32(str) + 1); } catch { hue = Hues.Default; } } else { hue = Hues.Default; } if (le.GetAttribute("class") == "VirtueGumpItem") { this.Pages(page).Add(new GVirtueItem(this, le[0], le[1], le[2], hue)); } else { this.Pages(page).Add(new GServerImage(this, le[0], le[1], le[2], hue)); } continue; Label_04D8: str3 = str3.Substring(0, str3.Length - 1); Label_04EB: if ((str3.Length > 0) && (uniFont.GetStringWidth(str3 + "...") > num6)) { goto Label_04D8; } str3 = str3 + "..."; Label_051A: label = new GLabel(str3, uniFont, Hues.Load(num5 + 1), le[0] - 1, le[1]); label.Scissor(0, 0, num6, le[3]); this.Pages(page).Add(label); continue; Label_06A2: Engine.AddTextMessage(le.Name); } this.Page = (num2 == 0) ? 1 : num2; }