Example #1
0
 public void ApplyTo(SuperGump gump)
 {
     foreach (var renderer in Values.Where(o => o != null))
     {
         renderer();
     }
 }
Example #2
0
 public virtual void ApplyTo(SuperGump gump)
 {
     foreach (var kvp in this.Where(kvp => !String.IsNullOrEmpty(kvp.Key) && kvp.Value != null))
     {
         kvp.Value(kvp.Key);
     }
 }
Example #3
0
 protected void RemoveChild(SuperGump child)
 {
     if (child != null && Children.Remove(child))
     {
         OnChildRemoved(child);
     }
 }
Example #4
0
        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);
            }
        }
Example #5
0
        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];
        }
Example #6
0
 protected void AddChild(SuperGump child)
 {
     if (child != null && !Children.Contains(child))
     {
         Children.Add(child);
         OnChildAdded(child);
     }
 }
Example #7
0
		protected void RemoveChild(SuperGump child)
		{
			if (child == null)
			{
				return;
			}

			if (Children.Remove(child))
			{
				OnChildRemoved(child);
			}
		}
Example #8
0
        protected void RemoveChild(SuperGump child)
        {
            if (child == null)
            {
                return;
            }

            if (Children.Remove(child))
            {
                OnChildRemoved(child);
            }
        }
Example #9
0
		public virtual void Link(SuperGump gump)
		{
			if (gump == null)
			{
				return;
			}

			Linked.AddOrReplace(gump);

			if (!gump.Linked.Contains(this))
			{
				gump.Link(this);
			}
		}
Example #10
0
        protected void RemoveChild(SuperGump child)
        {
            if (child == null)
            {
                return;
            }

            //child._Parent = null;

            if (Children.Contains(child) && Children.Remove(child))
            {
                OnChildRemoved(child);
            }
        }
Example #11
0
		public virtual void Unlink(SuperGump gump)
		{
			if (gump == null)
			{
				return;
			}

			Linked.Remove(gump);

			if (gump.Linked.Contains(this))
			{
				gump.Unlink(this);
			}
		}
Example #12
0
        public virtual void Link(SuperGump gump)
        {
            if (gump == null)
            {
                return;
            }

            Linked.AddOrReplace(gump);

            if (!gump.Linked.Contains(this))
            {
                gump.Link(this);
            }
        }
Example #13
0
        public virtual void Unlink(SuperGump gump)
        {
            if (gump == null)
            {
                return;
            }

            Linked.Remove(gump);

            if (gump.Linked.Contains(this))
            {
                gump.Unlink(this);
            }
        }
Example #14
0
		protected void RemoveChild(SuperGump child)
		{
			if (child == null)
			{
				return;
			}

			//child._Parent = null;

			if (Children.Contains(child) && Children.Remove(child))
			{
				OnChildRemoved(child);
			}
		}
Example #15
0
        protected void AddChild(SuperGump child)
        {
            if (child == null)
            {
                return;
            }

            if (Children.Contains(child))
            {
                return;
            }

            Children.Add(child);
            OnChildAdded(child);
        }
Example #16
0
		protected void AddChild(SuperGump child)
		{
			if (child == null)
			{
				return;
			}

			if (Children.Contains(child))
			{
				return;
			}

			Children.Add(child);
			OnChildAdded(child);
		}
Example #17
0
        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);
            }
        }
Example #18
0
		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);
			}
		}
Example #19
0
        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);
        }
Example #20
0
		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;
		}
Example #21
0
 public virtual bool IsLinkedWith(SuperGump gump)
 {
     return(gump != null && Linked.Contains(gump));
 }
Example #22
0
 public bool IsChildOf(SuperGump parent)
 {
     return(IsChildOf(parent, false));
 }
Example #23
0
		protected virtual void OnChildAdded(SuperGump child)
		{ }
Example #24
0
		public bool IsChildOf(SuperGump parent)
		{
			return IsChildOf(parent, false);
		}
Example #25
0
		public bool HasChild(SuperGump child)
		{
			return HasChild(child, false);
		}
Example #26
0
		public virtual void CompileControlPanel(SuperGump g, int x, int y, int w, int h)
		{ }
Example #27
0
 protected virtual void OnLinkClosed(SuperGump link)
 {
 }
Example #28
0
		public virtual bool IsLinkedWith(SuperGump gump)
		{
			return gump != null && Linked.Contains(gump);
		}
Example #29
0
 protected virtual void OnChildRemoved(SuperGump child)
 {
 }
Example #30
0
 public bool HasChild(SuperGump child)
 {
     return(HasChild(child, false));
 }
Example #31
0
 public bool HasChild(SuperGump child, bool tree)
 {
     return(child != null && Children.Any(c => c == child || (tree && c.HasChild(child, true))));
 }
Example #32
0
		protected override void OnLinkClosed(SuperGump link)
		{
			base.OnLinkClosed(link);

			Refresh(true);
		}
Example #33
0
		protected override void OnLinkHidden(SuperGump link)
		{
			base.OnLinkHidden(link);

			Refresh(true);
		}
Example #34
0
 protected virtual void OnLinkRefreshed(SuperGump link)
 {
 }
Example #35
0
 protected virtual void OnLinkHidden(SuperGump link)
 {
 }
Example #36
0
		protected virtual void OnLinkRefreshed(SuperGump link)
		{ }
Example #37
0
 protected virtual void OnLinkSendFail(SuperGump link)
 {
 }
Example #38
0
		protected virtual void OnLinkHidden(SuperGump link)
		{ }
Example #39
0
        protected override void OnLinkHidden(SuperGump link)
        {
            base.OnLinkHidden(link);

            Refresh(true);
        }
Example #40
0
		protected virtual void OnLinkClosed(SuperGump link)
		{ }
Example #41
0
		public bool HasChild(SuperGump child, bool tree)
		{
			return child != null && Children.Any(c => c == child || (tree && c.HasChild(child, true)));
		}
Example #42
0
		protected virtual void OnLinkSendFail(SuperGump link)
		{ }
Example #43
0
 protected virtual void OnChildAdded(SuperGump child)
 {
 }
Example #44
0
		public void CompileControlPanel(SuperGump g, int x, int y, int w, int h)
		{
			if (Options != null)
			{
				Options.CompileControlPanel(g, x, y, w, h);
			}
		}
Example #45
0
		protected virtual void OnChildRemoved(SuperGump child)
		{ }
Example #46
0
        protected override void OnLinkClosed(SuperGump link)
        {
            base.OnLinkClosed(link);

            Refresh(true);
        }