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

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

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

			Linked.AddOrReplace(gump);

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

            //child._Parent = null;

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

			Linked.Remove(gump);

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

            Linked.AddOrReplace(gump);

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

            Linked.Remove(gump);

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

			//child._Parent = null;

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

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

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

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

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

			Refresh(true);
		}
Exemplo n.º 33
0
		protected override void OnLinkHidden(SuperGump link)
		{
			base.OnLinkHidden(link);

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

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

            Refresh(true);
        }