Ejemplo n.º 1
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            base.CompileLayout(layout);

            layout.Remove("html/body/info");

            layout.Remove("background/body/base");
            layout.Remove("background/header/base");

            layout.Remove("label/header/title");

            layout.Add("background/body/base1", () => AddBackground(28, 0, Width, 150, 9270));

            layout.AddReplace("image/body/icon", () => AddImage(42, 47, Icon));

            layout.Add("image/body/doodad", () => AddImage(0, 6, 1227));

            layout.Add("image/body/waxseal", () => AddImage(57, 123, 9005));

            layout.Add(
                "label/body/content",
                () =>
                {
                    AddLabel(116, 54, 2049, "Would you like to join the queue");
                    AddLabel(116, 75, 2049, "for this battle?");
                });

            layout.Add("background/header/base1", () => AddBackground(28, 0, Width, 40, 9270));

            layout.Add("label/header/title1", () => AddLabel(44, 10, 52, Title));

            layout.AddReplace(
                "button/header/cancel",
                () =>
                {
                    AddButton(295, 6, 2640, 2641, OnCancel);
                    AddTooltip(1006045);
                });

            layout.AddReplace(
                "button/body/cancel",
                () =>
                {
                    AddButton(250, 108, 2119, 2120, OnCancel);
                    AddTooltip(1006045);
                });

            layout.AddReplace(
                "button/body/accept",
                () =>
                {
                    AddButton(176, 108, 2128, 2129, OnAccept);
                    AddTooltip(1006044);
                });
        }
Ejemplo n.º 2
0
		protected override void CompileLayout(SuperGumpLayout layout)
		{
			base.CompileLayout(layout);

			Width = 275;
			Height = 250;

            //Adds are not displaying properly unless they come before removes
            layout.Add("label/body/title", () => AddLabel(25, 75, 0, Title));

            if (_Value is Title)
            {
                CompileTitleLayout(layout, (Title)_Value);
            }
            else if (_Value is TitleHue)
            {
                CompileHueLayout(layout, (TitleHue)_Value);
            }

			layout.Remove("background/header/base");
			layout.Remove("html/body/info");
			layout.Remove("label/header/title");


			layout.AddReplace("background/body/base", () => AddBackground(0, 50, Width, Height, 5170));

			layout.AddReplace("image/body/icon", () => AddImage(20, 100, Icon));

			layout.AddReplace(
				"button/body/cancel",
				() =>
				{
					AddButton(Width - 90, Height - 10, 4018, 4019, OnCancel);
					AddTooltip(1006045);
				});

			layout.AddReplace(
				"button/body/accept",
				() =>
				{
					AddButton(Width - 50, Height - 10, 4015, 4016, OnAccept);
					AddTooltip(1006044);
				});
		}
Ejemplo n.º 3
0
		protected override void CompileLayout(SuperGumpLayout layout)
		{
			base.CompileLayout(layout);

			layout.Remove("button/body/cancel");
		}
Ejemplo n.º 4
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            base.CompileLayout(layout);

            layout.Remove("html/body/info");

            //Name
            layout.Add(
                "name",
                () =>
                {
                    AddLabel(100, 70, HighlightHue, "Name:");
                    AddBackground(100, 90, 150, 30, 9350);

                    if(LockMode)
                    {
                        AddLabelCropped(102, 100, 150, 20, ErrorHue, TemplateName);
                    }
                    else
                    {
                        AddTextEntryLimited(102, 100, 150, 20, TextHue, TemplateName, 20, (b, t) => TemplateName = t);
                    }
                });

            //Notes
            layout.Add(
                "notes",
                () =>
                {
                    AddLabel(25, 140, HighlightHue, "Notes:");
                    AddBackground(25, 160, 270, 125, 9350);

                    if(LockMode)
                    {
                        AddLabelCropped(27, 165, 265, 125, ErrorHue, TemplateName);
                    }
                    else
                    {
                        AddTextEntryLimited(27, 165, 265, 125, TextHue, TemplateNotes, 1000, (b, t) => TemplateNotes = t);
                    }
                });

            //Str
            layout.Add(
                "stat/str",
                () =>
                {
                    AddLabel(300, 100, HighlightHue, "Str:");
                    AddBackground(328, 100, 40, 20, 9350);

                    if(LockMode)
                    {
                        AddLabelCropped(330, 100, Width - 120, 20, ErrorHue, TemplateName);
                    }
                    else
                    {
                        AddTextEntryLimited(
                            330,
                            100,
                            Width - 120,
                            20,
                            TextHue,
                            TemplateStr.ToString(CultureInfo.InvariantCulture),
                            3,
                            (b, t) =>
                            {
                                int sStr;

                                if(Int32.TryParse(t, out sStr))
                                {
                                    TemplateStr = Math.Max(0, Math.Min(100, sStr));
                                }
                            });
                    }
                });

            //Dex
            layout.Add(
                "stat/dex",
                () =>
                {
                    AddLabel(300, 120, HighlightHue, "Dex:");
                    AddBackground(328, 120, 40, 20, 9350);

                    if(LockMode)
                    {
                        AddLabelCropped(330, 120, Width - 120, 20, ErrorHue, TemplateName);
                    }
                    else
                    {
                        AddTextEntryLimited(
                            330,
                            120,
                            Width - 120,
                            20,
                            TextHue,
                            TemplateDex.ToString(CultureInfo.InvariantCulture),
                            3,
                            (b, t) =>
                            {
                                int sDex;

                                if(Int32.TryParse(t, out sDex))
                                {
                                    TemplateDex = Math.Max(0, Math.Min(100, sDex));
                                }
                            });
                    }
                });

            //Int
            layout.Add(
                "stat/int",
                () =>
                {
                    AddLabel(300, 140, HighlightHue, "Int:");
                    AddBackground(328, 140, 40, 20, 9350);

                    if(LockMode)
                    {
                        AddLabelCropped(330, 140, Width - 120, 20, ErrorHue, TemplateName);
                    }
                    else
                    {
                        AddTextEntryLimited(
                            330,
                            140,
                            Width - 120,
                            20,
                            TextHue,
                            TemplateInt.ToString(CultureInfo.InvariantCulture),
                            3,
                            (b, t) =>
                            {
                                int sInt;

                                if(Int32.TryParse(t, out sInt))
                                {
                                    TemplateInt = Math.Max(0, Math.Min(100, sInt));
                                }
                            });
                    }
                });

            //menu
            layout.Add(
                "skills",
                () =>
                {
                    if(LockMode)
                    {
                        AddImage(300, 70, 2017);
                    }
                    else
                    {
                        AddButton(
                            300,
                            70,
                            2017,
                            2016,
                            button => Send(
                                new TemplateSkillsGump(User, this, 7, selected: TemplateSkills)
                                {
                                    Callback = skills =>
                                    {
                                        TemplateSkills = skills;
                                        Refresh(true);
                                    }
                                }));
                    }
                });
        }
Ejemplo n.º 5
0
		protected override void CompileLayout(SuperGumpLayout layout)
		{
			base.CompileLayout(layout);

			layout.Remove("background/body/input");
			layout.Remove("textentry/body/input");

			layout.Add(
				"background/body/input/month",
				() =>
				{
					AddHtml(20, Height - 45, 20, 20, "MM".WrapUOHtmlColor(HtmlColor), false, false);
					AddBackground(50, 250, 40, 30, 9350);
					AddTextEntryLimited(
						55,
						Height - 45,
						30,
						20,
						TextHue,
						0,
						InputDate.HasValue ? InputDate.Value.Month.ToString("D2") : String.Empty,
						2,
						ParseInput);
				});

			layout.Add(
				"background/body/input/day",
				() =>
				{
					AddHtml(100, Height - 45, 20, 20, "DD".WrapUOHtmlColor(HtmlColor), false, false);
					AddBackground(130, 250, 40, 30, 9350);
					AddTextEntryLimited(
						135,
						Height - 45,
						30,
						20,
						TextHue,
						1,
						InputDate.HasValue ? InputDate.Value.Day.ToString("D2") : String.Empty,
						2,
						ParseInput);
				});

			layout.Add(
				"background/body/input/year",
				() =>
				{
					AddHtml(180, Height - 45, 40, 20, "YYYY".WrapUOHtmlColor(HtmlColor), false, false);
					AddBackground(220, 250, 70, 30, 9350);
					AddTextEntryLimited(
						225,
						Height - 45,
						60,
						20,
						TextHue,
						2,
						InputDate.HasValue ? InputDate.Value.Year.ToString("D4") : String.Empty,
						4,
						ParseInput);
				});
		}
		protected override void CompileLayout(SuperGumpLayout layout)
		{
			base.CompileLayout(layout);

			layout.AddReplace(
				"background/header/base",
				() =>
				{
					AddBackground(0, 0, 970, 50, 9270);
					AddImageTiled(10, 10, 950, 30, 2624);
				});

			layout.AddReplace("label/header/close", () => AddLabel(900, 15, 1287, "Close"));

			layout.AddReplace("button/header/minimize", () => AddButton(940, 20, 10740, 10742, Close));

			layout.AddReplace(
				"label/header/winners",
				() => AddLabel(400, 14, HighlightHue, "Winners: " + String.Join(", ", Winners.Select(t => t.Name))));

			if (Minimized)
			{
				return;
			}

			layout.AddReplace("imagetiled/body/spacer", () => AddImageTiled(0, 50, 970, 10, 9274));

			Dictionary<int, KeyValuePair<PlayerMobile, PvPProfileHistoryEntry>> range = GetListRange();

			if (range.Count == 0)
			{
				layout.AddReplace(
					"background/body/base",
					() =>
					{
						AddBackground(0, 55, 960, 820, 9270);
						AddImageTiled(10, 65, 940, 800, 2624);
					});

				layout.Remove("imagetiled/body/vsep/0");
			}
			else
			{
				layout.AddReplace(
					"background/body/base",
					() =>
					{
                        AddBackground(0, 55, 970, 47 + (range.Count * 30), 9270);
						AddImageTiled(10, 65, 950, 25 + (range.Count * 30), 2624);
					});

				layout.Add(
					"sort/header/crystalpoints",
					() => AddButton(
						440,
						70,
						0x7d3,
						0x7d3,
						b =>
						{
							SortType = 6;
							Refresh(true);
						}));

				layout.Add("imagetiled/header/crystalpoints", () => AddImageTiled(440, 70, 130, 24, 2624));

				layout.Add("label/header/crystalpoints", () => AddLabel(440, 70, GetSelectedHue(6), "Crystal Points"));

				layout.Add(
					"sort/header/crystalassaults",
					() => AddButton(
						555,
						70,
						0x7d3,
						0x7d3,
						b =>
						{
							SortType = 7;
							Refresh(true);
						}));

				layout.Add("imagetiled/header/crystalassaults", () => AddImageTiled(555, 70, 130, 24, 2624));

				layout.Add("label/header/crystalassaults", () => AddLabel(555, 70, GetSelectedHue(7), "Crystal Assaults"));

				layout.AddReplace(
					"sort/header/brazierassault",
					() => AddButton(
						680,
						70,
						0x7d3,
						0x7d3,
						b =>
						{
							SortType = 8;
							Refresh(true);
						}));

				layout.AddReplace("imagetiled/header/brazierassault", () => AddImageTiled(680, 70, 130, 24, 2624));

				layout.AddReplace("label/header/brazierassault", () => AddLabel(680, 70, GetSelectedHue(8), "Brazier Captures"));

				layout.AddReplace(
					"sort/header/wallscast",
					() => AddButton(
						800,
						70,
						0x853,
						0x853,
						b =>
						{
							SortType = 9;
							Refresh(true);
						}));

				layout.AddReplace("imagetiled/header/wallscast", () => AddImageTiled(800, 70, 70, 24, 2624));

				layout.AddReplace("label/header/wallscast", () => AddLabel(800, 70, GetSelectedHue(9), "Walls Cast"));

				layout.AddReplace(
					"sort/header/pointsgained",
					() => AddButton(
						890,
						70,
						0x853,
						0x853,
						b =>
						{
							SortType = 5;
							Refresh(true);
						}));

				layout.AddReplace("imagetiled/header/pointsgained", () => AddImageTiled(890, 70, 70, 24, 2624));

				layout.AddReplace("label/header/pointsgained", () => AddLabel(890, 70, GetSelectedHue(5), "PvP Rating"));

				layout.AddReplace("imagetiled/header/hsep", () => AddImageTiled(10, 95, 950, 5, 9277));

				layout.AddReplace(
					"widget/body/scrollbar",
					() =>
					AddScrollbarH(
						6,
						46,
						PageCount,
						Page,
						PreviousPage,
						NextPage,
						new Rectangle2D(30, 0, 898, 13),
						new Rectangle2D(0, 0, 28, 13),
						new Rectangle2D(930, 0, 28, 13)));

				layout.Remove("imagetiled/body/vsep/0");
			}
		}
Ejemplo n.º 7
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            base.CompileLayout(layout);

            layout.Remove("button/body/cancel");
        }
Ejemplo n.º 8
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            base.CompileLayout(layout);

            layout.AddReplace(
                "background/header/base",
                () =>
            {
                AddBackground(0, 0, 970, 50, 9270);
                AddImageTiled(10, 10, 950, 30, 2624);
            });

            layout.AddReplace("label/header/close", () => AddLabel(900, 15, 1287, "Close"));

            layout.AddReplace("button/header/minimize", () => AddButton(940, 20, 10740, 10742, Close));

            layout.AddReplace(
                "label/header/winners",
                () => AddLabel(400, 14, HighlightHue, "Winners: " + String.Join(", ", Winners.Select(t => t.Name))));

            if (Minimized)
            {
                return;
            }

            layout.AddReplace("imagetiled/body/spacer", () => AddImageTiled(0, 50, 970, 10, 9274));

            Dictionary <int, KeyValuePair <PlayerMobile, PvPProfileHistoryEntry> > range = GetListRange();

            if (range.Count == 0)
            {
                layout.AddReplace(
                    "background/body/base",
                    () =>
                {
                    AddBackground(0, 55, 960, 820, 9270);
                    AddImageTiled(10, 65, 940, 800, 2624);
                });

                layout.Remove("imagetiled/body/vsep/0");
            }
            else
            {
                layout.AddReplace(
                    "background/body/base",
                    () =>
                {
                    AddBackground(0, 55, 970, 47 + (range.Count * 30), 9270);
                    AddImageTiled(10, 65, 950, 25 + (range.Count * 30), 2624);
                });

                layout.Add(
                    "sort/header/crystalpoints",
                    () => AddButton(
                        440,
                        70,
                        0x7d3,
                        0x7d3,
                        b =>
                {
                    SortType = 6;
                    Refresh(true);
                }));

                layout.Add("imagetiled/header/crystalpoints", () => AddImageTiled(440, 70, 130, 24, 2624));

                layout.Add("label/header/crystalpoints", () => AddLabel(440, 70, GetSelectedHue(6), "Crystal Points"));

                layout.Add(
                    "sort/header/crystalassaults",
                    () => AddButton(
                        555,
                        70,
                        0x7d3,
                        0x7d3,
                        b =>
                {
                    SortType = 7;
                    Refresh(true);
                }));

                layout.Add("imagetiled/header/crystalassaults", () => AddImageTiled(555, 70, 130, 24, 2624));

                layout.Add("label/header/crystalassaults", () => AddLabel(555, 70, GetSelectedHue(7), "Crystal Assaults"));

                layout.AddReplace(
                    "sort/header/brazierassault",
                    () => AddButton(
                        680,
                        70,
                        0x7d3,
                        0x7d3,
                        b =>
                {
                    SortType = 8;
                    Refresh(true);
                }));

                layout.AddReplace("imagetiled/header/brazierassault", () => AddImageTiled(680, 70, 130, 24, 2624));

                layout.AddReplace("label/header/brazierassault", () => AddLabel(680, 70, GetSelectedHue(8), "Brazier Captures"));

                layout.AddReplace(
                    "sort/header/wallscast",
                    () => AddButton(
                        800,
                        70,
                        0x853,
                        0x853,
                        b =>
                {
                    SortType = 9;
                    Refresh(true);
                }));

                layout.AddReplace("imagetiled/header/wallscast", () => AddImageTiled(800, 70, 70, 24, 2624));

                layout.AddReplace("label/header/wallscast", () => AddLabel(800, 70, GetSelectedHue(9), "Walls Cast"));

                layout.AddReplace(
                    "sort/header/pointsgained",
                    () => AddButton(
                        890,
                        70,
                        0x853,
                        0x853,
                        b =>
                {
                    SortType = 5;
                    Refresh(true);
                }));

                layout.AddReplace("imagetiled/header/pointsgained", () => AddImageTiled(890, 70, 70, 24, 2624));

                layout.AddReplace("label/header/pointsgained", () => AddLabel(890, 70, GetSelectedHue(5), "PvP Rating"));

                layout.AddReplace("imagetiled/header/hsep", () => AddImageTiled(10, 95, 950, 5, 9277));

                layout.AddReplace(
                    "widget/body/scrollbar",
                    () =>
                    AddScrollbarH(
                        6,
                        46,
                        PageCount,
                        Page,
                        PreviousPage,
                        NextPage,
                        new Rectangle2D(30, 0, 898, 13),
                        new Rectangle2D(0, 0, 28, 13),
                        new Rectangle2D(930, 0, 28, 13)));

                layout.Remove("imagetiled/body/vsep/0");
            }
        }
Ejemplo n.º 9
0
        protected override void CompileEntryLayout(
            SuperGumpLayout layout, int length, int index, int pIndex, int yOffset, Template entry)
        {
            if (Profile == null)
            {
                return;
            }

            yOffset = yOffset + pIndex * 192;

            base.CompileEntryLayout(layout, length, index, pIndex, yOffset, entry);

            layout.Add("imagetiled/entry/vtit/" + index, () => AddImageTiled(100, yOffset - 4, 5, 25, 9275));
            layout.Add("imagetiled/entry/htit/" + index, () => AddImageTiled(10, yOffset + 20, 93, 5, 9277));

            //Deletes a template
            layout.Add("button/list/delete/" + index,
                       () => AddButton(379, yOffset - 3, 4017, 4018, b => DeleteEntry(entry)));

            layout.Remove("button/list/select/" + index);
            layout.AddReplace(
                "label/list/entry/" + index,
                () =>
                AddLabelCropped(15, yOffset, 75, 50, GetLabelHue(index, pIndex, entry),
                                GetLabelText(index, pIndex, entry)));

            //START STATS
            layout.Add(
                "label/list/entry/stats1" + index,
                () => AddLabelCropped(110, yOffset, 75, 50, 33, "Str: " + entry.Stats[StatType.Str]));

            layout.Add(
                "label/list/entry/stats2" + index,
                () => AddLabelCropped(180, yOffset, 75, 50, 33, "Dex: " + entry.Stats[StatType.Dex]));

            layout.Add(
                "label/list/entry/stats3" + index,
                () => AddLabelCropped(250, yOffset, 75, 50, 33, "Int: " + entry.Stats[StatType.Int]));
            //END STATS

            layout.Add(
                "html/body/info" + index,
                () => AddHtml(103, yOffset + 22, 190, 185, entry.Notes.ParseBBCode(DefaultHtmlColor, 3), true, true));

            layout.Add("image/list/entry/skills" + index, () => AddImage(310, yOffset, 2105));

            int iconIndex = 0;
            int idx       = 0;

            foreach (SkillName skill in entry.GetActiveSkills())
            {
                int    subIndex  = ++idx;
                string skillName = Profile.Owner != null
                    ? Profile.Owner.Skills[skill].Name
                    : skill.ToString().SpaceWords();

                layout.Add(
                    "label/list/entry/skill/" + index + "/" + subIndex,
                    () =>
                    AddLabelCropped(320, yOffset + (23 * subIndex), 80, 50, GetLabelHue(index, pIndex, entry),
                                    skillName));

                if ((iconIndex != 0 && iconIndex != 1) ||
                    (skill != SkillName.Macing && skill != SkillName.Archery && skill != SkillName.Fencing &&
                     skill != SkillName.Swords && skill != SkillName.Magery))
                {
                    continue;
                }

                int ySubOffset = 0;

                switch (++iconIndex)
                {
                case 1:
                    ySubOffset = yOffset + 23;
                    break;

                case 2:
                    ySubOffset = yOffset + 88;
                    break;
                }

                layout.Add(
                    "image/list/entry/skillicon/" + index + "/" + iconIndex,
                    () => AddImage(11, ySubOffset, GetIcon(skill), 0));
            }

            layout.Add(
                "button/list/choose/" + index,
                () => AddButton(15, yOffset + 165, 2124, 2122, button => SelectEntry(button, entry)));


            layout.Add(
                "button/list/choose/edit" + index,
                () =>
                AddButton(18, yOffset + 190, 4024, 4025,
                          b => Send(new ManageTemplateGump(User, Hide(true), Profile, entry)
            {
                AcceptHandler = a => Refresh(true),
                CancelHandler = c => Refresh(true)
            })));

            layout.Add("label/list/entry/edit" + index, () => AddLabelCropped(52, yOffset + 192, 75, 50, 33, "Edit"));

            if (pIndex < (length))
            {
                layout.AddReplace("imagetiled/body/hsep/" + index, () => AddImageTiled(10, yOffset - 8, 400, 5, 9277));
            }
        }