public GServerBackground(GServerGump owner, int x, int y, int width, int height, int gumpID, bool border) : base(gumpID, width, height, x, y, border) { this.m_Owner = owner; this.m_QuickDrag = true; this.m_CanDrag = owner.CanMove; }
public GServerImage(GServerGump owner, int x, int y, int gumpID, IHue hue) : base(gumpID, hue, x, y) { this.m_Owner = owner; this.m_QuickDrag = true; this.m_CanDrag = owner.CanMove; }
public GServerButton(GServerGump owner, LayoutEntry le) : base(le[2], le[2], le[3], le[0], le[1]) { this.m_Owner = owner; this.m_Type = le[4]; this.m_Param = le[5]; this.m_RelayID = le[6]; }
protected internal override void OnMouseUp(int x, int y, MouseButtons mb) { if ((mb & MouseButtons.Right) == MouseButtons.None || !this.m_Owner.CanClose) { return; } GServerGump.ClearCachedLocation(this.m_Owner.DialogID); Network.Send((Packet) new PGumpButton(this.m_Owner, 0)); Gumps.Destroy(this.m_Parent); }
public static Point3D ReverseLookup(int f, int xLong, int yLat, int xMins, int yMins, bool xEast, bool ySouth) { int xCenter; int yCenter; int xWidth; int yHeight; if (!GServerGump.ComputeMapDetails(f, 0, 0, out xCenter, out yCenter, out xWidth, out yHeight)) { return(new Point3D(0, 0, 0)); } double num1 = (double)xLong + (double)xMins / 60.0; double num2 = (double)yLat + (double)yMins / 60.0; if (!xEast) { num1 = 360.0 - num1; } if (!ySouth) { num2 = 360.0 - num2; } int x = xCenter + (int)(num1 * (double)xWidth / 360.0); int y = yCenter + (int)(num2 * (double)yHeight / 360.0); if (x < 0) { x += xWidth; } else if (x >= xWidth) { x -= xWidth; } if (y < 0) { y += yHeight; } else if (y >= yHeight) { y -= yHeight; } int z = 0; return(new Point3D(x, y, z)); }
public GVirtueItem(GServerGump owner, int x, int y, int gumpID, IHue hue) : base(owner, x, y, gumpID, hue) { this.m_QuickDrag = false; int num1 = hue.HueID() - 1; int num2 = -1; int num3 = 0; int index1 = 0; while (index1 < GVirtueItem.m_Table.Length) { if (GVirtueItem.m_Table[index1] == gumpID) { num2 = index1 / 4; for (int index2 = 1; index2 < 4; ++index2) { if (GVirtueItem.m_Table[index1 + index2] == num1) { num3 = index2; goto label_9; } } } index1 += 4; } label_9: if (num2 < 0) { return; } this.m_Title = new GAlphaBackground(30 - x, 40 - y, 0, 0); GLabel glabel = new GLabel(Localization.GetString(1051000 + num3 * 8 + num2), (IFont)Engine.GetUniFont(0), hue, 3, 3); this.m_Title.Children.Add((Gump)glabel); glabel.X -= glabel.Image.xMin; glabel.Y -= glabel.Image.yMin; this.m_Title.Width = glabel.Image.xMax - glabel.Image.xMin + 7; this.m_Title.Height = glabel.Image.yMax - glabel.Image.yMin + 7; Size size = Engine.m_Gumps.Measure(104); this.m_Title.X += (size.Width - this.m_Title.Width) / 2; this.m_Title.Y += (size.Height - this.m_Title.Height) / 2; this.m_Title.Visible = false; this.m_Children.Add((Gump)this.m_Title); }
protected override void OnClicked() { switch (this.m_Type) { case 0: this.m_Owner.Page = this.m_Param; break; case 1: case 4: if (this.m_RelayID != 0) { GServerGump.SetCachedLocation(this.m_Owner.DialogID, this.m_Owner.X, this.m_Owner.Y); } Network.Send((Packet) new PGumpButton(this.m_Owner, this.m_RelayID)); Gumps.Destroy(this.m_Parent); break; } }
public PGumpButton(GServerGump gump, int buttonID) : base((byte)177) { this.m_Stream.Write(gump.Serial); this.m_Stream.Write(gump.DialogID); this.m_Stream.Write(buttonID); ArrayList dataStore1 = Engine.GetDataStore(); ArrayList dataStore2 = Engine.GetDataStore(); Gump[] array = gump.Children.ToArray(); for (int index = 0; index < array.Length; ++index) { if (array[index] is IRelayedSwitch) { IRelayedSwitch relayedSwitch = (IRelayedSwitch)array[index]; if (relayedSwitch.Active) { dataStore1.Add((object)relayedSwitch.RelayID); } } else if (array[index] is GServerTextBox) { dataStore2.Add((object)array[index]); } } this.m_Stream.Write(dataStore1.Count); for (int index = 0; index < dataStore1.Count; ++index) { this.m_Stream.Write((int)dataStore1[index]); } this.m_Stream.Write(dataStore2.Count); for (int index = 0; index < dataStore2.Count; ++index) { GServerTextBox gserverTextBox = (GServerTextBox)dataStore2[index]; this.m_Stream.Write((short)gserverTextBox.RelayID); this.m_Stream.Write((short)gserverTextBox.String.Length); this.m_Stream.WriteUnicode(gserverTextBox.String); } Engine.ReleaseDataStore(dataStore2); Engine.ReleaseDataStore(dataStore1); }
public GServerCheckBox(GServerGump owner, LayoutEntry le) : base(le[2], le[3], le[4] != 0, le[0], le[1]) { this.m_Owner = owner; this.m_RelayID = le[5]; }