public SkillRecallMenu(Character player, int[] forgottenSkills, OnChooseSlot action, Action refuseAction)
        {
            int menuWidth = 152;

            this.player           = player;
            this.forgottenSkills  = forgottenSkills;
            this.chooseSlotAction = action;
            this.refuseAction     = refuseAction;

            List <MenuChoice> flatChoices = new List <MenuChoice>();

            for (int ii = 0; ii < forgottenSkills.Length; ii++)
            {
                Data.SkillData skillEntry      = Data.DataManager.Instance.GetSkill(forgottenSkills[ii]);
                string         newSkillString  = skillEntry.GetColoredName();
                int            maxCharges      = skillEntry.BaseCharges + player.ChargeBoost;
                string         newSkillCharges = maxCharges + "/" + maxCharges;
                int            index           = ii;
                MenuText       newMenuText     = new MenuText(newSkillString, new Loc(2, 1));
                MenuText       newMenuCharges  = new MenuText(newSkillCharges, new Loc(menuWidth - 8 * 4, 1), DirH.Right);
                flatChoices.Add(new MenuElementChoice(() => { choose(index); }, true, newMenuText, newMenuCharges));
            }
            List <MenuChoice[]> char_skills = SortIntoPages(flatChoices, SLOTS_PER_PAGE);

            summaryMenu = new SkillSummary(Rect.FromPoints(new Loc(16,
                                                                   GraphicsManager.ScreenHeight - 8 - GraphicsManager.MenuBG.TileHeight * 2 - LINE_SPACE * 2 - VERT_SPACE * 4),
                                                           new Loc(GraphicsManager.ScreenWidth - 16, GraphicsManager.ScreenHeight - 8)));

            Initialize(new Loc(16, 16), menuWidth, Text.FormatKey("MENU_SKILL_RECALL"), char_skills.ToArray(), 0, 0, SLOTS_PER_PAGE);
        }
        public SkillForgetMenu(Character player, OnChooseSlot action, Action refuseAction)
        {
            int menuWidth = 152;

            this.player           = player;
            this.chooseSlotAction = action;
            this.refuseAction     = refuseAction;


            List <MenuChoice> char_skills = new List <MenuChoice>();

            for (int ii = 0; ii < player.BaseSkills.Count; ii++)
            {
                SlotSkill skill = player.BaseSkills[ii];
                if (skill.SkillNum > -1)
                {
                    SkillData data         = DataManager.Instance.GetSkill(skill.SkillNum);
                    string    skillString  = data.Name.ToLocal();
                    string    skillCharges = skill.Charges + "/" + (data.BaseCharges + player.ChargeBoost);
                    int       index        = ii;
                    MenuText  menuText     = new MenuText(skillString, new Loc(2, 1));
                    MenuText  menuCharges  = new MenuText(skillCharges, new Loc(menuWidth - 8 * 4, 1), DirH.Right);
                    char_skills.Add(new MenuElementChoice(() => { choose(index); }, true, menuText, menuCharges));
                }
            }

            summaryMenu = new SkillSummary(Rect.FromPoints(new Loc(16,
                                                                   GraphicsManager.ScreenHeight - 8 - GraphicsManager.MenuBG.TileHeight * 2 - LINE_SPACE * 2 - VERT_SPACE * 4),
                                                           new Loc(GraphicsManager.ScreenWidth - 16, GraphicsManager.ScreenHeight - 8)));

            Initialize(new Loc(16, 16), menuWidth, Text.FormatKey("MENU_SKILLS_TITLE", player.BaseName), char_skills.ToArray(), 0, CharData.MAX_SKILL_SLOTS);
        }
Beispiel #3
0
        public SkillMenu(int teamIndex, int skillSlot)
        {
            int menuWidth = 152;

            List <Character> openPlayers = new List <Character>();

            foreach (Character character in DataManager.Instance.Save.ActiveTeam.Players)
            {
                openPlayers.Add(character);
            }

            MenuChoice[][] skills = new MenuChoice[openPlayers.Count][];
            for (int ii = 0; ii < openPlayers.Count; ii++)
            {
                List <MenuChoice> char_skills = new List <MenuChoice>();
                for (int jj = 0; jj < DataManager.Instance.Save.ActiveTeam.Players[ii].Skills.Count; jj++)
                {
                    Skill skill = DataManager.Instance.Save.ActiveTeam.Players[ii].Skills[jj].Element;
                    if (skill.SkillNum > -1)
                    {
                        SkillData data         = DataManager.Instance.GetSkill(skill.SkillNum);
                        string    skillString  = (skill.Enabled ? "\uE10A " : "") + data.Name.ToLocal();
                        string    skillCharges = skill.Charges + "/" + (data.BaseCharges + DataManager.Instance.Save.ActiveTeam.Players[ii].ChargeBoost);
                        bool      disabled     = (skill.Sealed || skill.Charges <= 0);
                        int       index        = jj;
                        MenuText  menuText     = new MenuText(skillString, new Loc(2, 1), disabled ? Color.Red : Color.White);
                        MenuText  menuCharges  = new MenuText(skillCharges, new Loc(menuWidth - 8 * 4, 1), DirV.Up, DirH.Right, disabled ? Color.Red : Color.White);
                        if (jj < Character.MAX_SKILL_SLOTS - 1)
                        {
                            MenuDivider div = new MenuDivider(new Loc(0, LINE_SPACE), menuWidth - 8 * 4);
                            char_skills.Add(new MenuElementChoice(() => { choose(index); }, true, menuText, menuCharges, div));
                        }
                        else
                        {
                            char_skills.Add(new MenuElementChoice(() => { choose(index); }, true, menuText, menuCharges));
                        }
                    }
                }
                skills[ii] = char_skills.ToArray();
            }

            if (skillSlot == -1)
            {
                skillSlot = Math.Min(Math.Max(0, defaultChoice), skills[teamIndex].Length - 1);
            }

            summaryMenu = new SkillSummary(Rect.FromPoints(new Loc(16,
                                                                   GraphicsManager.ScreenHeight - 8 - GraphicsManager.MenuBG.TileHeight * 2 - LINE_SPACE * 2 - VERT_SPACE * 4),
                                                           new Loc(GraphicsManager.ScreenWidth - 16, GraphicsManager.ScreenHeight - 8)));

            Initialize(new Loc(16, 16), menuWidth, Text.FormatKey("MENU_SKILLS_TITLE", DataManager.Instance.Save.ActiveTeam.Players[CurrentPage].BaseName), skills, skillSlot, teamIndex, CharData.MAX_SKILL_SLOTS);
        }
        public SkillReplaceMenu(Character player, int skillNum, OnChooseSlot learnAction, Action refuseAction)
        {
            int menuWidth = 152;

            this.player       = player;
            this.skillNum     = skillNum;
            this.learnAction  = learnAction;
            this.refuseAction = refuseAction;

            List <MenuChoice> char_skills = new List <MenuChoice>();

            for (int ii = 0; ii < player.BaseSkills.Count; ii++)
            {
                SlotSkill skill = player.BaseSkills[ii];
                if (skill.SkillNum > -1)
                {
                    SkillData   data         = DataManager.Instance.GetSkill(skill.SkillNum);
                    string      skillString  = data.GetColoredName();
                    string      skillCharges = skill.Charges + "/" + (data.BaseCharges + player.ChargeBoost);
                    int         index        = ii;
                    MenuText    menuText     = new MenuText(skillString, new Loc(2, 1));
                    MenuText    menuCharges  = new MenuText(skillCharges, new Loc(menuWidth - 8 * 4, 1), DirH.Right);
                    MenuDivider div          = new MenuDivider(new Loc(0, LINE_SPACE), menuWidth - 8 * 4);
                    char_skills.Add(new MenuElementChoice(() => { choose(index); }, true, menuText, menuCharges, div));
                }
            }
            string   newSkillString  = DataManager.Instance.GetSkill(skillNum).GetColoredName();
            int      maxCharges      = DataManager.Instance.GetSkill(skillNum).BaseCharges + player.ChargeBoost;
            string   newSkillCharges = maxCharges + "/" + maxCharges;
            MenuText newMenuText     = new MenuText(newSkillString, new Loc(2, 1));
            MenuText newMenuCharges  = new MenuText(newSkillCharges, new Loc(menuWidth - 8 * 4, 1), DirH.Right);

            char_skills.Add(new MenuElementChoice(() => { choose(CharData.MAX_SKILL_SLOTS); }, true, newMenuText, newMenuCharges));

            summaryMenu = new SkillSummary(Rect.FromPoints(new Loc(16,
                                                                   GraphicsManager.ScreenHeight - 8 - GraphicsManager.MenuBG.TileHeight * 2 - LINE_SPACE * 2 - VERT_SPACE * 4),
                                                           new Loc(GraphicsManager.ScreenWidth - 16, GraphicsManager.ScreenHeight - 8)));

            Initialize(new Loc(16, 16), menuWidth, Text.FormatKey("MENU_SKILLS_TITLE", player.GetDisplayName(true)), char_skills.ToArray(), 0);
        }