/// <summary> /// Get the GumpElement with the specified ID. Searches all pages/elements. /// </summary> /// <returns>True on success.</returns> public bool GetElementByID(int ID, out GumpElement element) { if (this.GumpElements != null) { foreach (GumpElement ge in this.GumpElements) { if (ge.ElementID == ID) { element = ge; return(true); } } } if (this.Pages != null) { foreach (GumpPage p in this.Pages) { foreach (GumpElement ge in p.GumpElements) { if (ge.ElementID == ID) { element = ge; return(true); } } } } element = null; return(false); }
/// <summary> /// Get nearest GumpElement from source. /// </summary> /// <returns>True on success.</returns> public bool GetNearestElement(GumpElement source, out GumpElement element) { GumpElement nearest = null; double closest = 0, distance; foreach (GumpElement ge in myGumpElements) { if (ge == source) { continue; } distance = UOMath.Distance(source.X, source.Y, ge.X, ge.Y); if (nearest == null) { closest = distance; nearest = ge; } else { if (distance < closest) { closest = distance; nearest = ge; } } } element = nearest; return(nearest != null); }
public void AddItemProperty(int serial) { GumpElement ge = new GumpElement(); ge.Type = ElementType.itemproperty; ge.Serial = serial; Add(ge); }
public void AddTooltip(int number) { GumpElement ge = new GumpElement(); ge.Type = ElementType.tooltip; ge.Cliloc = number; Add(ge); }
public void AddGroup(int group) { GumpElement ge = new GumpElement(); ge.Type = ElementType.group; ge.Group = group; Add(ge); }
public void AddPage(int page) { GumpElement ge = new GumpElement(); ge.Type = ElementType.page; ge.PageNumber = page; Add(ge); }
/// <summary> /// Get nearest GumpElement, but only if it's ElementType is contained in the include list. /// </summary> /// <param name="includeTypes">Array of ElementTypes which specifies valid GumpElements to search.</param> /// <returns>True on success.</returns> public bool GetNearestElement(ElementType[] includeTypes, out GumpElement element) { if (myParentPage != null) { return(myParentPage.GetNearestElement(this, includeTypes, out element)); } element = null; return(false); }
public void AddItem(int x, int y, int itemID) { GumpElement ge = new GumpElement(); ge.Type = ElementType.tilepic; ge.X = x; ge.Y = y; ge.ItemID = itemID; Add(ge); }
public void AddImage(int x, int y, int gumpID, int hue) { GumpElement ge = new GumpElement(); ge.Type = ElementType.gumppic; ge.X = x; ge.Y = y; ge.ElementID = gumpID; ge.Hue = hue; Add(ge); }
public void AddAlphaRegion(int x, int y, int width, int height) { GumpElement ge = new GumpElement(); ge.Type = ElementType.checkertrans; ge.X = x; ge.Y = y; ge.Width = width; ge.Height = height; Add(ge); }
public void AddLabel(int x, int y, int hue, string text) { GumpElement ge = new GumpElement(); ge.Type = ElementType.text; ge.X = x; ge.Y = y; ge.Hue = hue; ge.Text = text; Add(ge); }
public void AddImageTiled(int x, int y, int width, int height, int gumpID) { GumpElement ge = new GumpElement(); ge.Type = ElementType.gumppictiled; ge.X = x; ge.Y = y; ge.Width = width; ge.Height = height; ge.ElementID = gumpID; Add(ge); }
public void AddBackground(int x, int y, int width, int height, int gumpID) { GumpElement ge = new GumpElement(); ge.Type = ElementType.resizepic; ge.X = x; ge.Y = y; ge.Width = width; ge.Height = height; ge.ElementID = gumpID; Add(ge); }
public void AddRadio(int x, int y, int inactiveID, int activeID, bool initialState, int switchID) { GumpElement ge = new GumpElement(); ge.Type = ElementType.radio; ge.X = x; ge.Y = y; ge.InactiveID = inactiveID; ge.ActiveID = activeID; ge.InitialState = initialState; ge.ElementID = switchID; Add(ge); }
public void AddLabelCropped(int x, int y, int width, int height, int hue, string text) { GumpElement ge = new GumpElement(); ge.Type = ElementType.croppedtext; ge.X = x; ge.Y = y; ge.Width = width; ge.Height = height; ge.Hue = hue; ge.Text = text; Add(ge); }
public void AddButton(int x, int y, int normalID, int pressedID, int buttonID, GumpButtonType type, int param) { GumpElement ge = new GumpElement(); ge.Type = ElementType.button; ge.X = x; ge.Y = y; ge.InactiveID = normalID; ge.ActiveID = pressedID; ge.ButtonType = (int)type; ge.ElementID = buttonID; ge.Param = param; Add(ge); }
public void AddHtml(int x, int y, int width, int height, string text, bool background, bool scrollbar) { GumpElement ge = new GumpElement(); ge.Type = ElementType.htmlgump; ge.X = x; ge.Y = y; ge.Width = width; ge.Height = height; ge.Text = text; ge.ScrollBar = scrollbar; ge.Background = background; Add(ge); }
public void AddTextEntry(int x, int y, int width, int height, int hue, int entryID, string initialText) { GumpElement ge = new GumpElement(); ge.Type = ElementType.textentry; ge.X = x; ge.Y = y; ge.Width = width; ge.Height = height; ge.Hue = hue; ge.ElementID = entryID; ge.Text = initialText; Add(ge); }
public void AddHtmlLocalized(int x, int y, int width, int height, int number, bool background, bool scrollbar) { GumpElement ge = new GumpElement(); ge.Type = ElementType.xmfhtmlgump; ge.X = x; ge.Y = y; ge.Width = width; ge.Height = height; ge.Cliloc = number; ge.Background = background; ge.ScrollBar = scrollbar; Add(ge); }
/// <summary> /// Get nearest GumpElement to source, but only if it's ElementType is contained in the include list. /// </summary> /// <param name="source">Source GumpElement</param> /// <param name="includeTypes">Array of ElementTypes which specifies valid GumpElements to search.</param> /// <param name="element">GumpElement (out).</param> /// <returns>True on success.</returns> public bool GetNearestElement(GumpElement source, ElementType[] includeTypes, out GumpElement element) { GumpElement nearest = null; double closest = 0, distance; if (source.ParentPage != null) { return(source.ParentPage.GetNearestElement(source, includeTypes, out element)); } bool found; foreach (GumpElement ge in this.GumpElements) { if (ge == source) { continue; } found = false; foreach (ElementType et in includeTypes) { if (ge.Type == et) { found = true; break; } } if (!found) { continue; } distance = UOMath.Distance(source.X, source.Y, ge.X, ge.Y); if (nearest == null) { closest = distance; nearest = ge; } else { if (distance < closest) { closest = distance; nearest = ge; } } } element = nearest; return(nearest != null); }
public Gump( int client, int x, int y, int ID, int serial, string layout, string[] strings, GumpElement[] elements, GumpPage[] pages ) { this.Client = client; this.X = x; this.Y = y; this.ID = ID; this.Serial = serial; this.Layout = layout; this.Strings = strings; this.GumpElements = elements; this.Pages = pages; foreach (GumpPage gp in pages) { gp.ParentGump = this; } }
public void AddImageTiledButton(int x, int y, int normalID, int pressedID, int buttonID, GumpButtonType type, int param, int itemID, int hue, int width, int height, int localizedTooltip) { GumpElement ge = new GumpElement(); ge.Type = ElementType.buttontileart; ge.X = x; ge.Y = y; ge.InactiveID = normalID; ge.ActiveID = pressedID; ge.ElementID = buttonID; ge.ButtonType = (int)type; ge.Param = param; ge.ItemID = itemID; ge.Hue = hue; ge.Height = height; ge.Width = width; ge.Cliloc = localizedTooltip; Add(ge); }
/// <summary> /// Get nearest GumpElement to source, but only if it's ElementType is contained in the include list. /// </summary> /// <param name="source">Source element.</param> /// <param name="includeTypes">Array of ElementTypes which specifies valid GumpElements to search.</param> /// <param name="element">GumpElement (out).</param> /// <returns>True on success.</returns> public bool GetNearestElement(GumpElement source, ElementType[] includeTypes, out GumpElement element) { GumpElement nearest = null; double closest = 0, distance; bool found; foreach (GumpElement ge in myGumpElements) { if (ge == source) continue; found = false; foreach (ElementType et in includeTypes) { if (ge.Type == et) { found = true; break; } } if (!found) continue; distance = UOMath.Distance(source.X, source.Y, ge.X, ge.Y); if (nearest == null) { closest = distance; nearest = ge; } else { if (distance < closest) { closest = distance; nearest = ge; } } } element = nearest; return nearest != null; }
public void AddLabel( int x, int y, int hue, string text ) { GumpElement ge = new GumpElement(); ge.Type = ElementType.text; ge.X = x; ge.Y = y; ge.Hue = hue; ge.Text = text; Add( ge ); }
public void AddItemProperty( int serial ) { GumpElement ge = new GumpElement(); ge.Type = ElementType.itemproperty; ge.Serial = serial; Add( ge ); }
public void AddItem( int x, int y, int itemID, int hue ) { GumpElement ge = new GumpElement(); ge.Type = ElementType.tilepic; ge.X = x; ge.Y = y; ge.ItemID = itemID; ge.Hue = hue; Add( ge ); }
/// <summary> /// Get the GumpElement nearest to the specified GumpElement. /// </summary> /// <returns>True on success.</returns> public bool GetNearestElement( GumpElement source, out GumpElement element ) { GumpElement nearest = null; double closest = 0, distance; if (source.ParentPage != null) { return source.ParentPage.GetNearestElement( source, out element ); } foreach (GumpElement ge in this.GumpElements) { if (ge == source) continue; distance = UOMath.Distance( source.X, source.Y, ge.X, ge.Y ); if (nearest == null) { closest = distance; nearest = ge; } else { if (distance < closest) { closest = distance; nearest = ge; } } } element = nearest; return nearest != null; }
public void AddTooltip( int number ) { GumpElement ge = new GumpElement(); ge.Type = ElementType.tooltip; ge.Cliloc = number; Add( ge ); }
public void AddRadio( int x, int y, int inactiveID, int activeID, bool initialState, int switchID ) { GumpElement ge = new GumpElement(); ge.Type = ElementType.radio; ge.X = x; ge.Y = y; ge.InactiveID = inactiveID; ge.ActiveID = activeID; ge.InitialState = initialState; ge.ElementID = switchID; Add( ge ); }
public void AddHtml( int x, int y, int width, int height, string text, bool background, bool scrollbar ) { GumpElement ge = new GumpElement(); ge.Type = ElementType.htmlgump; ge.X = x; ge.Y = y; ge.Width = width; ge.Height = height; ge.Text = text; ge.ScrollBar = scrollbar; ge.Background = background; Add( ge ); }
public void AddGroup( int group ) { GumpElement ge = new GumpElement(); ge.Type = ElementType.group; ge.Group = group; Add( ge ); }
public void AddButton( int x, int y, int normalID, int pressedID, int buttonID, GumpButtonType type, int param ) { GumpElement ge = new GumpElement(); ge.Type = ElementType.button; ge.X = x; ge.Y = y; ge.InactiveID = normalID; ge.ActiveID = pressedID; ge.ButtonType = (int) type; ge.ElementID = buttonID; ge.Param = param; Add( ge ); }
public void AddBackground( int x, int y, int width, int height, int gumpID ) { GumpElement ge = new GumpElement(); ge.Type = ElementType.resizepic; ge.X = x; ge.Y = y; ge.Width = width; ge.Height = height; ge.ElementID = gumpID; Add( ge ); }
public void AddAlphaRegion( int x, int y, int width, int height ) { GumpElement ge = new GumpElement(); ge.Type = ElementType.checkertrans; ge.X = x; ge.Y = y; ge.Width = width; ge.Height = height; Add( ge ); }
public void Add( GumpElement e ) { e.ParentGump = this; myElements.Add( e ); }
public void AddLabelCropped( int x, int y, int width, int height, int hue, string text ) { GumpElement ge = new GumpElement(); ge.Type = ElementType.croppedtext; ge.X = x; ge.Y = y; ge.Width = width; ge.Height = height; ge.Hue = hue; ge.Text = text; Add( ge ); }
public void AddPage( int page ) { GumpElement ge = new GumpElement(); ge.Type = ElementType.page; ge.PageNumber = page; Add( ge ); }
public void AddHtmlLocalized( int x, int y, int width, int height, int number, string args, int color, bool background, bool scrollbar ) { GumpElement ge = new GumpElement(); ge.Type = ElementType.xmfhtmltok; ge.X = x; ge.Y = y; ge.Width = width; ge.Height = height; ge.Cliloc = number; ge.Args = args; ge.Hue = color; ge.Background = background; ge.ScrollBar = scrollbar; Add( ge ); }
public void AddTextEntry( int x, int y, int width, int height, int hue, int entryID, string initialText, int size ) { GumpElement ge = new GumpElement(); ge.Type = ElementType.textentrylimited; ge.X = x; ge.Y = y; ge.Width = width; ge.Height = height; ge.Hue = hue; ge.ElementID = entryID; ge.Text = initialText; ge.Size = size; Add( ge ); }
public void AddImage( int x, int y, int gumpID, int hue ) { GumpElement ge = new GumpElement(); ge.Type = ElementType.gumppic; ge.X = x; ge.Y = y; ge.ElementID = gumpID; ge.Hue = hue; Add( ge ); }
/// <summary> /// Get the GumpElement with the specified ID. Searches all pages/elements. /// </summary> /// <returns>True on success.</returns> public bool GetElementByID( int ID, out GumpElement element ) { if (this.GumpElements != null) { foreach (GumpElement ge in this.GumpElements) { if (ge.ElementID == ID) { element = ge; return true; } } } if (this.Pages != null) { foreach (GumpPage p in this.Pages) { foreach (GumpElement ge in p.GumpElements) { if (ge.ElementID == ID) { element = ge; return true; } } } } element = null; return false; }
public void AddImageTiled( int x, int y, int width, int height, int gumpID ) { GumpElement ge = new GumpElement(); ge.Type = ElementType.gumppictiled; ge.X = x; ge.Y = y; ge.Width = width; ge.Height = height; ge.ElementID = gumpID; Add( ge ); }
public void Add(GumpElement e) { e.ParentGump = this; myElements.Add(e); }
public void AddImageTiledButton( int x, int y, int normalID, int pressedID, int buttonID, GumpButtonType type, int param, int itemID, int hue, int width, int height, int localizedTooltip ) { GumpElement ge = new GumpElement(); ge.Type = ElementType.buttontileart; ge.X = x; ge.Y = y; ge.InactiveID = normalID; ge.ActiveID = pressedID; ge.ElementID = buttonID; ge.ButtonType = (int) type; ge.Param = param; ge.ItemID = itemID; ge.Hue = hue; ge.Height = height; ge.Width = width; ge.Cliloc = localizedTooltip; Add( ge ); }