示例#1
0
        public override Embed GetEmbed()
        {
            EmbedBuilder eb = new EmbedBuilder();

            eb.WithTitle("Titles");
            eb.WithColor(BotUtils.Kamtro);

            if (SelectedTitle == null)
            {
                // if the embed is on the home page AKA title list page
                eb.WithColor(BotUtils.Kamtro);

                string txt = "";

                if (AchievementManager.TitleCount() <= 0)
                {
                    txt = "Titles not available. Contact Caron or Arcy.";
                }
                else if (AchievementManager.TitleCount() <= MAX_TITLES_DISPLAYED)
                {
                    for (int i = 0; i < Titles.Count; i++)
                    {
                        txt += MakeBold($"{(Cursor == i ? CustomEmotes.CursorAnimated : CustomEmotes.CursorBlankSpace)}{Titles[i].Item2.Name}", UserDataManager.HasTitle(User, Titles[i].Item1)) + "\n";
                    }
                }
                else
                {
                    if (Start != 0)
                    {
                        txt += "***[...]***\n";
                    }

                    for (int i = Start; i <= Math.Min(Titles.Count - 1, MAX_TITLES_DISPLAYED + Start); i++)
                    {
                        // display titles starting from Start
                        txt += MakeBold($"{(Cursor == i ? CustomEmotes.CursorAnimated : CustomEmotes.CursorBlankSpace)}{Titles[i].Item2.Name}", UserDataManager.HasTitle(User, Titles[i].Item1)) + "\n";
                    }

                    if (Start < Titles.Count - 1 - MAX_TITLES_DISPLAYED)
                    {
                        txt += "***[...]***";
                    }
                }

                eb.AddField("Title List", txt.TrimEnd('\n'));

                MenuOptions.Find((x) => x.Icon == ReactionHandler.SELECT_STR).Description = "Select";
            }
            else
            {
                // if it's on a title page
                TitleNode tn = AchievementManager.GetTitle(SelectedTitle.Value);

                eb.WithColor(tn.GetColor());

                eb.AddField("Title Name", tn.Name);
                if (tn.Secret)
                {
                    eb.AddField("Secret", "This is a secret title!");
                }

                eb.AddField("Kamtroken Reward", $"{tn.KamtrokenReward}", true);
                eb.AddField("Temp Rep Reward", $"{tn.TempRepReward}", true);

                // section for additional rewards
                // most common of these is the perm rep increase
                // Kamtro god will also pimp out your profile
                string add = "";

                if (tn.PermRepReward > 0)
                {
                    add += $"Earning this title will increase the number of rep points you get each week by {tn.PermRepReward}!\n";
                }
                if (SelectedTitle.Value == 0)
                {
                    add += "This title will add a special badge to your profile!";
                }

                if (!string.IsNullOrWhiteSpace(add))
                {
                    eb.AddField("Additional Rewards:", add.TrimEnd('\n'));
                }

                MenuOptions.Find((x) => x.Icon == ReactionHandler.SELECT_STR).Description = "Equip Title";
            }

            if (NoTitleNotify)
            {
                NoTitleNotify = false;
                eb.AddField("Alert", "You don't have this title unlocked!");
            }

            if (TitleEquipedNotify)
            {
                TitleEquipedNotify = false;
                eb.AddField("Success", "Title Equipped!");
            }

            AddMenu(eb);

            return(eb.Build());
        }