public void ApplyTo(SuperGump gump) { foreach (var renderer in Values.Where(o => o != null)) { renderer(); } }
public virtual void ApplyTo(SuperGump gump) { foreach (var kvp in this.Where(kvp => !String.IsNullOrEmpty(kvp.Key) && kvp.Value != null)) { kvp.Value(kvp.Key); } }
protected void RemoveChild(SuperGump child) { if (child != null && Children.Remove(child)) { OnChildRemoved(child); } }
private static void OnEncode0xB0_0xDD(NetState state, PacketReader reader, ref byte[] buffer, ref int length) { if (state == null || reader == null || buffer == null || length < 0) { return; } int pos = reader.Seek(0, SeekOrigin.Current); reader.Seek(3, SeekOrigin.Begin); int serial = reader.ReadInt32(); reader.Seek(pos, SeekOrigin.Begin); if (serial < 0 || !GlobalInstances.ContainsKey(serial)) { return; } SuperGump gump = GlobalInstances[serial]; if (!gump.Compiled) { gump.Refresh(true); } }
public GumpAnimation( SuperGump gump, string name, int take, long delay, long duration, bool repeat, bool wait, object[] args, Action <GumpAnimation> handler) { Gump = gump; Name = name ?? String.Empty; UID = String.Format("{{{0} {1} {2}}}", Name, Gump.Serial, Gump.User.Serial.Value); take = Math.Max(-1, Math.Min(Gump.Entries.Count, take)); Entries = new Stack <GumpEntry>(take == -1 ? Gump.Entries.Count : take); if (take == -1 || take > 0) { var count = Gump.Entries.Count; while (--count >= 0) { if (count >= Gump.Entries.Count) { continue; } var e = Gump.Entries[count]; if (e == null || e == this || e is GumpAnimation) { continue; } if (e is GumpAnimationBreak) { break; } Entries.Push(e); if (take != -1 && --take <= 0) { break; } } } Handler = handler ?? _EmptyHandler; UID = CryptoGenerator.GenString(CryptoHashType.MD5, UID); State = GumpAnimationState.Acquire(UID, delay, duration, repeat, wait); Args = args ?? new object[0]; }
protected void AddChild(SuperGump child) { if (child != null && !Children.Contains(child)) { Children.Add(child); OnChildAdded(child); } }
protected void RemoveChild(SuperGump child) { if (child == null) { return; } if (Children.Remove(child)) { OnChildRemoved(child); } }
public virtual void Link(SuperGump gump) { if (gump == null) { return; } Linked.AddOrReplace(gump); if (!gump.Linked.Contains(this)) { gump.Link(this); } }
protected void RemoveChild(SuperGump child) { if (child == null) { return; } //child._Parent = null; if (Children.Contains(child) && Children.Remove(child)) { OnChildRemoved(child); } }
public virtual void Unlink(SuperGump gump) { if (gump == null) { return; } Linked.Remove(gump); if (gump.Linked.Contains(this)) { gump.Unlink(this); } }
protected void AddChild(SuperGump child) { if (child == null) { return; } if (Children.Contains(child)) { return; } Children.Add(child); OnChildAdded(child); }
public virtual void Link(SuperGump gump) { if (gump == null) { return; } if (!Linked.Contains(gump)) { Linked.Add(gump); } if (!gump.Linked.Contains(this)) { gump.Link(this); } }
public bool IsChildOf(SuperGump parent, bool tree) { if (parent == null) { return(false); } var p = Parent; while (p != null) { if (p == parent) { return(true); } p = !tree || !(p is SuperGump) ? null : ((SuperGump)p).Parent; } return(false); }
public bool IsChildOf(SuperGump parent, bool tree) { if (parent == null) { return false; } var p = Parent; while (p != null) { if (p == parent) { return true; } p = !tree || !(p is SuperGump) ? null : ((SuperGump)p).Parent; } return false; }
public virtual bool IsLinkedWith(SuperGump gump) { return(gump != null && Linked.Contains(gump)); }
public bool IsChildOf(SuperGump parent) { return(IsChildOf(parent, false)); }
protected virtual void OnChildAdded(SuperGump child) { }
public bool IsChildOf(SuperGump parent) { return IsChildOf(parent, false); }
public bool HasChild(SuperGump child) { return HasChild(child, false); }
public virtual void CompileControlPanel(SuperGump g, int x, int y, int w, int h) { }
protected virtual void OnLinkClosed(SuperGump link) { }
public virtual bool IsLinkedWith(SuperGump gump) { return gump != null && Linked.Contains(gump); }
protected virtual void OnChildRemoved(SuperGump child) { }
public bool HasChild(SuperGump child) { return(HasChild(child, false)); }
public bool HasChild(SuperGump child, bool tree) { return(child != null && Children.Any(c => c == child || (tree && c.HasChild(child, true)))); }
protected override void OnLinkClosed(SuperGump link) { base.OnLinkClosed(link); Refresh(true); }
protected override void OnLinkHidden(SuperGump link) { base.OnLinkHidden(link); Refresh(true); }
protected virtual void OnLinkRefreshed(SuperGump link) { }
protected virtual void OnLinkHidden(SuperGump link) { }
protected virtual void OnLinkSendFail(SuperGump link) { }
public bool HasChild(SuperGump child, bool tree) { return child != null && Children.Any(c => c == child || (tree && c.HasChild(child, true))); }
public void CompileControlPanel(SuperGump g, int x, int y, int w, int h) { if (Options != null) { Options.CompileControlPanel(g, x, y, w, h); } }