public GPropertyEntry(object obj, ObjectEditorEntry entry) : base(0, 0, 0x117, 0x16) { IFont uniFont; this.m_Object = obj; this.m_Entry = entry; base.m_NonRestrictivePicking = true; this.m_NameBack = new GAlphaBackground(0, 0, 140, 0x16); this.m_NameBack.FillColor = GumpColors.Window; this.m_NameBack.FillAlpha = 1f; this.m_NameBack.DrawBorder = false; this.m_NameBack.ShouldHitTest = false; base.m_Children.Add(this.m_NameBack); this.m_ValueBack = new GAlphaBackground(0x8b, 0, 140, 0x16); this.m_ValueBack.FillColor = GumpColors.Window; this.m_ValueBack.FillAlpha = 1f; this.m_ValueBack.BorderColor = GumpColors.Control; this.m_ValueBack.ShouldHitTest = false; this.m_ValueBack.DrawBorder = false; base.m_Children.Add(this.m_ValueBack); this.m_Name = new GLabel(entry.Optionable.Name, Engine.GetUniFont(2), GumpHues.WindowText, 0, 0); this.m_Name.X = 5 - this.m_Name.Image.xMin; this.m_Name.Y = ((0x16 - ((this.m_Name.Image.yMax - this.m_Name.Image.yMin) + 1)) / 2) - this.m_Name.Image.yMin; this.m_NameBack.Children.Add(this.m_Name); object val = entry.Property.GetValue(obj, null); string valString = this.GetValString(val); if ((val is ValueType) ? val.Equals(entry.Optionable.Default) : object.ReferenceEquals(val, entry.Optionable.Default)) { uniFont = Engine.GetUniFont(2); } else { uniFont = Engine.GetUniFont(1); } this.m_Value = new GLabel(valString, uniFont, GumpHues.WindowText, 0, 0); if (entry.Hue != null) { GAlphaBackground toAdd = new GAlphaBackground(4, 4, 0x16, 14) { FillColor = Engine.C16232(Hues.Load((int)val).Pixel(0xffff)), FillAlpha = 1f, ShouldHitTest = false }; this.m_ValueBack.Children.Add(toAdd); this.m_Value.Text = "Hue"; this.m_Value.X = 30 - this.m_Value.Image.xMin; this.m_Value.Y = ((0x16 - ((this.m_Value.Image.yMax - this.m_Value.Image.yMin) + 1)) / 2) - this.m_Value.Image.yMin; this.m_Hue = toAdd; } else { this.m_Value.X = 5 - this.m_Value.Image.xMin; this.m_Value.Y = ((0x16 - ((this.m_Value.Image.yMax - this.m_Value.Image.yMin) + 1)) / 2) - this.m_Value.Image.yMin; } this.m_ValueBack.Children.Add(this.m_Value); }
public void SetValue(object val) { IFont uniFont; this.m_Entry.Property.SetValue(this.m_Object, val, null); if ((val is ValueType) ? val.Equals(this.m_Entry.Optionable.Default) : object.ReferenceEquals(val, this.m_Entry.Optionable.Default)) { uniFont = Engine.GetUniFont(2); } else { uniFont = Engine.GetUniFont(1); } if (this.m_Hue == null) { this.m_Value.Text = this.GetValString(val); } else { this.m_Hue.FillColor = Engine.C16232(Hues.Load((int)val).Pixel(0xffff)); } this.m_Value.Font = uniFont; }
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; }