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

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

            if (Children.Remove(child))
            {
                OnChildRemoved(child);
            }
        }
Exemple #9
0
		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);
            }
        }
Exemple #11
0
		public virtual void Unlink(SuperGump gump)
		{
			if (gump == null)
			{
				return;
			}

			Linked.Remove(gump);

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

            Linked.AddOrReplace(gump);

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

            Linked.Remove(gump);

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

			//child._Parent = null;

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

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

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

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

			Children.Add(child);
			OnChildAdded(child);
		}
Exemple #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);
            }
        }
		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;
		}
Exemple #21
0
 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);
		}
Exemple #26
0
		public virtual void CompileControlPanel(SuperGump g, int x, int y, int w, int h)
		{ }
Exemple #27
0
 protected virtual void OnLinkClosed(SuperGump link)
 {
 }
Exemple #28
0
		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))));
 }
Exemple #32
0
		protected override void OnLinkClosed(SuperGump link)
		{
			base.OnLinkClosed(link);

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

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

            Refresh(true);
        }
Exemple #40
0
		protected virtual void OnLinkClosed(SuperGump link)
		{ }
		public bool HasChild(SuperGump child, bool tree)
		{
			return child != null && Children.Any(c => c == child || (tree && c.HasChild(child, true)));
		}
Exemple #42
0
		protected virtual void OnLinkSendFail(SuperGump link)
		{ }
 protected virtual void OnChildAdded(SuperGump child)
 {
 }
Exemple #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);
			}
		}
		protected virtual void OnChildRemoved(SuperGump child)
		{ }
Exemple #46
0
        protected override void OnLinkClosed(SuperGump link)
        {
            base.OnLinkClosed(link);

            Refresh(true);
        }