Ejemplo n.º 1
0
        public override void AppendTo(IGumpWriter disp)
        {
            var s = _ShadowAngle.GetPoint2D(_X, _Y, _ShadowOffset);

            disp.AppendLayout(_Layout1A);
            disp.AppendLayout(s.X);
            disp.AppendLayout(s.Y);
            disp.AppendLayout(_ImageID);

            if (_ShadowHue > 0)
            {
                disp.AppendLayout(_Layout1Hue);
                disp.AppendLayoutNS(FixHue(_ShadowHue));
            }

            disp.AppendLayout(_Layout1B);
            disp.AppendLayout(_X);
            disp.AppendLayout(_Y);
            disp.AppendLayout(_ImageID);

            if (_ImageHue > 0)
            {
                disp.AppendLayout(_Layout1Hue);
                disp.AppendLayoutNS(FixHue(_ImageHue));
            }
        }
Ejemplo n.º 2
0
        public override void AppendTo(IGumpWriter disp)
        {
            var x = _X;
            var y = _Y;

            if (_Centering.HasFlag(Axis.Horizontal))
            {
                x -= Width / 2;
            }

            if (_Centering.HasFlag(Axis.Vertical))
            {
                y -= Height / 2;
            }

            var value = _Value.ToString();

            for (int i = 0, s = 0; i < value.Length; i++, s += 20)
            {
                switch (value[i])
                {
                case '-':
                {
                    disp.AppendLayout(_Layout1A);
                    disp.AppendLayout(x + s);
                    disp.AppendLayout(y + 12);
                    disp.AppendLayout(1433);

                    if (_Hue > 0)
                    {
                        disp.AppendLayout(_Layout1Hue);
                        disp.AppendLayoutNS(FixHue(_Hue));
                    }
                }
                    continue;

                default:
                {
                    disp.AppendLayout(i == 0 ? _Layout1A : _Layout1B);
                    disp.AppendLayout(x + s);
                    disp.AppendLayout(y);
                    disp.AppendLayout(1423 + Byte.Parse(value.Substring(i, 1)));

                    if (_Hue > 0)
                    {
                        disp.AppendLayout(_Layout1Hue);
                        disp.AppendLayoutNS(FixHue(_Hue));
                    }
                }
                    continue;
                }
            }
        }
Ejemplo n.º 3
0
        public static void AppendTo(this GumpImage g, IGumpWriter disp, List <string> strings)
        {
            disp.AppendLayout(GumpImage.LayoutName);
            disp.AppendLayout(g.X);
            disp.AppendLayout(g.Y);
            disp.AppendLayout(g.GumpID);

            if (g.Hue != 0)
            {
                disp.AppendLayout(GumpImage.HueEquals);
                disp.AppendLayoutNS(g.Hue);
            }

            if (!string.IsNullOrEmpty(g.Class))
            {
                disp.AppendLayout(GumpImage.ClassEquals);
                disp.AppendLayoutNS(g.Class);
            }
        }
Ejemplo n.º 4
0
        public static void AppendTo(this GumpImage g, IGumpWriter disp, List <string> strings)
        {
            disp.AppendLayout(Gump.StringToBuffer("gumppic"));
            disp.AppendLayout(g.X);
            disp.AppendLayout(g.Y);
            disp.AppendLayout(g.GumpID);

            if (g.Hue != 0)
            {
                disp.AppendLayoutNS(" hue=");
                disp.AppendLayoutNS(g.Hue);
            }

            if (!string.IsNullOrEmpty(g.Class))
            {
                disp.AppendLayoutNS(" class=");
                disp.AppendLayout(Gump.StringToBuffer(g.Class));
            }
        }
Ejemplo n.º 5
0
        public virtual void AppendTo(IGumpWriter disp, ref string props, ref bool hidePants, ref bool hideHair)
        {
            if (_Items == null || _Items.Count == 0)
            {
                return;
            }

            _Items.SortLayers();

            foreach (var item in _Items.TakeWhile(i => i.Layer.IsOrdered())
                     .Where(i => !_Body.IsGhost || i.ItemID == 8270 || i.ItemID == 8271))
            {
                if (item.ItemID == 0x1411 || item.ItemID == 0x141A)                 // plate legs
                {
                    hidePants = true;
                }
                else if (hidePants && item.Layer == Layer.Pants)
                {
                    continue;
                }

                if (!hideHair && (item.ItemID == 8270 || item.ItemID == 8271 || item.Layer == Layer.Helm))
                {
                    hideHair = true;
                }

                var gump = ArtworkSupport.LookupGump(item.ItemID, _Body.IsFemale);

                if (gump <= 0)
                {
                    continue;
                }

                disp.AppendLayout(_Layout2);
                disp.AppendLayout(_X);
                disp.AppendLayout(_Y);
                disp.AppendLayout(gump);

                var hue = _SolidHue >= 0 ? _SolidHue : item.Hue;

                if (hue > 0 || (_SolidHue >= 0 && hue == _SolidHue))
                {
                    disp.AppendLayout(_Layout2Hue);
                    disp.AppendLayoutNS(FixHue(hue));
                }

                if (_Properties)
                {
                    props += item.Serial.Value + ",";
                }
            }
        }
Ejemplo n.º 6
0
        public override void AppendTo(IGumpWriter disp)
        {
            disp.AppendLayout(m_LayoutName);
            disp.AppendLayout(m_X);
            disp.AppendLayout(m_Y);
            disp.AppendLayout(m_GumpID);

            if (m_Hue != 0)
            {
                disp.AppendLayout(m_HueEquals);
                disp.AppendLayoutNS(m_Hue);
            }
        }
Ejemplo n.º 7
0
		public override void AppendTo(IGumpWriter disp)
		{
			disp.AppendLayout(m_LayoutName);
			disp.AppendLayout(m_X);
			disp.AppendLayout(m_Y);
			disp.AppendLayout(m_GumpID);

			if (m_Hue != 0)
			{
				disp.AppendLayout(m_HueEquals);
				disp.AppendLayoutNS(m_Hue);
			}
		}
Ejemplo n.º 8
0
        public override void AppendTo(NetState ns, IGumpWriter disp)
        {
            disp.AppendLayout(m_LayoutName);
            disp.AppendLayout(X);
            disp.AppendLayout(Y);
            disp.AppendLayout(GumpID);

            if (Hue != 0)
            {
                disp.AppendLayout(m_HueEquals);
                disp.AppendLayoutNS(Hue);
            }
        }
Ejemplo n.º 9
0
        public override void AppendTo(IGumpWriter disp)
        {
            disp.AppendLayout(_Layout0);
            disp.AppendLayout(_X);
            disp.AppendLayout(_Y);
            disp.AppendLayout(Width);
            disp.AppendLayout(Height);
            disp.AppendLayout(Parent.Intern(" ".WrapUOHtmlBG(Color.Transparent)));
            disp.AppendLayout(false);
            disp.AppendLayout(false);

            var hue = _BodyHue;

            if (_SolidHue >= 0)
            {
                hue = _SolidHue;
            }

            var gump = ArtworkSupport.LookupGump(_Body);

            if (gump <= 0)
            {
                gump = ShrinkTable.Lookup(_Body, 0);

                if (gump > 0)
                {
                    disp.AppendLayout(hue == 0 ? _Layout3A : _Layout4A);
                    disp.AppendLayout(_X);
                    disp.AppendLayout(_Y);
                    disp.AppendLayout(gump);

                    if (hue > 0 || (_SolidHue >= 0 && hue == _SolidHue))
                    {
                        disp.AppendLayout(FixHue(hue));
                    }
                }

                return;
            }

            disp.AppendLayout(_Layout2A);
            disp.AppendLayout(_X);
            disp.AppendLayout(_Y);
            disp.AppendLayout(gump);

            if (hue != 0)
            {
                disp.AppendLayout(_Layout2Hue);
                disp.AppendLayoutNS(FixHue(hue));
            }

            var hideHair  = _Body.IsGhost;
            var hidePants = false;
            var props     = String.Empty;

            AppendTo(disp, ref props, ref hidePants, ref hideHair);

            if (!_Body.IsGhost && _FacialHairID > 0)
            {
                gump = ArtworkSupport.LookupGump(_FacialHairID, _Body.IsFemale);

                if (gump > 0)
                {
                    disp.AppendLayout(_Layout2B);
                    disp.AppendLayout(_X);
                    disp.AppendLayout(_Y);
                    disp.AppendLayout(gump);

                    hue = _SolidHue >= 0 ? _SolidHue : _FacialHairHue;

                    if (hue > 0 || (_SolidHue >= 0 && hue == _SolidHue))
                    {
                        disp.AppendLayout(_Layout2Hue);
                        disp.AppendLayoutNS(FixHue(hue));
                    }
                }
            }

            if (!hideHair && _HairID > 0)
            {
                gump = ArtworkSupport.LookupGump(_HairID, _Body.IsFemale);

                if (gump > 0)
                {
                    disp.AppendLayout(_Layout2B);
                    disp.AppendLayout(_X);
                    disp.AppendLayout(_Y);
                    disp.AppendLayout(gump);

                    hue = _SolidHue >= 0 ? _SolidHue : _HairHue;

                    if (hue > 0 || (_SolidHue >= 0 && hue == _SolidHue))
                    {
                        disp.AppendLayout(_Layout2Hue);
                        disp.AppendLayoutNS(FixHue(hue));
                    }
                }
            }

            if (!_Properties || String.IsNullOrWhiteSpace(props))
            {
                return;
            }

            var noHue  = FixHue(0);
            var noText = Parent.Intern(" ");

            props = props.Trim(',');

            foreach (var item in props.Split(',').Select(Int32.Parse).Select(s => _Items.Find(i => i.Serial.Value == s)))
            {
                foreach (var b in item.GetPaperdollBounds())
                {
                    disp.AppendLayout(_Layout5);
                    disp.AppendLayout(_X + b.X);
                    disp.AppendLayout(_Y + b.Y);
                    disp.AppendLayout(b.Width);
                    disp.AppendLayout(b.Height);
                    disp.AppendLayout(noHue);
                    disp.AppendLayout(noText);

                    disp.AppendLayout(_Layout6);
                    disp.AppendLayout(item.Serial.Value);
                }
            }
        }
Ejemplo n.º 10
0
        public override void AppendTo(IGumpWriter disp)
        {
            var first = true;

            if (_Background)
            {
                disp.AppendLayout(_Layout1A);
                disp.AppendLayout(_X);
                disp.AppendLayout(_Y);
                disp.AppendLayout(1417);

                if (_BackgroundHue > 0)
                {
                    disp.AppendLayout(_Layout1Hue);
                    disp.AppendLayoutNS(FixHue(_BackgroundHue));
                }

                first = false;
            }

            if (_Face)
            {
                disp.AppendLayout(first ? _Layout1A : _Layout1B);
                disp.AppendLayout(_X + 33);
                disp.AppendLayout(_Y + 33);
                disp.AppendLayout(1210);

                if (_FaceHue > 0)
                {
                    disp.AppendLayout(_Layout1Hue);
                    disp.AppendLayoutNS(FixHue(_FaceHue));
                }

                first = false;
            }

            if (_Numbers)
            {
                for (var number = 1; number <= 12; number++)
                {
                    AppendTo(disp, ref first, number, _NumbersColor);
                }
            }

            var center = new Point2D(_X + 40, _Y + 40);

            if (_Hours)
            {
                var ha = 2.0f * Math.PI * (_Time.Hour + _Time.Minute / 60.0f) / 12.0f;
                var hl = center.GetLine2D(center.Clone2D((int)(40 * Math.Sin(ha) / 1.5f), (int)(-40 * Math.Cos(ha) / 1.5f)));

                AppendTo(disp, ref first, hl, 3, _HoursColor);
            }

            if (_Minutes)
            {
                var ma = 2.0f * Math.PI * (_Time.Minute + _Time.Second / 60.0f) / 60.0f;
                var ml = center.GetLine2D(center.Clone2D((int)(40 * Math.Sin(ma)), (int)(-40 * Math.Cos(ma))));

                AppendTo(disp, ref first, ml, 3, _MinutesColor);
            }

            if (_Seconds)
            {
                var sa = 2.0f * Math.PI * _Time.Second / 60.0f;
                var sl = center.GetLine2D(center.Clone2D((int)(40 * Math.Sin(sa)), (int)(-40 * Math.Cos(sa))));

                AppendTo(disp, ref first, sl, 1, _SecondsColor);
            }

            if (first)
            {
                disp.AppendLayout(_Layout2A);
                disp.AppendLayout(_X);
                disp.AppendLayout(_Y);
                disp.AppendLayout(Width);
                disp.AppendLayout(Height);
                disp.AppendLayout(Parent.Intern(" ".WrapUOHtmlBG(Color.Transparent)));
                disp.AppendLayout(false);
                disp.AppendLayout(false);
            }
        }
Ejemplo n.º 11
0
		public override void AppendTo(IGumpWriter disp)
		{
			var x = _X;
			var y = _Y;

			if (_Centering.HasFlag(Axis.Horizontal))
			{
				x -= Width / 2;
			}

			if (_Centering.HasFlag(Axis.Vertical))
			{
				y -= Height / 2;
			}

			var value = _Value.ToString();

			for (int i = 0, s = 0; i < value.Length; i++, s += 20)
			{
				switch (value[i])
				{
					case '-':
					{
						disp.AppendLayout(_Layout1A);
						disp.AppendLayout(x + s);
						disp.AppendLayout(y + 12);
						disp.AppendLayout(1433);

						if (_Hue > 0)
						{
							disp.AppendLayout(_Layout1Hue);
							disp.AppendLayoutNS(FixHue(_Hue));
						}
					}
						continue;
					default:
					{
						disp.AppendLayout(i == 0 ? _Layout1A : _Layout1B);
						disp.AppendLayout(x + s);
						disp.AppendLayout(y);
						disp.AppendLayout(1423 + Byte.Parse(value.Substring(i, 1)));

						if (_Hue > 0)
						{
							disp.AppendLayout(_Layout1Hue);
							disp.AppendLayoutNS(FixHue(_Hue));
						}
					}
						continue;
				}
			}
		}
Ejemplo n.º 12
0
		public override void AppendTo(IGumpWriter disp)
		{
			var s = _ShadowAngle.GetPoint2D(_X, _Y, _ShadowOffset);

			disp.AppendLayout(_Layout1A);
			disp.AppendLayout(s.X);
			disp.AppendLayout(s.Y);
			disp.AppendLayout(_ImageID);

			if (_ShadowHue > 0)
			{
				disp.AppendLayout(_Layout1Hue);
				disp.AppendLayoutNS(FixHue(_ShadowHue));
			}

			disp.AppendLayout(_Layout1B);
			disp.AppendLayout(_X);
			disp.AppendLayout(_Y);
			disp.AppendLayout(_ImageID);

			if (_ImageHue > 0)
			{
				disp.AppendLayout(_Layout1Hue);
				disp.AppendLayoutNS(FixHue(_ImageHue));
			}
		}
Ejemplo n.º 13
0
        public virtual void AppendTo(IGumpWriter disp, ref string props, ref bool hidePants, ref bool hideHair)
        {
            if (_Items == null || _Items.Count == 0)
            {
                return;
            }

            _Items.SortLayers();

            foreach (var item in _Items.TakeWhile(i => i.Layer.IsOrdered()).Where(i => !_Body.IsGhost || i.ItemID == 8270))
            {
                if (item.ItemID == 0x1411 || item.ItemID == 0x141A) // plate legs
                {
                    hidePants = true;
                }
                else if (hidePants && item.Layer == Layer.Pants)
                {
                    continue;
                }

                if (!hideHair && item.Layer == Layer.Helm)
                {
                    hideHair = true;
                }

                var gump = ArtworkSupport.LookupGump(item.ItemID, _Body.IsFemale);

                if (gump <= 0)
                {
                    continue;
                }

                disp.AppendLayout(_Layout2B);
                disp.AppendLayout(_X);
                disp.AppendLayout(_Y);
                disp.AppendLayout(gump);

                var hue = _SolidHue >= 0 ? _SolidHue : item.Hue;

                if (hue > 0 || (_SolidHue >= 0 && hue == _SolidHue))
                {
                    disp.AppendLayout(_Layout2Hue);
                    disp.AppendLayoutNS(FixHue(hue));
                }

                if (_Properties)
                {
                    props += item.Serial.Value + ",";
                }
            }
        }
Ejemplo n.º 14
0
        public override void AppendTo(IGumpWriter disp)
        {
            disp.AppendLayout(_Layout0);
            disp.AppendLayout(_X);
            disp.AppendLayout(_Y);
            disp.AppendLayout(Width);
            disp.AppendLayout(Height);
            disp.AppendLayout(Parent.Intern(" ".WrapUOHtmlBG(Color.Transparent)));
            disp.AppendLayout(false);
            disp.AppendLayout(false);

            var hue = _BodyHue;

            if (_SolidHue >= 0)
            {
                hue = _SolidHue;
            }

            var gump = ArtworkSupport.LookupGump(_Body);

            if (gump <= 0)
            {
                gump = ShrinkTable.Lookup(_Body, 0);

                if (gump > 0)
                {
                    disp.AppendLayout(hue == 0 ? _Layout3A : _Layout4A);
                    disp.AppendLayout(_X);
                    disp.AppendLayout(_Y);
                    disp.AppendLayout(gump);

                    if (hue > 0 || (_SolidHue >= 0 && hue == _SolidHue))
                    {
                        disp.AppendLayout(FixHue(hue));
                    }
                }

                return;
            }

            disp.AppendLayout(_Layout2A);
            disp.AppendLayout(_X);
            disp.AppendLayout(_Y);
            disp.AppendLayout(gump);

            if (hue != 0)
            {
                disp.AppendLayout(_Layout2Hue);
                disp.AppendLayoutNS(FixHue(hue));
            }

            var hideHair = _Body.IsGhost;
            var hidePants = false;
            var props = String.Empty;

            AppendTo(disp, ref props, ref hidePants, ref hideHair);

            if (!_Body.IsGhost && _FacialHairID > 0)
            {
                gump = ArtworkSupport.LookupGump(_FacialHairID, _Body.IsFemale);

                if (gump > 0)
                {
                    disp.AppendLayout(_Layout2B);
                    disp.AppendLayout(_X);
                    disp.AppendLayout(_Y);
                    disp.AppendLayout(gump);

                    hue = _SolidHue >= 0 ? _SolidHue : _FacialHairHue;

                    if (hue > 0 || (_SolidHue >= 0 && hue == _SolidHue))
                    {
                        disp.AppendLayout(_Layout2Hue);
                        disp.AppendLayoutNS(FixHue(hue));
                    }
                }
            }

            if (!hideHair && _HairID > 0)
            {
                gump = ArtworkSupport.LookupGump(_HairID, _Body.IsFemale);

                if (gump > 0)
                {
                    disp.AppendLayout(_Layout2B);
                    disp.AppendLayout(_X);
                    disp.AppendLayout(_Y);
                    disp.AppendLayout(gump);

                    hue = _SolidHue >= 0 ? _SolidHue : _HairHue;

                    if (hue > 0 || (_SolidHue >= 0 && hue == _SolidHue))
                    {
                        disp.AppendLayout(_Layout2Hue);
                        disp.AppendLayoutNS(FixHue(hue));
                    }
                }
            }

            if (!_Properties || String.IsNullOrWhiteSpace(props))
            {
                return;
            }

            var noHue = FixHue(0);
            var noText = Parent.Intern(" ");

            props = props.Trim(',');

            foreach (var item in props.Split(',').Select(Int32.Parse).Select(s => _Items.Find(i => i.Serial.Value == s)))
            {
                foreach (var b in item.GetPaperdollBounds())
                {
                    disp.AppendLayout(_Layout5);
                    disp.AppendLayout(_X + b.X);
                    disp.AppendLayout(_Y + b.Y);
                    disp.AppendLayout(b.Width);
                    disp.AppendLayout(b.Height);
                    disp.AppendLayout(noHue);
                    disp.AppendLayout(noText);

                    disp.AppendLayout(_Layout6);
                    disp.AppendLayout(item.Serial.Value);
                }
            }
        }
Ejemplo n.º 15
0
		public override void AppendTo(IGumpWriter disp)
		{
			var first = true;

			if (_Background)
			{
				disp.AppendLayout(_Layout1A);
				disp.AppendLayout(_X);
				disp.AppendLayout(_Y);
				disp.AppendLayout(1417);

				if (_BackgroundHue > 0)
				{
					disp.AppendLayout(_Layout1Hue);
					disp.AppendLayoutNS(FixHue(_BackgroundHue));
				}

				first = false;
			}

			if (_Face)
			{
				disp.AppendLayout(first ? _Layout1A : _Layout1B);
				disp.AppendLayout(_X + 33);
				disp.AppendLayout(_Y + 33);
				disp.AppendLayout(1210);

				if (_FaceHue > 0)
				{
					disp.AppendLayout(_Layout1Hue);
					disp.AppendLayoutNS(FixHue(_FaceHue));
				}

				first = false;
			}

			if (_Numbers)
			{
				for (var number = 1; number <= 12; number++)
				{
					AppendTo(disp, ref first, number, _NumbersColor);
				}
			}

			var center = new Point2D(_X + 40, _Y + 40);

			if (_Hours)
			{
				var ha = 2.0f * Math.PI * (_Time.Hour + _Time.Minute / 60.0f) / 12.0f;
				var hl = center.GetLine2D(center.Clone2D((int)(40 * Math.Sin(ha) / 1.5f), (int)(-40 * Math.Cos(ha) / 1.5f)));

				AppendTo(disp, ref first, hl, 3, _HoursColor);
			}

			if (_Minutes)
			{
				var ma = 2.0f * Math.PI * (_Time.Minute + _Time.Second / 60.0f) / 60.0f;
				var ml = center.GetLine2D(center.Clone2D((int)(40 * Math.Sin(ma)), (int)(-40 * Math.Cos(ma))));

				AppendTo(disp, ref first, ml, 3, _MinutesColor);
			}

			if (_Seconds)
			{
				var sa = 2.0f * Math.PI * _Time.Second / 60.0f;
				var sl = center.GetLine2D(center.Clone2D((int)(40 * Math.Sin(sa)), (int)(-40 * Math.Cos(sa))));

				AppendTo(disp, ref first, sl, 1, _SecondsColor);
			}

			if (first)
			{
				disp.AppendLayout(_Layout2A);
				disp.AppendLayout(_X);
				disp.AppendLayout(_Y);
				disp.AppendLayout(Width);
				disp.AppendLayout(Height);
				disp.AppendLayout(Parent.Intern(" ".WrapUOHtmlBG(Color.Transparent)));
				disp.AppendLayout(false);
				disp.AppendLayout(false);
			}
		}