Пример #1
0
        private void BuildSubtitle()
        {
            int y = 190;

            Guild guild = User.Guild as Guild;

            AddHtmlLocalized(55, y, 160, 16, 1115030, 0xFFFF, false, false); // Skills
            AddCallbackButton(20, y, 4005, 4007, 400, GumpButtonType.Reply, 0, b =>
            {
                Category           = TitleCategory.Skills;
                ShowingDescription = false;
                TitleClearing      = false;
                Refresh();
            });

            y += 22;

            if (guild != null && User.GuildTitle != null)
            {
                AddHtmlLocalized(55, y, 160, 16, 1115033, 0xFFFF, false, false); // GUILD
                AddCallbackButton(20, y, 4005, 4007, 401, GumpButtonType.Reply, 0, b =>
                {
                    Category           = TitleCategory.Guild;
                    ShowingDescription = false;
                    TitleClearing      = false;
                    Refresh();
                });

                y += 22;
            }

            if (User.CollectionTitles != null && User.CollectionTitles.Count > 0)
            {
                AddHtmlLocalized(55, y, 160, 16, 1115034, 0xFFFF, false, false); // Rewards
                AddCallbackButton(20, y, 4005, 4007, 402, GumpButtonType.Reply, 0, b =>
                {
                    Category           = TitleCategory.RewardTitles;
                    ShowingDescription = false;
                    TitleClearing      = false;
                    Refresh();
                });

                y += 22;
            }

            List <VeteranTitle> vetTitles = Titles.GetVeteranTitles(User);

            if (vetTitles != null && vetTitles.Count > 0)
            {
                AddHtml(55, y, 160, 16, Color("#FFFFFF", "Veterans"), false, false); // Rewards
                AddCallbackButton(20, y, 4005, 4007, 403, GumpButtonType.Reply, 0, b =>
                {
                    Category           = TitleCategory.Veteran;
                    ShowingDescription = false;
                    TitleClearing      = false;
                    Refresh();
                });
            }

            if (Category == TitleCategory.Skills)
            {
                if (!ShowingDescription || TitleSelected == -1)
                {
                    int index = 0;
                    int page  = 1;

                    AddPage(page);

                    foreach (Skill sk in User.Skills)
                    {
                        if (sk.Base < 30)
                        {
                            continue;
                        }

                        AddHtml(260, 70 + (index * 22), 245, 16, Color("#FFFFFF", Titles.GetSkillTitle(User, sk)), false, false);
                        AddCallbackButton(225, 70 + (index * 22), 4005, 4007, sk.Info.SkillID + 404, GumpButtonType.Reply, 0, b =>
                        {
                            TitleSelected      = b.ButtonID - 404;
                            ShowingDescription = true;
                            Refresh();
                        });

                        index++;
                        CheckPage(ref index, ref page);
                    }
                }
                else
                {
                    string title = Titles.GetSkillTitle(User, User.Skills[(SkillName)TitleSelected]);

                    AddHtmlLocalized(225, 70, 270, 140, 1115056 + TitleSelected, 0xFFFF, false, false);
                    AddHtmlLocalized(225, 220, 160, 16, 1115029, 0xFFFF, false, false); // Subtitle
                    AddHtml(275, 240, 245, 16, Color("#FFFFFF", title), false, false);

                    AddHtmlLocalized(225, 275, 200, 16, 1115035, 0xFFFF, false, false); // Do you wish to apply this title?

                    AddHtmlLocalized(480, 275, 80, 16, 1011046, 0xFFFF, false, false);  // APPLY
                    AddCallbackButton(445, 275, 4005, 4007, 102, GumpButtonType.Reply, 0, b =>
                    {
                        AddHtmlLocalized(225, 315, 200, 16, 1115036, 0xFFFF, false, false); // TITLE APPLIED
                        title = Titles.GetSkillTitle(User, User.Skills[(SkillName)TitleSelected]);
                        User.SubtitleSkillTitle = title;

                        User.SelectCollectionTitle(-1, true);
                        User.DisplayGuildTitle = false;

                        Refresh(false);
                    });
                }
            }
            else if (Category == TitleCategory.Guild && guild != null && User.GuildTitle != null)
            {
                if (!ShowingDescription || TitleSelected == -1)
                {
                    AddHtml(260, 70, 245, 16, Color("#FFFFFF", String.Format("{0}, {1}", Utility.FixHtml(User.GuildTitle), Utility.FixHtml(guild.Name))), false, false);
                    AddCallbackButton(225, 70, 4005, 4007, 500, GumpButtonType.Reply, 0, b =>
                    {
                        TitleSelected      = 1;
                        ShowingDescription = true;
                        Refresh();
                    });
                }
                else
                {
                    AddHtmlLocalized(225, 70, 270, 140, 1115039, 0xFFFF, false, false); // This is a custom guild title assigned by your guild leader.
                    AddHtmlLocalized(225, 220, 160, 16, 1115029, 0xFFFF, false, false); // Subtitle
                    AddHtml(275, 240, 245, 16, Color("#FFFFFF", String.Format("{0}, {1}", Utility.FixHtml(User.GuildTitle), Utility.FixHtml(guild.Name))), false, false);

                    AddHtmlLocalized(225, 275, 200, 16, 1115035, 0xFFFF, false, false); // Do you wish to apply this title?

                    AddHtmlLocalized(480, 275, 80, 16, 1011046, 0xFFFF, false, false);  // APPLY
                    AddCallbackButton(445, 275, 4005, 4007, 599, GumpButtonType.Reply, 0, b =>
                    {
                        AddHtmlLocalized(225, 315, 200, 16, 1115036, 0xFFFF, false, false); // TITLE APPLIED
                        User.DisplayGuildTitle = true;

                        if (User.SubtitleSkillTitle != null)
                        {
                            User.SubtitleSkillTitle = null;
                        }

                        User.SelectCollectionTitle(-1, true);

                        Refresh(false);
                    });
                }
            }
            else if (Category == TitleCategory.RewardTitles && User.CollectionTitles != null && User.CollectionTitles.Count > 0)
            {
                if (!ShowingDescription || TitleSelected == -1)
                {
                    int index = 0;
                    int page  = 1;

                    AddPage(page);

                    for (int i = 0; i < User.CollectionTitles.Count; i++)
                    {
                        object title = User.CollectionTitles[i];

                        if (title is int)
                        {
                            string cust = null;

                            if ((int)title == 1154017 && CityLoyaltySystem.HasCustomTitle(User, out cust))
                            {
                                AddHtmlLocalized(260, 70 + (index * 22), 245, 16, 1154017, cust, 0xFFFF, false, false);
                            }
                            else
                            {
                                AddHtmlLocalized(260, 70 + (index * 22), 245, 16, (int)title, 0xFFFF, false, false);
                            }
                        }
                        else if (title is string)
                        {
                            AddHtml(260, 70 + (index * 22), 245, 16, Color("#FFFFFF", (string)title), false, false);
                        }

                        AddCallbackButton(225, 70 + (index * 22), 4005, 4007, i + 600, GumpButtonType.Reply, 0, b =>
                        {
                            TitleSelected      = b.ButtonID - 600;
                            ShowingDescription = true;
                            Refresh();
                        });

                        index++;
                        CheckPage(ref index, ref page);
                    }
                }
                else if (TitleSelected >= 0 && User.CollectionTitles != null && TitleSelected < User.CollectionTitles.Count)
                {
                    object title       = User.CollectionTitles[TitleSelected];
                    object description = GetRewardTitleInfo(title);

                    if (description is int)
                    {
                        AddHtmlLocalized(225, 70, 270, 140, (int)description, 0xFFFF, false, false);
                    }
                    else if (description is string)
                    {
                        AddHtml(225, 70, 270, 140, Color("#FFFFFF", (string)description), false, false);
                    }

                    AddHtmlLocalized(225, 220, 160, 16, 1115029, 0xFFFF, false, false); // Subtitle

                    if (title is int)
                    {
                        string cust = null;

                        if ((int)title == 1154017 && CityLoyaltySystem.HasCustomTitle(User, out cust))
                        {
                            AddHtmlLocalized(275, 240, 245, 16, 1154017, cust, 0xFFFF, false, false);
                        }
                        else
                        {
                            AddHtmlLocalized(275, 240, 160, 32, (int)title, 0xFFFF, false, false);
                        }
                    }
                    else
                    {
                        AddHtml(275, 240, 245, 16, Color("#FFFFFF", (string)title), false, false);
                    }

                    AddHtmlLocalized(225, 275, 200, 16, 1115035, 0xFFFF, false, false); // Do you wish to apply this title?

                    AddHtmlLocalized(480, 275, 80, 16, 1011046, 0xFFFF, false, false);  // APPLY
                    AddCallbackButton(445, 275, 4005, 4007, 699, GumpButtonType.Reply, 0, b =>
                    {
                        AddHtmlLocalized(225, 315, 200, 16, 1115036, 0xFFFF, false, false); // TITLE APPLIED
                        Refresh(false);

                        User.SelectCollectionTitle(TitleSelected, true);

                        if (User.SubtitleSkillTitle != null)
                        {
                            User.SubtitleSkillTitle = null;
                        }

                        User.DisplayGuildTitle = false;
                    });
                }
            }
            else if (Category == TitleCategory.Veteran && vetTitles != null && vetTitles.Count > 0)
            {
                if (!ShowingDescription || TitleSelected == -1)
                {
                    int index = 0;
                    int page  = 1;

                    AddPage(page);

                    for (int i = 0; i < vetTitles.Count; i++)
                    {
                        AddHtmlLocalized(260, 70 + (index * 22), 245, 16, vetTitles[i].Title, 0xFFFF, false, false);
                        AddCallbackButton(225, 70 + (index * 22), 4005, 4007, i + 700, GumpButtonType.Reply, 0, b =>
                        {
                            TitleSelected      = b.ButtonID - 700;
                            ShowingDescription = true;
                            Refresh();
                        });

                        index++;
                        CheckPage(ref index, ref page);
                    }
                }
                else if (TitleSelected >= 0 && TitleSelected < vetTitles.Count)
                {
                    VeteranTitle title = vetTitles[TitleSelected];

                    AddHtmlLocalized(225, 70, 270, 200, title.Title + 410, 0xFFFF, false, false);
                    AddHtmlLocalized(225, 220, 160, 16, 1115029, 0xFFFF, false, false); // Subtitle

                    AddHtmlLocalized(275, 240, 160, 32, title.Title, 0xFFFF, false, false);

                    AddHtmlLocalized(225, 275, 200, 16, 1115035, 0xFFFF, false, false); // Do you wish to apply this title?

                    AddHtmlLocalized(480, 275, 80, 16, 1011046, 0xFFFF, false, false);  // APPLY
                    AddCallbackButton(445, 275, 4005, 4007, 799, GumpButtonType.Reply, 0, b =>
                    {
                        AddHtmlLocalized(225, 315, 200, 16, 1115036, 0xFFFF, false, false); // TITLE APPLIED
                        title = vetTitles[TitleSelected];
                        User.CurrentVeteranTitle = title.Title;

                        Refresh(false);
                    });
                }
            }
        }
Пример #2
0
        private void BuildOverheadName()
        {
            int y = 190;

            AddHtmlLocalized(55, y, 160, 16, 1115030, 0xFFFF, false, false); // Skills
            AddCallbackButton(20, y, 4005, 4007, 300, GumpButtonType.Reply, 0, b =>
            {
                Category           = TitleCategory.Skills;
                ShowingDescription = false;
                TitleClearing      = false;
                Refresh();
            });

            y += 22;

            List <int> rewards = GetCityTitles();

            if (rewards != null && rewards.Count > 0)
            {
                AddHtmlLocalized(55, y, 160, 16, 1115034, 0xFFFF, false, false); // Rewards
                AddCallbackButton(20, y, 4005, 4007, 5435, GumpButtonType.Reply, 0, b =>
                {
                    Category           = TitleCategory.RewardTitles;
                    ShowingDescription = false;
                    TitleClearing      = false;
                    Refresh();
                });

                y += 22;
            }

            Guild g = User.Guild as Guild;

            if (g != null)
            {
                AddHtmlLocalized(55, y, 160, 16, 1115033, 0xFFFF, false, false); // GUILD
                AddCallbackButton(20, y, 4005, 4007, 301, GumpButtonType.Reply, 0, b =>
                {
                    Category           = TitleCategory.Guild;
                    ShowingDescription = false;
                    TitleClearing      = false;
                    Refresh();
                });
            }

            if (Category == TitleCategory.Skills)
            {
                if (!ShowingDescription || TitleSelected == -1)
                {
                    int index = 0;
                    int page  = 1;

                    AddPage(page);

                    foreach (Skill sk in User.Skills)
                    {
                        if (sk.Base < 30)
                        {
                            continue;
                        }

                        AddHtml(260, 70 + (index * 22), 245, 16, Color("#FFFFFF", "the " + sk.Info.Title), false, false);
                        AddCallbackButton(225, 70 + (index * 22), 4005, 4007, sk.Info.SkillID + 302, GumpButtonType.Reply, 0, b =>
                        {
                            TitleSelected      = b.ButtonID - 302;
                            ShowingDescription = true;
                            Refresh();
                        });

                        index++;
                        CheckPage(ref index, ref page);

                        /*if ((SkillName)sk.Info.SkillID == User.Skills.CurrentMastery && User.Skills.CurrentMastery != SkillName.Alchemy)
                         * {
                         *  AddHtml(260, 70 + (index * 22), 160, 16, Color("#FFFFFF", MasteryInfo.GetTitle(User)), false, false);
                         *  AddCallbackButton(225, 70 + (index * 22), 4005, 4007, 350, GumpButtonType.Reply, 0, b =>
                         *  {
                         *      TitleSelected = 350;
                         *      ShowingDescription = true;
                         *      Refresh();
                         *  });
                         *
                         *  index++;
                         * }
                         *
                         * CheckPage(ref index, ref page);*/
                    }
                }
                else
                {
                    string title;
                    int    desc;

                    /*if (TitleSelected == 350)
                     * {
                     *  title = MasteryInfo.GetTitle(User);
                     *  desc = MasteryInfo.GetDescription(User);
                     * }
                     * else
                     * {
                     *  title = "the " + User.Skills[(SkillName)TitleSelected].Info.Title;
                     *  desc = 1115056 + TitleSelected;
                     * }*/
                    title = "the " + User.Skills[(SkillName)TitleSelected].Info.Title;
                    desc  = 1115056 + TitleSelected;

                    AddHtmlLocalized(225, 70, 270, 140, desc, 0xFFFF, false, false);
                    AddHtmlLocalized(225, 220, 160, 16, 1115028, 0xFFFF, false, false); // Overhead Name

                    AddHtml(275, 240, 245, 16, Color("#FFFFFF", title), false, false);
                    AddHtmlLocalized(225, 275, 200, 16, 1115035, 0xFFFF, false, false); // Do you wish to apply this title?

                    AddHtmlLocalized(480, 275, 80, 16, 1011046, 0xFFFF, false, false);  // APPLY
                    AddCallbackButton(445, 275, 4005, 4007, 399, GumpButtonType.Reply, 0, b =>
                    {
                        AddHtmlLocalized(225, 315, 200, 16, 1115036, 0xFFFF, false, false); // TITLE APPLIED
                        title = "the " + User.Skills[(SkillName)TitleSelected].Info.Title;
                        User.OverheadTitle = title;

                        Refresh(false);
                    });
                }
            }
            else if (Category == TitleCategory.Guild && g != null)
            {
                if (!ShowingDescription || TitleSelected == -1)
                {
                    AddHtml(260, 70, 160, 16, Color("#FFFFFF", String.Format("[{0}]", g.Abbreviation)), false, false);
                    AddCallbackButton(225, 70, 4005, 4007, 397, GumpButtonType.Reply, 0, b =>
                    {
                        ShowingDescription = true;
                        TitleSelected      = 351;
                        Refresh();
                    });
                }
                else
                {
                    AddHtmlLocalized(225, 65, 270, 140, 1115040, 0xFFFF, false, false); // This is your guild's abbreviation.
                    AddHtmlLocalized(225, 220, 160, 16, 1115028, 0xFFFF, false, false); // Overhead Name

                    AddHtml(275, 240, 245, 16, Color("#FFFFFF", String.Format("[{0}]", g.Abbreviation)), false, false);
                    AddHtmlLocalized(225, 275, 200, 16, 1115035, 0xFFFF, false, false); // Do you wish to apply this title?

                    AddHtmlLocalized(480, 275, 80, 16, 1011046, 0xFFFF, false, false);  // APPLY
                    AddCallbackButton(445, 275, 4005, 4007, 398, GumpButtonType.Reply, 0, b =>
                    {
                        AddHtmlLocalized(225, 315, 200, 16, 1115036, 0xFFFF, false, false);     // TITLE APPLIED
                        Refresh(false);

                        User.OverheadTitle         = null;
                        User.ShowGuildAbbreviation = true;
                    });
                }
            }
            else if (Category == TitleCategory.RewardTitles && rewards != null && rewards.Count > 0)
            {
                if (!ShowingDescription || TitleSelected == -1)
                {
                    int index = 0;
                    int page  = 1;

                    AddPage(page);

                    for (int i = 0; i < rewards.Count; i++)
                    {
                        int title = rewards[i];

                        if (title == 1154017)
                        {
                            continue;
                        }

                        AddHtmlLocalized(260, 70 + (index * 22), 245, 16, (int)title, 0xFFFF, false, false);

                        AddCallbackButton(225, 70 + (index * 22), 4005, 4007, i + 2550, GumpButtonType.Reply, 0, b =>
                        {
                            TitleSelected      = b.ButtonID - 2550;
                            ShowingDescription = true;
                            Refresh();
                        });

                        index++;
                        CheckPage(ref index, ref page);
                    }
                }
                else if (TitleSelected >= 0 && TitleSelected < rewards.Count)
                {
                    int    title       = rewards[TitleSelected];
                    object description = GetRewardTitleInfo(title);

                    if (description is int)
                    {
                        AddHtmlLocalized(225, 70, 270, 140, (int)description, 0xFFFF, false, false);
                    }
                    else if (description is string)
                    {
                        AddHtml(225, 70, 270, 140, Color("#FFFFFF", (string)description), false, false);
                    }

                    AddHtmlLocalized(225, 220, 160, 16, 1115029, 0xFFFF, false, false); // Subtitle

                    string cust = null;
                    if (title == 1154017 && CityLoyaltySystem.HasCustomTitle(User, out cust))
                    {
                        AddHtmlLocalized(275, 240, 245, 16, 1154017, cust, 0xFFFF, false, false);
                    }
                    else
                    {
                        AddHtmlLocalized(275, 240, 160, 32, (int)title, 0xFFFF, false, false);
                    }

                    AddHtmlLocalized(225, 275, 200, 16, 1115035, 0xFFFF, false, false); // Do you wish to apply this title?

                    AddHtmlLocalized(480, 275, 80, 16, 1011046, 0xFFFF, false, false);  // APPLY
                    AddCallbackButton(445, 275, 4005, 4007, 5789, GumpButtonType.Reply, 0, b =>
                    {
                        AddHtmlLocalized(225, 315, 200, 16, 1115036, 0xFFFF, false, false); // TITLE APPLIED
                        Refresh(false);
                        title = rewards[TitleSelected];
                        User.OverheadTitle = title.ToString();
                    });
                }
            }
        }