protected override void CompileLayout(SuperGumpLayout layout)
        {
            layout.Add(
                "background",
                () =>
                {
                    AddImageTiled(40, 80, 44, 458, 202);
                    AddImage(40, 39, 206);
                    AddImageTiled(80, 38, 422, 45, 201);
                    AddImage(40, 538, 204);
                    AddImageTiled(495, 71, 44, 469, 203);
                    AddImage(496, 39, 207);
                    AddImageTiled(84, 539, 417, 43, 233);
                    AddImageTiled(75, 82, 446, 459, 200);
                    AddImage(171, 16, 1419);
                    AddImage(248, -1, 1417);
                    AddImage(257, 8, 5545);
                    AddImage(496, 538, 205);
                });
            layout.Add("Help",
                () =>
                {
                    AddImageTiled(81, 92, 420, 12, 50);
                    AddHtml(126, 74, 325, 17,
                        String.Format("<BIG>{0}</BIG>", "Ultima Online: Forever Information System")
                            .WrapUOHtmlColor(KnownColor.GhostWhite), false, false);

                    AddImageTiled(81, 104, 404, 413, 2624);
                    AddHtml(86, 103, 414, 413, HTML, false, true);

                    AddImageTiled(81, 518, 420, 12, 50);
                });
        }
Пример #2
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            layout.Add(
                "background",
                () =>
            {
                AddBackground(0, 40, 617, 313, 2600);
                AddBackground(50, 85, 517, 224, 9270);
                AddBackground(63, 97, 492, 200, 9200);
                AddBackground(69, 117, 482, 176, 9350);
                AddLabel(52, 67, 0, @"Donation Entries for " + SelectedDonationProfile.Email);
                AddLabel(74, 99, 0, @"Date");
                AddLabel(175, 99, 0, @"Character Name");
                AddLabel(324, 99, 0, @"Amount Donated");
                AddLabel(460, 99, 0, @"Coins Given");

                if (PageCount - 1 > Page)
                {
                    AddButton(524, 278, 2224, 2224, NextPage);
                }

                if (Page > 0)
                {
                    AddButton(493, 278, 2223, 2223, PreviousPage);
                }
            });

            Dictionary <int, DonationEntry> range = GetListRange();

            if (range.Count > 0)
            {
                CompileEntryLayout(layout, range);
            }
        }
Пример #3
0
        protected virtual void CompileEntry(SuperGumpLayout layout, int x, int y, int idx, int hue)
        {
            if (hue <= -1)
            {
                return;
            }

            var xOffset = 120 + (x * 44);
            var yOffset = 50 + (y * 44);

            layout.Add(
                "entry/" + idx,
                () =>
            {
                const int itemID = 4011;
                var s            = Selected == hue;

                AddButton(xOffset, yOffset, 24024, 24024, b => SelectEntry(x, y, idx, hue));
                AddImageTiled(xOffset, yOffset, 44, 44, 2702);

                if (s)
                {
                    AddItem(xOffset, yOffset + 5, itemID, 2050);
                    AddItem(xOffset, yOffset + 2, itemID, 1);
                }

                AddItem(xOffset, yOffset, itemID, hue);
            });
        }
Пример #4
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            base.CompileLayout(layout);

            layout.Add(
                "button/header/war",
                () => AddButton(
                    85,
                    15,
                    2026,
                    2025,
                    b =>
            {
                if (Parent is PvPBattleListGump)
                {
                    ((PvPBattleListGump)Parent).Refresh(true);
                }
                else if (Parent is PvPBattleCategoryListGump)
                {
                    ((PvPBattleCategoryListGump)Parent).Refresh(true);
                }
                else
                {
                    Send(new PvPBattleCategoryListGump(User, Hide(true), UseConfirmDialog));
                }
            }));

            layout.AddReplace(
                "label/header/title",
                () => AddLabelCropped(160, 15, 215, 20, GetTitleHue(), String.IsNullOrEmpty(Title) ? DefaultTitle : Title));
        }
Пример #5
0
        protected override void CompileEntryLayout(
            SuperGumpLayout layout, int length, int index, int pIndex, int yOffset, Level entry)
        {
            yOffset = 180 + pIndex * 20;

            layout.Add(
                "entry" + index,
                () =>
            {
                AddLabel(382, yOffset, 0, "#" + (index + 1));
                AddLabel(429, yOffset, 0, entry.Creatures.Count.ToString());
                AddLabel(500, yOffset, 0, entry.TimeLimit.ToString());
                AddLabel(576, yOffset, 0, entry.KillAmount.ToString());
                AddButton(615, yOffset - 2, 4023, 4024, b => Send(new EditLevelUI(User, Hide(true), entry)
                {
                    AcceptHandler = a => { Refresh(true); },
                    CancelHandler = c => Refresh(true)
                }));
                AddButton(654, yOffset + 3, 2181, 2181, b =>
                {
                    Levels.Remove(entry);
                    Refresh(true);
                });
            });
        }
Пример #6
0
        protected virtual void CompileEntry(SuperGumpLayout layout, int x, int y, int idx, RuneCodexEntry entry)
        {
            var ui = UI;

            if (x >= ui.Category.Entries.Width || y >= ui.Category.Entries.Height)
            {
                return;
            }

            layout.Add(
                "entry/" + idx,
                () =>
            {
                ui = UI;

                int xOffset = 220 + (x * 70);
                int yOffset = 50 + (y * 70);
                int gx      = x + ui.EntryScroll.X;
                int gy      = y + ui.EntryScroll.Y;

                const int itemID = 7956;
                bool s           = entry != null && ui.Entry == entry;

                if (entry != null)
                {
                    AddButton(xOffset + 5, yOffset + 5, 24024, 24024, b => SelectEntry(gx, gy, idx, entry));
                }
                else if (Codex.CanAddEntries(User))
                {
                    AddButton(xOffset + 5, yOffset + 5, 24024, 24024, b => AddEntry(gx, gy, idx));
                }

                AddImageTiled(xOffset, yOffset, 60, 60, 2702);

                if (s)
                {
                    AddItem(xOffset + 10, yOffset + 4, itemID, 2050);
                    AddItem(xOffset + 10, yOffset + 2, itemID, 1);
                }

                if (entry != null)
                {
                    AddItem(xOffset + 10, yOffset, itemID, ui.Category.Hue);
                    AddHtml(
                        xOffset,
                        yOffset + 25,
                        60,
                        40,
                        GetEntryLabel(entry).WrapUOHtmlTag("center").WrapUOHtmlColor(Color.LawnGreen, false),
                        false,
                        false);
                }
                else if (Codex.CanAddEntries(User))
                {
                    AddImage(xOffset + 25, yOffset, 2511, HighlightHue);
                    AddHtml(
                        xOffset, yOffset + 25, 60, 40, "Add".WrapUOHtmlTag("center").WrapUOHtmlColor(Color.Yellow, false), false, false);
                }
            });
        }
Пример #7
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            base.CompileLayout(layout);

            layout.Add(
                "button/header/war",
                () => AddButton(
                    85,
                    15,
                    2026,
                    2025,
                    b =>
            {
                PvPProfileListGump plg = Parent as PvPProfileListGump;

                if (plg == null)
                {
                    Send(new PvPProfileListGump(User, null, Hide(true), UseConfirmDialog));
                }
                else
                {
                    plg.Refresh(true);
                }
            }));

            layout.AddReplace(
                "label/header/title",
                () => AddLabelCropped(160, 15, 215, 20, GetTitleHue(), String.IsNullOrWhiteSpace(Title) ? DefaultTitle : Title));
        }
Пример #8
0
            public void CompileEntryLayout(SuperGumpLayout layout, int index, InquisitionPath entry)
            {
                layout.Add(
                    "sprite/" + index,
                    xpath =>
                {
                    Point3D cur = entry.Current;

                    if (entry.Value is string)
                    {
                        AddHtml(cur.X, cur.Y, 200, 200, (string)entry.Value, false, false);
                    }
                    else if (entry.Value is Pair <bool, int> )
                    {
                        var pair = (Pair <bool, int>)entry.Value;

                        if (pair.Left)
                        {
                            AddItem(cur.X, cur.Y, pair.Right, 0);
                        }
                        else
                        {
                            AddImage(cur.X, cur.Y, pair.Right, 0);
                        }
                    }
                });
            }
Пример #9
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            base.CompileLayout(layout);

            int x, y, w, h;

            GetBounds(out x, out y, out w, out h);

            var c = new Point2D(x + (w / 2), y + (h / 2));

            layout.Add("clock/bg", () => AddBackground(x - 15, y - 15, w + 30, h + 30, 2620));

            if (DisplayNumerals)
            {
                CompileNumerals(layout, c);
            }

            if (DisplayHourHand)
            {
                CompileHourHand(layout, c);
            }

            if (DisplayMinuteHand)
            {
                CompileMinuteHand(layout, c);
            }

            if (DisplaySecondHand)
            {
                CompileSecondHand(layout, c);
            }
        }
Пример #10
0
        protected virtual void CompileOptionsLayout(SuperGumpLayout layout, int x, int y, int w, int h, int bw)
        {
            if (Frame < FrameCount || Options.Count == 0 || OptionsCols * OptionsRows <= 0)
            {
                return;
            }

            layout.Add("opts", () => AddRectangle(x, y, w, h, Color.Black, true));

            var oi = 0;
            var ox = x;
            var oy = y;

            foreach (var ob in Options)
            {
                CompileOptionLayout(layout, oi, ox, oy, bw, 20, ob);

                if (++oi % OptionsCols == 0)
                {
                    ox  = x;
                    oy += 20;
                }
                else
                {
                    ox += bw;
                }
            }
        }
 protected override void CompileLayout(SuperGumpLayout layout)
 {
     layout.Add(
         "background/main/",
         () =>
         {
             AddBackground(0, 0, 384, 443, 9200);
             AddItem(296, 22, 18491);
             AddItem(296, 65, 18494);
             AddItem(296, 108, 18497);
             AddItem(296, 151, 18515);
             AddLabel(145, 231, 1258, @"The Soulforge");
             AddHtml(5, 251, 372, 190, @"With your skilled eyes, you quickly recognize the runes on the base of the ancient hammer as relating to legends about the Soulforge.  On your journey to hone your crafting skills, you have encountered various books dedicated to discussing this legend.  While most think it a fairy tale, this anicent smithing hammer tells you there may be some credince to the legend after all.  You decide that it may be best to seek out one familiar with the legend of the Soulforge for further guidance.  A good place to start would be the Britain Library.  Perhaps Llewellyn, the Royal Archivist, could be of some assistance.".WrapUOHtmlTag("BIG"), true, true);
             AddItem(296, 194, 18518);
             AddItem(118, 64, 17003);
             AddItem(186, 20, 16996);
             AddItem(140, 20, 16999);
             AddItem(211, 64, 16997);
             AddItem(163, 8, 16995);
             AddItem(164, 32, 17000);
             AddItem(187, 74, 17001);
             AddItem(96, 65, 17007);
             AddItem(141, 74, 17004);
             AddItem(233, 65, 16998);
             AddItem(164, 97, 17005);
             AddItem(210, 72, 17002);
             AddItem(187, 115, 17006);
             AddItem(118, 72, 17008);
             AddItem(141, 116, 17009);
             AddItem(164, 121, 17010);
             AddButton(353, 8, 4017, 4020, OnCancel);
         });
 }
Пример #12
0
        protected override void CompileEntryLayout(
            SuperGumpLayout layout,
            int length,
            int index,
            int pIndex,
            int yOffset,
            KeyValuePair <PlayerMobile, int> entry)
        {
            base.CompileEntryLayout(layout, length, index, pIndex, yOffset, entry);

            yOffset += 170;

            layout.Remove("button/list/select/" + index);
            layout.AddReplace(
                "label/list/entry/" + index,
                () => AddLabel(92, yOffset, GetLabelHue(index, pIndex, entry), entry.Key.RawName));

            layout.Add(
                "label/list/entry/points/" + index,
                () => AddLabel(355, yOffset, GetLabelHue(index, pIndex, entry), entry.Value.ToString()));

            if (pIndex < (length - 1))
            {
                layout.Remove("imagetiled/body/hsep/" + index);
            }
        }
Пример #13
0
        protected virtual void CompileOptionLayout(
            SuperGumpLayout layout,
            int index,
            int x,
            int y,
            int w,
            int h,
            NotifyGumpOption option)
        {
            layout.Add(
                "opts/" + index,
                () =>
            {
                AddHtmlButton(
                    x,
                    y,
                    w,
                    h,
                    b =>
                {
                    if (option.Callback != null)
                    {
                        option.Callback(b);
                    }

                    Refresh();
                },
                    option.GetString(User),
                    option.LabelColor,
                    option.FillColor,
                    option.BorderColor,
                    1);
            });
        }
Пример #14
0
		protected override void CompileLayout(SuperGumpLayout layout)
		{
            layout.Add("body", () =>
            {
                AddBackground(0, 0, 275, 263, 5170);
                AddImage(24, 29, 23001);
                AddLabel(89, 43, 1271, "UO Forever Skill Scroll");
                AddLabel(24, 88, 0, "This scroll entitles the bearer or one");
                AddLabel(24, 108, 0, "of their pets to:");

                AddImageTiled(74, 151, 120, 2, 2620);
                AddLabel(75, 134, 1258, _SkillScroll.SkillName + ": +" + _SkillScroll.SkillBonus);
                AddItem(37, 134, _SkillScroll.ItemID, _SkillScroll.Hue);

                AddLabel(35, 164, 0, "Who do you wish to use this on?");

                AddLabel(47, 189, 1258, "Yourself?");
                AddButton(58, 211, 4023, 4025, b =>
                {
                    _SkillScroll.ApplySkilltoPlayer(User);
                });

                AddLabel(184, 189, 1258, "A pet?");
                AddButton(188, 211, 4023, 4025, b =>
                {
                    User.Target = new MobileSelectTarget<Mobile>((m, t) => _SkillScroll.GetPet(m, t), m => { });
                });
            });

		}
Пример #15
0
        protected override void CompileEntryLayout(
            SuperGumpLayout layout,
            int length,
            int index,
            int pIndex,
            int yOffset,
            KeyValuePair <PlayerMobile, PvPProfileHistoryEntry> entry)
        {
            base.CompileEntryLayout(layout, length, index, pIndex, yOffset, entry);

            yOffset += 30;

            layout.Remove("button/list/select/" + index);

            layout.AddReplace(
                "label/list/entry/" + index, () => AddLabel(15, yOffset, GetLabelHue(index, pIndex, entry), entry.Key.RawName));

            layout.Add(
                "label/list/entry/kills/" + index,
                () => AddLabel(125, yOffset, GetLabelHue(index, pIndex, entry), entry.Value.Kills.ToString("#,0")));

            layout.Add(
                "label/list/entry/deaths/" + index,
                () => AddLabel(175, yOffset, GetLabelHue(index, pIndex, entry), entry.Value.Deaths.ToString("#,0")));

            layout.Add(
                "label/list/entry/damagedone/" + index,
                () => AddLabel(240, yOffset, GetLabelHue(index, pIndex, entry), entry.Value.DamageDone.ToString("#,0")));

            layout.Add(
                "label/list/entry/healingdone/" + index,
                () => AddLabel(340, yOffset, GetLabelHue(index, pIndex, entry), entry.Value.HealingDone.ToString("#,0")));

            layout.Add(
                "label/list/entry/pointsgained/" + index,
                () =>
                AddLabel(
                    440,
                    yOffset,
                    GetLabelHue(index, pIndex, entry),
                    (entry.Value.PointsGained - entry.Value.PointsLost).ToString("#,0")));

            if (pIndex < (length - 1))
            {
                layout.Remove("imagetiled/body/hsep/" + index);
            }
        }
Пример #16
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            base.CompileLayout(layout);

            layout.Add(
                "textentry/body/question",
                () => AddLabelCropped(25, Height - 45, Width - 80, 20, HighlightHue, "Accept or Decline?"));
        }
Пример #17
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            layout.Add(
                "background/main/",
                () =>
                {
                    AddBackground(0, 0, 374, 256, 9380);
                });
            layout.Add(
                "HTML/main/",
                () =>
                {
                    AddHtml(30, 43, 319, 250, String.Format(_Html)
						  .WrapUOHtmlTag("BIG")
						  .WrapUOHtmlColor(Color.DarkRed, false), false, false);
                });
        }
Пример #18
0
		protected override void CompileLayout(SuperGumpLayout layout)
		{
			base.CompileLayout(layout);

			layout.Add(
				"textentry/body/question",
				() => AddLabelCropped(25, Height - 45, Width - 80, 20, HighlightHue, "Accept or Decline?"));
		}
Пример #19
0
 protected override void CompileLayout(SuperGumpLayout layout)
 {
     layout.Add(
         "background/main/",
         () =>
     {
         AddBackground(0, 0, 374, 256, 9380);
     });
     layout.Add(
         "HTML/main/",
         () =>
     {
         AddHtml(30, 43, 319, 250, String.Format(_Html)
                 .WrapUOHtmlTag("BIG")
                 .WrapUOHtmlColor(Color.DarkRed, false), false, false);
     });
 }
Пример #20
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            base.CompileLayout(layout);

            layout.Add(
                "frame",
                () =>
            {
                if (BorderSize > 0 && BorderID >= 0)
                {
                    AddImageTiled(0, 0, FrameWidth, FrameHeight, BorderID);

                    if (BorderAlpha)
                    {
                        AddAlphaRegion(0, 0, FrameWidth, FrameHeight);
                    }
                }

                var fw = FrameWidth - (BorderSize * 2);
                var fh = FrameHeight - (BorderSize * 2);

                if (fw * fh > 0 && BackgroundID > 0)
                {
                    AddImageTiled(BorderSize, BorderSize, fw, fh, BackgroundID);

                    if (BackgroundAlpha)
                    {
                        AddAlphaRegion(BorderSize, BorderSize, fw, fh);
                    }
                }

                if (Frame < FrameCount)
                {
                    return;
                }

                AddButton(FrameWidth - BorderSize, (FrameHeight / 2) - 8, 22153, 22155, OnSettings);

                var x = BorderSize + 2 + HtmlIndent;
                var y = BorderSize + 2;
                var w = fw - (4 + HtmlIndent);
                var h = fh - (4 + OptionsSize.Height);

                var html = Html.ParseBBCode(HtmlColor).WrapUOHtmlColor(HtmlColor, false);

                AddHtml(x, y, w, h, html, false, (HtmlSize.Height - 4) > h);
            });

            if (Frame >= FrameCount && Options.Count > 0)
            {
                var x = BorderSize + 2;
                var y = BorderSize + HtmlSize.Height + 2;
                var w = OptionsSize.Width - 4;
                var h = OptionsSize.Height - 4;

                CompileOptionsLayout(layout, x, y, w, h, w / OptionsCols);
            }
        }
Пример #21
0
        public virtual void CompileLayout(UOFCentralGump g, SuperGumpLayout layout)
        {
            if (g == null || layout == null)
            {
                return;
            }

            // Page Bounds: (110, 120 -> 540, 370) (430 x 250)

            if (g.Edit)
            {
                layout.Add(
                    "page/title",
                    () =>
                {
                    g.AddImageTiled(120, 130, 410, 25, 2624);
                    g.AddButton(
                        120,
                        130,
                        2640,
                        2641,
                        b =>
                    {
                        Title = String.Empty;
                        g.Refresh(true);
                    });
                    g.AddTooltip(ButtonIconInfo.GetTooltip(ButtonIcon.Clear));
                    g.AddImageTiled(150, 153, 380, 2, 30072);
                    g.AddTextEntryLimited(155, 130, 370, 25, g.TextHue, Title, 100, (e, t) => Title = t ?? String.Empty);
                });
            }
            else
            {
                layout.Add(
                    "page/title",
                    () =>
                {
                    string title = Title.ParseBBCode(TitleColor.ToColor()).WrapUOHtmlTag("CENTER").WrapUOHtmlColor(TitleColor, false);

                    g.AddImageTiled(120, 130, 410, 25, 2624);
                    g.AddImageTiled(120, 153, 410, 2, 30072);
                    g.AddHtml(125, 130, 400, 40, title, false, false);
                });
            }
        }
Пример #22
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            base.CompileLayout(layout);

            layout.Replace("panel/right/overlay", () => AddImageTiled(265, 68, Width - 290, Height - 50, 2624));

            layout.Add(
                "cpanel",
                () =>
            {
                var x = 0;
                var y = Height + 43;
                var w = Width;

                AddBackground(x, y, w, 150, 9260);

                AddBackground(x + 15, y + 15, 234, 120, 9270);
                AddImageTiled(x + 25, y + 25, 214, 100, 1280);

                var use = String.Format("Use {0} Filter", UseOwnFilter ? "Main" : "My");

                AddButton(
                    x + 25,
                    y + 25,
                    4006,
                    4007,
                    b =>
                {
                    UseOwnFilter = !UseOwnFilter;
                    Refresh(true);
                });                                 // Use [My|Book] Filter
                AddHtml(x + 60, y + 27, 164, 40, FormatText(Color.Goldenrod, use), false, false);

                AddButton(
                    x + 25,
                    y + 50,
                    4021,
                    4022,
                    b =>
                {
                    Filter.Clear();
                    Refresh(true);
                });                                 //Clear
                AddHtml(x + 60, y + 52, 164, 40, FormatText(Color.OrangeRed, "Clear"), false, false);

                AddButton(x + 25, y + 75, 4024, 4025, Close);                         //Apply
                AddHtml(x + 60, y + 77, 164, 40, FormatText(Color.Gold, "Apply"), false, false);

                x += 239;

                AddBackground(x + 15, y + 15, w - 270, 120, 9270);
                AddImageTiled(x + 25, y + 25, w - 290, 100, 1280);

                AddHtml(x + 30, y + 25, w - 295, 100, GetFilteringText(), false, true);
            });
        }
Пример #23
0
        protected virtual void CompileCategory(SuperGumpLayout layout, int x, int y, int idx, RuneCodexCategory cat)
        {
            if (x >= Codex.Categories.Width || y >= Codex.Categories.Height)
            {
                return;
            }

            layout.Add(
                "cat/" + idx,
                () =>
            {
                int xOffset = 220 + (x * 70);
                int yOffset = 50 + (y * 70);
                int gx      = x + UI.CategoryScroll.X;
                int gy      = y + UI.CategoryScroll.Y;

                const int itemID = 8901;
                bool s           = cat != null && UI.Category == cat;

                if (cat != null)
                {
                    AddButton(xOffset + 5, yOffset + 5, 24024, 24024, b => SelectCategory(gx, gy, idx, cat));
                }
                else if (Codex.CanAddCategories(User))
                {
                    AddButton(xOffset + 5, yOffset + 5, 24024, 24024, b => AddCategory(gx, gy, idx));
                }

                AddImageTiled(xOffset, yOffset, 60, 60, 2702);

                if (s)
                {
                    AddItem(xOffset + 10, yOffset + 4, itemID, 2050);
                    AddItem(xOffset + 10, yOffset + 2, itemID, 1);
                }

                if (cat != null)
                {
                    AddItem(xOffset + 10, yOffset, itemID, cat.Hue);
                    AddHtml(
                        xOffset,
                        yOffset + 25,
                        60,
                        40,
                        GetCategoryLabel(cat).WrapUOHtmlTag("center").WrapUOHtmlColor(Color.LawnGreen, false),
                        false,
                        false);
                }
                else if (Codex.CanAddCategories(User))
                {
                    AddImage(xOffset + 25, yOffset, 2511, HighlightHue);
                    AddHtml(
                        xOffset, yOffset + 25, 60, 40, "Add".WrapUOHtmlTag("center").WrapUOHtmlColor(Color.Yellow, false), false, false);
                }
            });
        }
Пример #24
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            base.CompileLayout(layout);

            if (!Minimized)
            {
                layout.Add(
                    "html/body/base", () => AddHtml(15, 65, Width - 30, Height - 30, Html.ParseBBCode(HtmlColor), HtmlBackground, true));
            }
        }
Пример #25
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            base.CompileLayout(layout);

            layout.Add("background/header", () => AddBackground(46, 25, 500, 50, 9270));

            layout.Add("background/body", () => AddBackground(45, 68, 500, 300, 9270));

            layout.Add("background/footer", () => AddBackground(45, 362, 500, 60, 9270));

            layout.Add("label/title", () => AddLabel(67, 39, 152, @"Donation Profile for " + Profile.Account.Username));

            if (Page > 0)             //Display Previous Button
            {
                layout.Add(
                    "button/prev",
                    () =>
                {
                    AddButton(63, 381, 4015, 4016, PreviousPage);
                    AddTooltip(1011067);
                });
            }
            else
            {
                layout.Add("image/prev", () => AddImage(63, 381, 4014));
            }

            layout.Add(
                "label/pages",
                () => AddLabel(251, 381, 152, String.Format("Page {0:#,#} of {1:#,#} ({2:#,#})", Page + 1, PageCount, List.Count)));

            if (Page + 1 < PageCount)             //Display Next Button
            {
                layout.Add(
                    "button/next",
                    () =>
                {
                    AddButton(497, 381, 4006, 4007, NextPage);
                    AddTooltip(1011066);
                });
            }
            else
            {
                layout.Add("image/next", () => AddImage(497, 381, 4005));
            }

            CompileEntryLayout(layout, GetListRange());
        }
Пример #26
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            layout.Add(
                "communitycards",
                () =>
            {
                #region Community Cards
                var cardcount = _Game.CommunityCards.Count;
                if (cardcount > 0)
                {
                    int nextX = CardX;

                    if (cardcount > 2)
                    {
                        //must use count - 2 because you want to account for first 2 cards
                        nextX = CardX - (15 * (cardcount - 2));
                    }

                    foreach (var card in _Game.CommunityCards)
                    {
                        AddBackground(nextX, CardY, 71, 95, 9350);
                        AddLabel(nextX + 10, CardY + 5, card.GetSuitColor(), card.GetRankLetter());
                        AddLabel(nextX + 6, CardY + 25, card.GetSuitColor(), card.GetSuitString());

                        nextX += 30;
                    }
                }
                #endregion


                var pot = _Game.PokerPots.FirstOrDefault();
                if (pot != null)
                {
                    var sum = _Game.PokerPots.Sum(x => x.GetTotalCurrency());

                    if (sum > 0)
                    {
                        AddBackground(CardX - 35, CardY + 62, 167, 34, 5120);

                        AddHtml(CardX - 35, CardY + 71, 175, 22,
                                String.Format("<BIG><CENTER>{0:n0}</CENTER></BIG>",
                                              pot.GetTotalCurrency()).WrapUOHtmlColor(Color.Gold),
                                false,
                                false);
                    }
                }
            });

            var range = GetListRange();

            if (range.Count > 0)
            {
                CompileEntryLayout(layout, range);
            }
        }
Пример #27
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            base.CompileLayout(layout);

            Width  = Math.Max(300, Math.Min(1024, Width));
            Height = Math.Max(200, Math.Min(786, Height));

            layout.Add(
                "background/header/base",
                () =>
            {
                AddBackground(0, 0, Width, 50, 9270);
                AddImageTiled(10, 10, Width - 20, 30, 2624);
                //AddAlphaRegion(10, 10, Width - 20, 30);
            });

            layout.Add("label/header/title", () => AddLabelCropped(20, 15, Width - 40, 20, TextHue, Title));

            layout.Add(
                "background/body/base",
                () =>
            {
                AddBackground(0, 50, Width, Height - 50, 9270);
                AddImageTiled(10, 60, Width - 20, Height - 70, 2624);
                //AddAlphaRegion(10, 60, Width - 20, Height - 70);
            });

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

            layout.Add(
                "html/body/info",
                () =>
                AddHtml(
                    100,
                    70,
                    Width - 120,
                    Height - 130,
                    String.Format("<BIG><BASEFONT COLOR=#{0:X6}>{1}</BIG>", HtmlColor.ToArgb(), Html),
                    HtmlBackground,
                    true));

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

            layout.Add(
                "button/body/accept",
                () =>
            {
                AddButton(Width - 50, Height - 45, 4015, 4016, OnAccept);
                AddTooltip(1006044);
            });
        }
Пример #28
0
            protected override void CompileLayout(SuperGumpLayout layout)
            {
                base.CompileLayout(layout);

                layout.Add("bg", () => AddImage(0, 0, 1422));

                for (var i = 0; i < Altar.HeadMax; i++)
                {
                    CompileEntryLayout(layout, 65 + (54 * i), 160, i);
                }
            }
Пример #29
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            base.CompileLayout(layout);

            layout.Add("background/body/input", () => AddBackground(20, Height - 50, Width - 120, 30, 9350));

            layout.Add(
                "textentry/body/input",
                () =>
            {
                if (Limited)
                {
                    AddTextEntryLimited(25, Height - 45, Width - 130, 20, TextHue, InputText, Limit, ParseInput);
                }
                else
                {
                    AddTextEntry(25, Height - 45, Width - 130, 20, TextHue, InputText, ParseInput);
                }
            });
        }
Пример #30
0
        protected override void CompileEntryLayout(SuperGumpLayout layout, Dictionary <int, PvPProfile> range)
        {
            var sup    = SupportsUltimaStore;
            var bgID   = sup ? 40000 : 9270;
            var fillID = sup ? 40004 : 2624;

            var yOff = range.Count * 30;

            layout.Add(
                "background/footer/help",
                () =>
            {
                AddBackground(0, 75 + yOff, Width + 20, 130, bgID);
                AddImageTiled(10, 85 + yOff, Width, 110, fillID);
            });

            layout.Add("html/footer/help", () => AddHtml(20, 85 + yOff, Width - 10, 110, GetHelpText(), false, false));

            base.CompileEntryLayout(layout, range);
        }
Пример #31
0
        protected virtual void CompileEntryLayout(
            SuperGumpLayout layout,
            int length,
            int index,
            int pIndex,
            int yOffset,
            T entry)
        {
            layout.Add("button/list/select/" + index, () => AddButton(15, yOffset, 4006, 4007, btn => SelectEntry(btn, entry)));

            layout.Add(
                "label/list/entry/" + index,
                () =>
                AddLabelCropped(65, 2 + yOffset, 325, 20, GetLabelHue(index, pIndex, entry), GetLabelText(index, pIndex, entry)));

            if (pIndex < (length - 1))
            {
                layout.Add("imagetiled/body/hsep/" + index, () => AddImageTiled(12, 25 + yOffset, 400, 5, 9277));
            }
        }
Пример #32
0
		protected override void CompileLayout(SuperGumpLayout layout)
		{
			base.CompileLayout(layout);

			layout.Add("background/body/input", () => AddBackground(20, Height - 50, Width - 120, 30, 9350));

			layout.Add(
				"textentry/body/input",
				() =>
				{
					if (Limited)
					{
						AddTextEntryLimited(25, Height - 45, Width - 130, 20, TextHue, InputText, Limit, ParseInput);
					}
					else
					{
						AddTextEntry(25, Height - 45, Width - 130, 20, TextHue, InputText, ParseInput);
					}
				});
		}
Пример #33
0
        protected virtual void CompileSecondHand(SuperGumpLayout layout, Point2D center)
        {
            layout.Add(
                "clock/hand/second",
                () =>
            {
                var sa  = 2.0f * Math.PI * Time.Seconds / 60.0f;
                var shp = center.Clone2D((int)(Radius * Math.Sin(sa)), (int)(-Radius * Math.Cos(sa)));

                AddLine(center, shp, ColorSecondHand, 1);
            });
        }
Пример #34
0
        protected virtual void CompileMinuteHand(SuperGumpLayout layout, Point2D center)
        {
            layout.Add(
                "clock/hand/minute",
                () =>
            {
                var ma  = 2.0f * Math.PI * (Time.Minutes + Time.Seconds / 60.0f) / 60.0f;
                var mhp = center.Clone2D((int)(Radius * Math.Sin(ma)), (int)(-Radius * Math.Cos(ma)));

                AddLine(center, mhp, ColorMinuteHand, 3);
            });
        }
Пример #35
0
        protected virtual void CompileHourHand(SuperGumpLayout layout, Point2D center)
        {
            layout.Add(
                "clock/hand/hour",
                () =>
            {
                var ha  = 2.0f * Math.PI * (Time.Hours + Time.Minutes / 60.0f) / 12.0f;
                var hhp = center.Clone2D((int)(Radius * Math.Sin(ha) / 1.5f), (int)(-Radius * Math.Cos(ha) / 1.5f));

                AddLine(center, hhp, ColorHourHand, 3);
            });
        }
Пример #36
0
        protected override void CompileEntryLayout(
            SuperGumpLayout layout, int length, int index, int pIndex, int yOffset, Level entry)
        {
            yOffset = 180 + pIndex * 20;

            layout.Add(
                "entry" + index,
                () =>
            {
                AddLabel(382, yOffset, 0, "#" + (index + 1));
                AddLabel(429, yOffset, 0, entry.Creatures.Count.ToString());
                AddLabel(500, yOffset, 0, entry.TimeLimit.ToString());
                AddLabel(576, yOffset, 0, entry.KillAmount.ToString());
                AddButton(615, yOffset - 2, 4023, 4024, b => Send(new EditLevelUI(User, Hide(true), entry)
                {
                    AcceptHandler = a => { Refresh(true); },
                    CancelHandler = c => Refresh(true)
                }));
                AddButton(654, yOffset + 3, 2181, 2181, b =>
                {
                    if (Invasion.Status == InvasionStatus.Running &&
                        ((Invasion.CurrentLevel == entry ||
                          Invasion.Levels.FindIndex(l => l.UID == entry.UID) <=
                          Invasion.Levels.FindIndex(l => l.UID == Invasion.CurrentLevel.UID))))
                    {
                        Send(
                            new NoticeDialogGump(User, Hide(true))
                        {
                            Title = "Invalid Selection",
                            Html  =
                                "You cannot delete levels in a running invasion which have already been completed or are currently running.",
                            AcceptHandler = c => Refresh(true)
                        });
                        return;
                    }
                    if (Invasion.Levels.Count == 1)
                    {
                        Send(
                            new NoticeDialogGump(User, Hide(true))
                        {
                            Title         = "Invalid Selection",
                            Html          = "An invasion must have at least one level.",
                            AcceptHandler = c => Refresh(true)
                        });
                        return;
                    }
                    Invasion.Levels.Remove(entry);


                    Refresh(true);
                });
            });
        }
Пример #37
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            layout.Add(
                "Main",
                () =>
                {
                    AddBackground(0, 0, 418, 56, 5120);
                    AddBackground(37, 28, 350, 22, 9350);

                    AddHtml(9, 6, 408, 22, string.Format("<BIG><CENTER>{0}</CENTER></BIG>", "View This Hand on Ultima Online: Forever Legends").WrapUOHtmlColor(Color.Gold), false, false);
                    AddHtml(44, 29, 336, 22, string.Format("<CENTER><BIG><A HREF=\"{0}{1}\">{0}{1}</A></BIG></CENTER>", "legends.uoforever.com/pokerhands/".WrapUOHtmlColor(Color.Gold), HandId), false, false);
                });
        }
 protected override void CompileLayout(SuperGumpLayout layout)
 {
     layout.Add(
         "background/main/",
         () =>
         {
             AddBackground(5, 2, 203, 70, 9200);
             AddItem(9, 23, 18491);
             AddItem(41, 25, 18494);
             AddItem(81, 28, 18497);
             AddItem(118, 31, 18515);
             AddItem(155, 28, 18518);
         });
 }
Пример #39
0
		public override void CompileLayout(UOFCentralGump g, SuperGumpLayout layout)
		{
			base.CompileLayout(g, layout);

			if (g == null || layout == null)
			{
				return;
			}

			if (g.Edit)
			{
				layout.Add(
					"page/text",
					() =>
					{
						g.AddImageTiled(120, 160, 410, 200, 2624);
						g.AddButton(
							120,
							160,
							2640,
							2641,
							b =>
							{
								Text = String.Empty;
								g.Refresh(true);
							});
						g.AddTooltip(ButtonIconInfo.GetTooltip(ButtonIcon.Clear));
						g.AddImageTiled(150, 153, 385, 2, 30072);

						if (Background)
						{
							g.AddBackground(150, 160, 380, 200, 9350);
						}

						g.AddTextEntry(155, 165, 370, 190, g.TextHue, Text, (e, t) => Text = t);
					});
			}
			else
			{
				layout.Add(
					"page/text",
					() =>
					{
						string text = Text.ParseBBCode(TextColor.ToColor()).WrapUOHtmlColor(TextColor, false);

						g.AddImageTiled(120, 160, 410, 200, 2624);
						g.AddHtml(125, 165, 400, 190, text, Background, Scrollbar);
					});
			}
		}
Пример #40
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            layout.Add(
                "background/main/",
                () =>
                {
                    AddImageTiled(50, 20, 400, 400, 2624);
                    AddAlphaRegion(50, 20, 400, 400);

                    AddImage(90, 33, 9005);
                    AddHtml(130, 45, 270, 20, Title.WrapUOHtmlColor(Color.White).WrapUOHtmlTag("BIG"), false, false);
                        // Quest Offer
                    AddImageTiled(130, 65, 175, 1, 9101);

                    AddImage(140, 110, 1209);
                    AddHtml(160, 108, 250, 20, Title.WrapUOHtmlColor(Color.Orange).WrapUOHtmlTag("BIG"),
                        false, false);

                    AddHtml(98, 140, 312, 200, HTML.WrapUOHtmlTag("BIG"), false, true);

                    AddButton(85, 355, 247, 248, OnAccept);
                    AddHtml(157, 356, 280, 20, "I accept!".WrapUOHtmlColor(Color.White), false, false); // I accept!

                    AddButton(85, 385, 241, 243, OnCancel);
                    AddHtml(157, 387, 280, 20, "No thanks, I decline.".WrapUOHtmlColor(Color.White), false, false);
                        // No thanks, I decline.

                    AddImageTiled(50, 29, 30, 390, 10460);
                    AddImageTiled(34, 140, 17, 279, 9263);

                    AddImage(48, 135, 10411);
                    AddImage(-16, 285, 10402);
                    AddImage(0, 10, 10421);
                    AddImage(25, 0, 10420);

                    AddImageTiled(83, 15, 350, 15, 10250);

                    AddImage(34, 419, 10306);
                    AddImage(442, 419, 10304);
                    AddImageTiled(51, 419, 392, 17, 10101);

                    AddImageTiled(415, 29, 44, 390, 2605);
                    AddImageTiled(415, 29, 30, 390, 10460);
                    AddImage(425, 0, 10441);

                    AddImage(370, 50, 1417);
                    AddImage(379, 60, 0x15B5);
                });
        }
Пример #41
0
		protected override void CompileLayout(SuperGumpLayout layout)
		{
			base.CompileLayout(layout);

			layout.Add(
				"everything",
				() =>
				{
					AddImage(628, 14, 10410);
					AddBackground(27, 83, 633, 129, 9200);
					AddAlphaRegion(50, 89, 584, 118);
					AddImageTiled(27, 85, 21, 126, 10464);
					AddImageTiled(636, 85, 21, 126, 10464);
					AddImage(313, 44, 9000);
					AddLabel(60, 92, 1258, @"Ultima Online Forever Action Camera");

					AddLabel(409, 92, 2049, "Current Location:");

					AddLabelCropped(526, 92, 110, 16, 1258, String.IsNullOrWhiteSpace(User.Region.Name) ? "Unknown" : User.Region.Name);

					AddLabel(230, 149, 2049, @"TOTAL KILLS: ");
					AddLabel(335, 149, 137, ActionCams.CurrentDeathCount.ToString("#,0"));

					AddImageTiled(58, 111, 225, 1, 5410);

					AddLabel(62, 165, 2049, @"Total Player Murders: ");
					AddLabel(212, 165, 137, ActionCams.CurrentPlayerMurders.ToString("#,0"));

					AddLabel(62, 188, 2049, @"Top Murderer: ");

					if (ActionCams.TopPlayerMurderer != null)
					{
						AddLabel(155, 188, 137, ActionCams.TopPlayerMurderer.RawName);
					}

					AddLabel(409, 165, 2049, @"Total Monster Murders: ");
					AddLabel(573, 165, 137, ActionCams.CurrentMonsterMurders.ToString("#,0"));

					AddLabel(411, 188, 2049, @"Most Lethal Monster: ");

					if (ActionCams.TopMonsterMurderer != null)
					{
						AddLabelCropped(547, 188, 90, 16, 137, ActionCams.TopMonsterMurderer.RawName);
					}

					AddImage(627, 154, 10412);
				});
		}
Пример #42
0
		protected override void CompileLayout(SuperGumpLayout layout)
		{
			base.CompileLayout(layout);

			int lineHeight = (NumericHeight / 16),
				lineWidth = (NumericWidth / 9),
				halfHeight = (NumericHeight / 2),
				halfWidth = (NumericWidth / 2),
				eachWidth = (NumericWidth + halfWidth),
				width = 20 + (eachWidth * Numerics.Length),
				height = 20 + NumericHeight;

			layout.Add("background/body/base", () => AddBackground(0, 0, width, height, 9270));

			CompileNumericEntries(layout, width, height, lineHeight, lineWidth, halfHeight, halfWidth, eachWidth);
		}
Пример #43
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);
                });
        }
Пример #44
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            layout.Add(
                "background/main/",
                () =>
                {
                    AddBackground(0, 0, 384, 492, 9200);
                    AddItem(296, 22, 18491);
                    AddItem(296, 65, 18494);
                    AddItem(296, 108, 18497);
                    AddItem(296, 151, 18515);
                    AddLabel(145, 231, 1258, @"The Soulforge");
                    AddHtml(5, 251, 372, 190,
                        @"With your notepad from Llewellyn in hand, you are able to make out the meaning of the runes at the base of the hammer. The runes state that you are to ground 20 dragonbone shards and mix it into the base materials of the Soulforge.

You are then to take two intact dragon hearts and place them at the center of the forge.

The next step states that you must place both the soul of the Harrower and the soul of the Devourer into the forge.

To complete the arcane construction of the Soulforge, you must throw the heart of Rikktor, the dragon-king, into the forge. But do so at a distance!

If all goes as planned, Rikktor's heart should act as a catalyst and cause the dragon hearts to ignite. The immense heat radiating from the dragon hearts should cause the Harrower's soul to begin slowly emitting some of its dreadful power. The Devourer's soul will soften the raw, untamed power and make it a malleable force to work with when crafting relics in your Soulforge."
                        .WrapUOHtmlTag("BIG"), true, true);
                    AddItem(296, 194, 18518);
                    AddItem(118, 64, 17003);
                    AddItem(186, 20, 16996);
                    AddItem(140, 20, 16999);
                    AddItem(211, 64, 16997);
                    AddItem(163, 8, 16995);
                    AddItem(164, 32, 17000);
                    AddItem(187, 74, 17001);
                    AddItem(96, 65, 17007);
                    AddItem(141, 74, 17004);
                    AddItem(233, 65, 16998);
                    AddItem(164, 97, 17005);
                    AddItem(210, 72, 17002);
                    AddItem(187, 115, 17006);
                    AddItem(118, 72, 17008);
                    AddItem(141, 116, 17009);
                    AddItem(164, 121, 17010);
                    AddLabel(16, 456, 1258, "Craft the Soulforge?");
                    AddButton(235, 455, 247, 248, OnAccept);
                    AddButton(316, 455, 241, 243, OnCancel);
                    AddButton(353, 8, 4017, 4020, OnCancel);
                });
        }
Пример #45
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);
				});
		}
Пример #46
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);
                                    }
                                }));
                    }
                });
        }
Пример #47
0
			protected override void CompileLayout(SuperGumpLayout layout)
			{
				base.CompileLayout(layout);

				layout.Add("bg", () => AddBackground(0, 0, Width, Height, 2620));
				layout.Add(
					"output",
					() =>
					{
						var w = Width - 10;
						var h = Height - 10;

						var rw = w - 24;
						var rh = h / 20;

						var rc = h / rh;

						var x = 5;
						var y = 5;

						foreach (var line in _Buffer.Skip(_Index).Take(rc))
						{
							AddHtml(x, y, rw, rh, line, false, false);

							y += rh;
						}

						x += rw;
						y = 5;

						AddScrollbarV(
							x,
							y,
							_Buffer.Count,
							_Buffer.Count,
							b =>
							{
								--_Index;
								Refresh(true);
							},
							b =>
							{
								++_Index;
								Refresh(true);
							},
							new Rectangle2D(6, 42, 13, h - 56),
							new Rectangle2D(6, 10, 13, 28),
							new Rectangle2D(6, 42 + (h - 56), 13, 28),
							Tuple.Create(10740, 10742),
							Tuple.Create(10701, 10702, 10700),
							Tuple.Create(10721, 10722, 10720));
					});
			}
Пример #48
0
		private void CompileTitleLayout(SuperGumpLayout layout, Title title)
		{
			layout.Add("label/body/title/grantmessage", () => AddLabel(70, 110, 1457, "This scroll grants the title: "));
			layout.Add("label/body/title/grant", () => AddLabel(110, 145, 1461, title.ToString(User.Female)));

			layout.Add("image/body/title/Hbar", () => AddImageTiled(100, 160, 120, 2, 2620));

			layout.Add("label/body/title/raritymessage", () => AddLabel(25, 185, 1457, "Title Rarity: "));
			layout.Add("label/body/title/rarity", () => AddLabel(105, 185, title.GetRarityHue(), title.Rarity.ToString()));

			layout.Add("label/body/title/owned", () => AddLabel(25, 205, 1457, "People who have this title: "));
			layout.Add("label/body/title/ownednumber", () => AddLabel(193, 205, 1461, title.GetOwnerCount().ToString("#,0")));
		}
Пример #49
0
		private void CompileHueLayout(SuperGumpLayout layout, TitleHue hue)
		{
			layout.Add("label/body/hue/grantmessage", () => AddLabel(65, 110, 1457, "This scroll grants the title hue: "));
			layout.Add("label/body/hue/granthue", () => AddLabel(110, 145, hue.Hue-1, "##########"));

			layout.Add("image/body/hue/Hbar", () => AddImageTiled(100, 160, 120, 2, 2620));

			layout.Add("label/body/hue/raritymessage", () => AddLabel(25, 185, 1457, "Hue Rarity: "));
			layout.Add("label/body/hue/rarity", () => AddLabel(105, 185, hue.GetRarityHue(), hue.Rarity.ToString()));

			layout.Add("label/body/hue/owned", () => AddLabel(25, 205, 1457, "People who have this hue: "));
			layout.Add("label/body/hue/ownednumber", () => AddLabel(193, 205, 1461, hue.GetOwnerCount().ToString("#,0")));
		}
Пример #50
0
		protected virtual void CompileSecondHand(SuperGumpLayout layout, Point2D center)
		{
			layout.Add(
				"clock/hand/second",
				() =>
				{
					var sa = 2.0f * Math.PI * Time.Seconds / 60.0f;
					var shp = center.Clone2D((int)(Radius * Math.Sin(sa)), (int)(-Radius * Math.Cos(sa)));

					AddLine(center, shp, ColorSecondHand, 1);
				});
		}
Пример #51
0
		protected virtual void CompileHourHand(SuperGumpLayout layout, Point2D center)
		{
			layout.Add(
				"clock/hand/hour",
				() =>
				{
					var ha = 2.0f * Math.PI * (Time.Hours + Time.Minutes / 60.0f) / 12.0f;
					var hhp = center.Clone2D((int)(Radius * Math.Sin(ha) / 1.5f), (int)(-Radius * Math.Cos(ha) / 1.5f));

					AddLine(center, hhp, ColorHourHand, 3);
				});
		}
Пример #52
0
		protected override void CompileLayout(SuperGumpLayout layout)
		{
			base.CompileLayout(layout);

			layout.Add(
				"frame",
				() =>
				{
					if (BorderSize > 0 && BorderID >= 0)
					{
						AddImageTiled(0, 0, FrameWidth, FrameHeight, BorderID);

						if (BorderAlpha)
						{
							AddAlphaRegion(0, 0, FrameWidth, FrameHeight);
						}
					}

					if (FrameWidth > BorderSize * 2 && FrameHeight > BorderSize * 2 && BackgroundID >= 0)
					{
						AddImageTiled(BorderSize, BorderSize, FrameWidth - (BorderSize * 2), FrameHeight - (BorderSize * 2), BackgroundID);

						if (BackgroundAlpha)
						{
							AddAlphaRegion(BorderSize, BorderSize, FrameWidth - (BorderSize * 2), FrameHeight - (BorderSize * 2));
						}
					}

					if (Frame < FrameCount)
					{
						return;
					}

					string html = Html.ParseBBCode(HtmlColor).Replace("<br>", "\n").Replace("<BR>", "\n");

					AddHtml(
						BorderSize + HtmlIndent,
						BorderSize,
						(FrameWidth - (BorderSize * 2)) - HtmlIndent,
						FrameHeight - (BorderSize * 2),
						html.WrapUOHtmlColor(HtmlColor, false),
						false,
						FrameHeight >= GetSizeMax().Height);
				});
		}
Пример #53
0
		protected override void CompileLayout(SuperGumpLayout layout)
		{
			base.CompileLayout(layout);

			layout.Add("background/header", () => AddBackground(46, 25, 500, 50, 9270));

			layout.Add("background/body", () => AddBackground(45, 68, 500, 300, 9270));

			layout.Add("background/footer", () => AddBackground(45, 362, 500, 60, 9270));

			layout.Add(
				"imagetiled/seps",
				() =>
				{
					AddImageTiled(60, 120, 465, 10, 4201);
					AddImageTiled(60, 160, 465, 10, 4201);
					AddImageTiled(60, 200, 465, 10, 4201);
				});

			layout.Add("label/title", () => AddLabel(67, 39, 152, "Gift Transaction Overview"));

			layout.Add(
				"button/back",
				() =>
				{
					AddButton(63, 381, 4015, 4016, OnBack);
					AddTooltip(3010002);
				});

			int picID = (int)StatusGem.Void;
			int textColor = (int)TextColor.Void;
			string statusDesc = "This transaction is Unknown", tag = Transaction.State.ToString();

			switch (Transaction.State)
			{
				case DonationTransactionState.Void:
					{
						picID = (int)StatusGem.Void;
						textColor = (int)TextColor.Void;
					}
					break;
				case DonationTransactionState.Pending:
					{
						picID = (int)StatusGem.Pending;
						textColor = (int)TextColor.Pending;
						statusDesc = "This transaction is Pending confirmation.";
					}
					break;
				case DonationTransactionState.Processed:
					{
						picID = (int)StatusGem.Pending;
						textColor = (int)TextColor.Pending;
						statusDesc = "This transaction has been Processed.";
					}
					break;
				case DonationTransactionState.Claimed:
					{
						picID = (int)StatusGem.Claimed;
						textColor = (int)TextColor.Claimed;
						statusDesc = "This transaction has been Claimed.";
					}
					break;
			}

			layout.Add("image/gem", () => AddImage(65, 90, picID));

			layout.Add("label/tag", () => AddLabel(107, 94, textColor, tag));

			layout.Add("label/id", () => AddLabel(239, 94, textColor, String.Format("ID: {0}", Transaction.ID)));

			layout.Add(
				"label/date",
				() => AddLabel(239, 134, textColor, String.Format("Date: {0}", Transaction.Time.Value.ToShortDateString())));

			layout.Add(
				"label/account",
				() =>
				AddLabel(
					70,
					134,
					textColor,
					String.Format("Account: {0}", (Transaction.Account == null ? "No Account" : Transaction.Account.Username))));

			layout.Add(
				"label/cost",
				() =>
				AddLabel(
					70,
					174,
					textColor,
					String.Format(
						"Total: {0}{1:N} ({2})", AutoDonate.CMOptions.MoneySymbol, Transaction.Total, AutoDonate.CMOptions.MoneyAbbr)));

			layout.Add(
				"label/credits", () => AddLabel(239, 174, textColor, String.Format("Credits: {0:#,#}", Transaction.Credit.Value)));

			layout.Add(
				"html/details",
				() =>
				{
					StringBuilder html = new StringBuilder();

					html.AppendLine("Delivery Details:");

					if (Transaction.IsGift)
					{
						html.AppendLine("");
						html.AppendFormat("Gifted to {0} from {1}", Transaction.DeliverTo.RawName, Transaction.DeliverFrom.RawName);
					}

					html.AppendLine("");
					html.AppendFormat("Received: {0}", Transaction.DeliveryTime.Value.ToShortDateString());

					html.AppendLine("");

					html.AppendLine("Notes:");
					html.AppendLine(Transaction.Notes);
					html.AppendLine("");

					html.AppendLine("Extra Information:");
					html.AppendLine(Transaction.Extra);
					html.AppendLine("");

					AddHtml(67, 218, 454, 126, html.ToString(), false, true);
				});

			layout.Add("label/status", () => AddLabel(111, 382, textColor, statusDesc));

			if (Transaction.State == DonationTransactionState.Processed)
			{
				if (AutoDonate.CMOptions.GiftingEnabled)
				{
					layout.Add("button/gift", () => AddButton(410, 381, 4029, 4030, OnGift));
				}

				layout.Add("button/claim", () => AddButton(449, 384, 12002, 12000, OnClaim));
			}
		}
Пример #54
0
		protected override void CompileLayout(SuperGumpLayout layout)
		{
			base.CompileLayout(layout);

			Width = Math.Max(300, Math.Min(1024, Width));
			Height = Math.Max(200, Math.Min(786, Height));

			layout.Add(
				"background/header/base",
				() =>
				{
					AddBackground(0, 0, Width, 50, 9270);
					AddImageTiled(10, 10, Width - 20, 30, 2624);
					//AddAlphaRegion(10, 10, Width - 20, 30);
				});

			layout.Add("label/header/title", () => AddLabelCropped(20, 15, Width - 40, 20, TextHue, Title));

			layout.Add(
				"background/body/base",
				() =>
				{
					AddBackground(0, 50, Width, Height - 50, 9270);
					AddImageTiled(10, 60, Width - 20, Height - 70, 2624);
					//AddAlphaRegion(10, 60, Width - 20, Height - 70);
				});

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

			layout.Add(
				"html/body/info",
				() =>
				AddHtml(
					100,
					70,
					Width - 120,
					Height - 130,
					String.Format("<BIG><BASEFONT COLOR=#{0:X6}>{1}</BIG>", HtmlColor.ToArgb(), Html),
					HtmlBackground,
					true));

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

			layout.Add(
				"button/body/accept",
				() =>
				{
					AddButton(Width - 50, Height - 45, 4015, 4016, OnAccept);
					AddTooltip(1006044);
				});
		}
Пример #55
0
		protected override void CompileLayout(SuperGumpLayout layout)
		{
			base.CompileLayout(layout);

			int x, y, w, h;
			GetBounds(out x, out y, out w, out h);

			var c = new Point2D(x + (w / 2), y + (h / 2));

			layout.Add("clock/bg", () => AddBackground(x - 15, y - 15, w + 30, h + 30, 2620));

			if (DisplayNumerals)
			{
				CompileNumerals(layout, c);
			}

			if (DisplayHourHand)
			{
				CompileHourHand(layout, c);
			}

			if (DisplayMinuteHand)
			{
				CompileMinuteHand(layout, c);
			}

			if (DisplaySecondHand)
			{
				CompileSecondHand(layout, c);
			}
		}
Пример #56
0
		protected override void CompileLayout(SuperGumpLayout layout)
		{
			base.CompileLayout(layout);

			double fp = FrameIndex / (double)FrameCount;

			layout.Add(
				"conquest/bg",
				() =>
				{
					const int x = 35, y = 64;

					int w = 315, h = 80;

					if (fp <= 0.75)
					{
						w = (int)Math.Ceiling((fp / 0.75) * w);
					}

					if (w > 0 && h > 0)
					{
						AddBackground(x, y, w, h, 2620);
					}

					if (w > 10 && h > 10)
					{
						AddAlphaRegion(x + 5, y + 5, w - 10, h - 10);
					}
				});

			layout.Add(
				"conquest/dragon",
				() =>
				{
					if (AnimState == true)
					{
						var p = new Point2D(117, 54);

						int itemID;

						if (fp <= 0.80)
						{
							if (!_Sound1)
							{
								User.PlaySound(551);
								_Sound1 = true;
							}
							
							itemID = 14078 + (int)Math.Floor(10 * (fp / 0.80)); //fireball

							p = p.Lerp2D(310, 104, fp);
						}
						else
						{
							if (!_Sound2)
							{
								User.PlaySound(520);
								_Sound2 = true;
							}
							
							itemID = 14002 + (int)Math.Floor(30 * ((fp - 0.80) / 0.20)); //explosion

							p = p.Lerp2D(272, 80, fp);
						}

						AddItem(p.X, p.Y, itemID); 
					}

					AddImage(0, 0, 10400); //dragon
				});

			layout.Add(
				"conquest/badge",
				() =>
				{
					AddImage(20, 65, 1417); //plate

					if (AnimState == true && fp <= 0.50)
					{
						AddItem(30, 80, 14002 + (int)Math.Floor(30 * (fp / 0.50)));
					}
					else if (State.Conquest.Hue > 0)
					{
						AddItem(35, 85, State.Conquest.ItemID, State.Conquest.Hue);
					}
					else
					{
						AddItem(35, 85, State.Conquest.ItemID);
					}
				});

			layout.Add(
				"conquest/title",
				() =>
				{
					if (fp >= 0.80)
					{
						AddLabelCropped(105, 70, 170, 20, HighlightHue, "CONQUEST UNLOCKED!");
					}
				});

			layout.Add(
				"conquest/name",
				() =>
				{
					if (fp >= 0.85)
					{
						AddLabelCropped(105, 93, 170, 20, TextHue, State.Name);
					}
				});

			layout.Add(
				"conquest/tier",
				() =>
				{
					if (fp < 0.90)
					{
						return;
					}

					string tier = String.Format("Tier: {0:#,0} / {1:#,0}", State.Tier, State.TierMax);
					
					AddLabelCropped(105, 116, 170, 20, HighlightHue, tier);
				});

			layout.Add(
				"state/icon",
				() =>
				{
					if (fp < 0.95)
					{
						return;
					}

					if (State.WorldFirst)
					{
						//globe
						AddButton(
							282,
							75,
							5608,
							5609,
							b =>
							{
								Refresh();
								Send(new ConquestStateGump(User, State));
							});
					}
					else
					{
						//uo icon
						AddButton(
							280,
							74,
							5545,
							5546,
							b =>
							{
								Refresh();
								Send(new ConquestStateGump(User, State));
							});
					}
				});

			layout.Add(
				"conquest/points",
				() =>
				{
					if (fp < 0.95)
					{
						return;
					}

					string points = State.Conquest.Points.ToString("#,0") + " CP";

					points = points.WrapUOHtmlTag("big");
					points = points.WrapUOHtmlTag("center");
					points = points.WrapUOHtmlColor(Color.SkyBlue);

					//AddImageTiled(285, 95, 50, 20, 2624);
					AddAlphaRegion(285, 95, 50, 20);
					AddHtml(285, 95, 50, 40, points, false, false); // points
				});
		}
Пример #57
0
		protected virtual void CompileMinuteHand(SuperGumpLayout layout, Point2D center)
		{
			layout.Add(
				"clock/hand/minute",
				() =>
				{
					var ma = 2.0f * Math.PI * (Time.Minutes + Time.Seconds / 60.0f) / 60.0f;
					var mhp = center.Clone2D((int)(Radius * Math.Sin(ma)), (int)(-Radius * Math.Cos(ma)));

					AddLine(center, mhp, ColorMinuteHand, 3);
				});
		}
Пример #58
0
		protected override void CompileLayout(SuperGumpLayout layout)
		{
			base.CompileLayout(layout);

			int w = 50 + (70 * ScrollWidth);
			int h = 50 + (70 * ScrollHeight);

			/* Layout:
			 *  ___________
			 * [___________|<]
			 * |  |O O O O |^|
			 * |  |O O O O | |
			 * |  |O O O O | |
			 * |  |________|v|
			 * |__|<______>|>]
			 */

			layout.Add("panel/top", () => AddBackground(0, 0, w + 200, 30, 2620));

			if (!Minimized)
			{
				layout.Add("panel/left", () => AddBackground(0, 30, 200, h + 30, 2620));
				layout.Add("panel/center", () => AddBackground(200, 30, w, h, 2620));
				layout.Add("panel/right", () => AddBackground(w + 201, 30, 26, h, 2620));
				layout.Add("panel/bottom", () => AddBackground(200, h + 31, w, 30, 2620));
			}

			layout.Add("title", () => AddLabelCropped(10, 5, 180 + (w - 100), 20, TextHue, Title));

			var ui = UI;

			if ((ui.Mode == RuneCodex.UICache.ViewMode.Categories && Codex.CanEditCategories(User)) ||
				(ui.Mode == RuneCodex.UICache.ViewMode.Entries && Codex.CanEditEntries(User)))
			{
				layout.Add(
					"edit",
					() =>
					{
						ui = UI;

						AddButton(
							w + 120,
							10,
							2362,
							2362,
							b =>
							{
								ui = UI;
								ui.EditMode = !ui.EditMode;
								Refresh(true);
							});
						AddTooltip(!ui.EditMode ? 3000414 : 3000415);
					});
			}

			layout.Add(
				"help",
				() =>
				{
					ui = UI;

					AddButton(
						w + 150,
						10,
						2361,
						2361,
						b =>
						{
							ui = UI;
							ui.EditMode = false;

							switch (ui.Mode)
							{
								case RuneCodex.UICache.ViewMode.Categories:
									ui.Category = null;
									goto case RuneCodex.UICache.ViewMode.Entries;
								case RuneCodex.UICache.ViewMode.Entries:
									ui.Entry = null;
									break;
							}

							Refresh(true);
						});
					AddTooltip(1046004);
				});

			layout.Add(
				"minimize",
				() =>
				{
					AddButton(
						w + 180,
						10,
						2360,
						2360,
						b =>
						{
							if (Minimized)
							{
								Maximize(b);
							}
							else
							{
								Minimize(b);
							}
						});
					AddTooltip(!Minimized ? 3002085 : 3002086);
				});

			if (Minimized)
			{
				return;
			}

			layout.Add(
				"preview",
				() =>
				{
					ui = UI;

					switch (ui.Mode)
					{
						case RuneCodex.UICache.ViewMode.Categories:
							{
								if (ui.Category == null)
								{
									AddHtml(
										10,
										50,
										190,
										h - 10,
										"Select or add a category using the grid on the right.\nTo view the runes in a category, click the accept button in the bottom-right corner.\n\nClone: Create new rune books containing the runes from the selected category.\nThe runes are not removed from the codex."
											.WrapUOHtmlColor(Color.LawnGreen),
										false,
										true);
									break;
								}

								var cat = ui.Category;

								if (ui.EditMode)
								{
									AddLabelCropped(10, 50, 180, 20, HighlightHue, "Name: (20 Chars)");
									AddTextEntryLimited(10, 80, 180, 20, TextHue, cat.Name, 20, (e, s) => cat.Name = s);

									AddLabelCropped(10, 110, 180, 20, HighlightHue, "Description: (60 Chars)");
									AddTextEntryLimited(10, 130, 180, 60, TextHue, cat.Description, 60, (e, s) => cat.Description = s);

									AddLabelCropped(10, 200, 180, 20, HighlightHue, "Hue: (0 - 2999)");
									AddTextEntryLimited(
										10,
										220,
										180,
										20,
										TextHue,
										cat.Hue.ToString(CultureInfo.InvariantCulture),
										4,
										(e, s) =>
										{
											int hue;

											if (Int32.TryParse(s, out hue))
											{
												cat.Hue = Math.Max(0, Math.Min(2999, hue));
											}
										});

									AddButton(
										10,
										280,
										2714,
										2715,
										b =>
										{
											cat.UseDefaults();
											Refresh(true);
										});
									AddLabelCropped(30, 280, 160, 20, HighlightHue, "Use Defaults");

									if (Codex.CanRemoveEntries(User))
									{
										AddButton(
											10,
											300,
											2708,
											2709,
											b =>
											{
												cat.Empty();
												Codex.InvalidateProperties();
												Refresh(true);
											});
										AddLabelCropped(30, 300, 160, 20, ErrorHue, "Empty Entries");
									}

									if (Codex.CanRemoveCategories(User) && cat != Codex.Categories[0, 0])
									{
										AddButton(
											10,
											320,
											2708,
											2709,
											b =>
											{
												ui = UI;

												if (Codex.Remove(cat))
												{
													ui.Category = null;
												}

												Refresh(true);
											});
										AddLabelCropped(30, 320, 160, 20, ErrorHue, "Remove");
									}
								}
								else
								{
									AddLabelCropped(10, 50, 180, 20, cat.Hue, GetCategoryLabel(cat));
									AddHtml(10, 80, 190, 110, cat.ToHtmlString(User), false, true);

									int cost = Codex.CloneEntryChargeCost * cat.Entries.Count;

									AddButton(
										10,
										200,
										2714,
										2715,
										b =>
										{
											Codex.Drop(User, cat, true);
											Refresh(true);
										});
									AddLabelCropped(
										30,
										200,
										160,
										20,
										HighlightHue,
										String.Format("Clone ({0:#,0} charge{1})", cost, cost != 1 ? "s" : String.Empty));

									if (Codex.CanRemoveCategories(User) && cat != Codex.Categories[0, 0])
									{
										AddButton(
											10,
											320,
											2708,
											2709,
											b =>
											{
												ui = UI;

												if (Codex.Remove(cat))
												{
													ui.Category = null;
												}

												Refresh(true);
											});
										AddLabelCropped(30, 320, 160, 20, ErrorHue, "Remove");
									}
								}
							}
							break;
						case RuneCodex.UICache.ViewMode.Entries:
							{
								if (ui.Entry == null)
								{
									AddHtml(
										10,
										50,
										190,
										h - 10,
										"Select or add a rune using the grid on the right.\n\nYou can add:\n* Marked Recall Runes\n* Rune Books\n\nAdding an item will extract the location(s) and destroy the item.\n\nYou can also drop items directly to this codex.\nThey will be added to the last category you selected.\n\nClone: Create a recall rune for the selected rune.\nThe rune is not removed from the codex."
											.WrapUOHtmlColor(Color.LawnGreen),
										false,
										true);
									break;
								}

								var entry = ui.Entry;

								if (ui.EditMode)
								{
									AddLabelCropped(10, 50, 180, 20, HighlightHue, "Name: (20 Chars)");
									AddTextEntryLimited(10, 80, 180, 20, TextHue, entry.Name, 20, (e, s) => entry.Name = s);

									AddLabelCropped(10, 110, 180, 20, HighlightHue, "Description: (60 Chars)");
									AddTextEntryLimited(10, 130, 180, 60, TextHue, entry.Description, 60, (e, s) => entry.Description = s);

									AddButton(
										10,
										300,
										2714,
										2715,
										b =>
										{
											entry.UseDefaults();
											Codex.InvalidateProperties();
											Refresh(true);
										});
									AddLabelCropped(30, 300, 160, 20, HighlightHue, "Use Defaults");

									if (Codex.CanRemoveEntries(User))
									{
										AddButton(
											10,
											320,
											2708,
											2709,
											b =>
											{
												ui = UI;

												if (ui.Category.Remove(entry))
												{
													ui.Entry = null;
													Codex.InvalidateProperties();
												}

												Refresh(true);
											});
										AddLabelCropped(30, 320, 160, 20, ErrorHue, "Remove");
									}
								}
								else
								{
									AddLabelCropped(10, 50, 180, 20, ui.Category.Hue, GetEntryLabel(ui.Entry));
									AddHtml(10, 80, 190, 110, ui.Entry.ToHtmlString(User), false, true);

									AddButton(
										10,
										200,
										2714,
										2715,
										b =>
										{
											Codex.Recall(User, entry, true);
											Minimized = true;
											Refresh(true);
										});
									AddLabelCropped(
										30,
										200,
										160,
										20,
										HighlightHue,
										String.Format(
											"Recall ({0:#,0} charge{1})", Codex.RecallChargeCost, Codex.RecallChargeCost != 1 ? "s" : String.Empty));

									AddButton(
										10,
										220,
										2714,
										2715,
										b =>
										{
											Codex.Gate(User, entry, true);
											Minimized = true;
											Refresh(true);
										});
									AddLabelCropped(
										30,
										220,
										160,
										20,
										HighlightHue,
										String.Format(
											"Gate ({0:#,0} charge{1})", Codex.GateChargeCost, Codex.GateChargeCost != 1 ? "s" : String.Empty));

									AddButton(
										10,
										240,
										2714,
										2715,
										b =>
										{
											Codex.Drop(User, entry, true);
											Refresh(true);
										});
									AddLabelCropped(
										30,
										240,
										160,
										20,
										HighlightHue,
										String.Format(
											"Clone ({0:#,0} charge{1})", Codex.CloneEntryChargeCost, Codex.CloneEntryChargeCost != 1 ? "s" : String.Empty));

									if (Codex.CanRemoveEntries(User))
									{
										AddButton(
											10,
											320,
											2708,
											2709,
											b =>
											{
												ui = UI;

												if (ui.Category.Remove(entry))
												{
													ui.Entry = null;
													Codex.InvalidateProperties();
												}

												Refresh(true);
											});
										AddLabelCropped(30, 320, 160, 20, ErrorHue, "Remove");
									}
								}
							}
							break;
					}
				});

			CompileGrid(layout);

			layout.Add(
				"scrollX",
				() =>
				{
					ui = UI;

					switch (ui.Mode)
					{
						case RuneCodex.UICache.ViewMode.Categories:
							AddScrollbarH(
								200,
								38 + h,
								Math.Max(0, (Codex.Categories.Width + 1) - ScrollWidth),
								ui.CategoryScroll.X,
								b => ScrollLeft(),
								b => ScrollRight(),
								new Rectangle2D(30, 0, w - 60, 16),
								new Rectangle2D(7, 0, 16, 16),
								new Rectangle2D(w - 25, 0, 16, 16),
								Tuple.Create(9354, 9304),
								Tuple.Create(5607, 5603, 5607),
								Tuple.Create(5605, 5601, 5605));
							break;
						case RuneCodex.UICache.ViewMode.Entries:
							AddScrollbarH(
								200,
								38 + h,
								Math.Max(0, (ui.Category.Entries.Width + 1) - ScrollWidth),
								ui.EntryScroll.X,
								b => ScrollLeft(),
								b => ScrollRight(),
								new Rectangle2D(30, 0, w - 60, 16),
								new Rectangle2D(7, 0, 16, 16),
								new Rectangle2D(w - 25, 0, 16, 16),
								Tuple.Create(9354, 9304),
								Tuple.Create(5607, 5603, 5607),
								Tuple.Create(5605, 5601, 5605));
							break;
					}
				});

			layout.Add(
				"scrollY",
				() =>
				{
					ui = UI;

					switch (ui.Mode)
					{
						case RuneCodex.UICache.ViewMode.Categories:
							AddScrollbarV(
								206 + w,
								30,
								Math.Max(0, (Codex.Categories.Height + 1) - ScrollHeight),
								ui.CategoryScroll.Y,
								b => ScrollUp(),
								b => ScrollDown(),
								new Rectangle2D(0, 30, 16, h - 60),
								new Rectangle2D(0, 10, 16, 16),
								new Rectangle2D(0, h - 25, 16, 16),
								Tuple.Create(9354, 9304),
								Tuple.Create(5604, 5600, 5604),
								Tuple.Create(5606, 5602, 5606));
							break;
						case RuneCodex.UICache.ViewMode.Entries:
							AddScrollbarV(
								206 + w,
								30,
								Math.Max(0, (ui.Category.Entries.Height + 1) - ScrollHeight),
								ui.EntryScroll.Y,
								b => ScrollUp(),
								b => ScrollDown(),
								new Rectangle2D(0, 30, 16, h - 60),
								new Rectangle2D(0, 10, 16, 16),
								new Rectangle2D(0, h - 25, 16, 16),
								Tuple.Create(9354, 9304),
								Tuple.Create(5604, 5600, 5604),
								Tuple.Create(5606, 5602, 5606));
							break;
					}
				});

			layout.Add(
				"cancel",
				() =>
				{
					AddButton(w + 204, 4, 5538, 5539, OnCancel);
					AddTooltip(1006045);
				});

			if (ui.Mode == RuneCodex.UICache.ViewMode.Categories)
			{
				layout.Add(
					"accept",
					() =>
					{
						AddButton(w + 204, h + 34, 5541, 5542, OnAccept);
						AddTooltip(1006044);
					});
			}
		}
Пример #59
0
		protected virtual void CompileNumeral(SuperGumpLayout layout, Point2D center, int num)
		{
			layout.Add(
				"clock/numeral/" + num,
				() =>
				{
					var x = center.X - (RomanNumerals ? 20 : 10);
					x += (int)(-1 * (Radius * Math.Cos((Math.PI / 180.0f) * (num * 30 + 90))));

					var y = center.Y - 10;
					y += (int)(-1 * (Radius * Math.Sin((Math.PI / 180.0f) * (num * 30 + 90))));

					var n = GetNumeralString(num).WrapUOHtmlCenter().WrapUOHtmlColor(ColorNumerals);

					AddHtml(x, y, RomanNumerals ? 40 : 20, 40, n, false, false);
				});
		}
Пример #60
0
		protected virtual void CompileEntry(SuperGumpLayout layout, int x, int y, int idx, RuneCodexEntry entry)
		{
			var ui = UI;

			if (x >= ui.Category.Entries.Width || y >= ui.Category.Entries.Height)
			{
				return;
			}

			layout.Add(
				"entry/" + idx,
				() =>
				{
					ui = UI;

					int xOffset = 220 + (x * 70);
					int yOffset = 50 + (y * 70);
					int gx = x + ui.EntryScroll.X;
					int gy = y + ui.EntryScroll.Y;

					const int itemID = 7956;
					bool s = entry != null && ui.Entry == entry;

					if (entry != null)
					{
						AddButton(xOffset + 5, yOffset + 5, 24024, 24024, b => SelectEntry(gx, gy, idx, entry));
					}
					else if (Codex.CanAddEntries(User))
					{
						AddButton(xOffset + 5, yOffset + 5, 24024, 24024, b => AddEntry(gx, gy, idx));
					}

					AddImageTiled(xOffset, yOffset, 60, 60, 2702);

					if (s)
					{
						AddItem(xOffset + 10, yOffset + 4, itemID, 2050);
						AddItem(xOffset + 10, yOffset + 2, itemID, 1);
					}

					if (entry != null)
					{
						AddItem(xOffset + 10, yOffset, itemID, ui.Category.Hue);
						AddHtml(
							xOffset,
							yOffset + 25,
							60,
							40,
							GetEntryLabel(entry).WrapUOHtmlTag("center").WrapUOHtmlColor(Color.LawnGreen, false),
							false,
							false);
					}
					else if (Codex.CanAddEntries(User))
					{
						AddImage(xOffset + 25, yOffset, 2511, HighlightHue);
						AddHtml(
							xOffset, yOffset + 25, 60, 40, "Add".WrapUOHtmlTag("center").WrapUOHtmlColor(Color.Yellow, false), false, false);
					}
				});
		}