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

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

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

			Linked.AddOrReplace(gump);

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

            //child._Parent = null;

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

			Linked.Remove(gump);

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

            Linked.AddOrReplace(gump);

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

            Linked.Remove(gump);

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

			//child._Parent = null;

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

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

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

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

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

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

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

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

            Refresh(true);
        }