public DialogGump( Mobile user, Gump parent = null, int?x = null, int?y = null, string title = null, string html = null, int icon = -1, Action <GumpButton> onAccept = null, Action <GumpButton> onCancel = null) : base(user, parent, x, y) { _Icon = IconDefinition.FromGump(icon >= 0 ? icon : DefaultIcon); _Icon.ComputeOffset = false; Modal = true; CanDispose = false; HtmlBackground = false; HtmlScrollbar = true; HtmlColor = DefaultHtmlColor; Width = Defaultwidth; Height = DefaultHeight; Title = title ?? DefaultTitle; Html = html; AcceptHandler = onAccept; CancelHandler = onCancel; }
public OPLGump(Mobile user, int itemID, int hue, string[] props, Gump parent = null) : this(user, parent) { Icon = IconDefinition.FromItem(itemID, hue); Properties = props; }
protected override void OnDispose() { base.OnDispose(); _Icon = null; AcceptHandler = null; CancelHandler = null; }
protected override void Compile() { if (Entity != null) { var id = 0; if (Entity is Mobile) { id = ShrinkTable.Lookup((Mobile)Entity); } else if (Entity is Item) { id = ((Item)Entity).ItemID; } int hue; if (Entity.GetPropertyValue("Hue", out hue)) { Icon = IconDefinition.FromItem(id, hue); } else { Icon = IconDefinition.FromItem(id); } Properties = Entity.GetOPLStrings(User).ToArray(); } if (Icon == null || Icon.IsEmpty) { Icon = _DefIcon; } if (Properties.IsNullOrEmpty()) { Properties = _DefProperties; } base.Compile(); }