Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public IntrinsicForgetMenu(Character player, OnChooseSlot action, Action refuseAction)
        {
            this.player           = player;
            this.chooseSlotAction = action;
            this.refuseAction     = refuseAction;

            List <MenuTextChoice> intrinsics = new List <MenuTextChoice>();

            for (int ii = 0; ii < CharData.MAX_INTRINSIC_SLOTS; ii++)
            {
                if (player.BaseIntrinsics[ii] > -1)
                {
                    intrinsics.Add(new MenuTextChoice(Data.DataManager.Instance.GetIntrinsic(player.BaseIntrinsics[ii]).Name.ToLocal(), () => { choose(ii); }));
                }
            }

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

            Description = new DialogueText("", summaryMenu.Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight),
                                           summaryMenu.Bounds.End.X - GraphicsManager.MenuBG.TileWidth * 4 - summaryMenu.Bounds.X, LINE_SPACE, false);
            summaryMenu.Elements.Add(Description);

            Initialize(new Loc(16, 16), 144, Text.FormatKey("MENU_INTRINSIC_TITLE", player.BaseName), intrinsics.ToArray(), 0);
        }
        public IntrinsicRecallMenu(Character player, int[] intrinsicChoices, OnChooseSlot action, Action refuseAction)
        {
            this.player           = player;
            this.intrinsicChoices = intrinsicChoices;
            this.chooseSlotAction = action;
            this.refuseAction     = refuseAction;


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

            for (int ii = 0; ii < intrinsicChoices.Length; ii++)
            {
                int index = ii;
                flatChoices.Add(new MenuTextChoice(Data.DataManager.Instance.GetIntrinsic(intrinsicChoices[index]).GetColoredName(), () => { choose(index); }));
            }
            List <MenuChoice[]> intrinsics = SortIntoPages(flatChoices, SLOTS_PER_PAGE);

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

            Description = new DialogueText("", summaryMenu.Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight),
                                           summaryMenu.Bounds.End.X - GraphicsManager.MenuBG.TileWidth * 4 - summaryMenu.Bounds.X, LINE_SPACE, false);
            summaryMenu.Elements.Add(Description);

            Initialize(new Loc(16, 16), 144, Text.FormatKey("MENU_INTRINSIC_RECALL"), intrinsics.ToArray(), 0, 0, SLOTS_PER_PAGE);
        }
Exemplo n.º 4
0
        public TutorTeamMenu(int teamSlot, OnChooseSlot action, Action refuseAction)
        {
            this.chooseSlotAction = action;
            this.refuseAction     = refuseAction;
            int menuWidth          = 160;
            List <MenuChoice> team = new List <MenuChoice>();

            foreach (Character character in DataManager.Instance.Save.ActiveTeam.Players)
            {
                int teamIndex = team.Count;

                MenuText memberName = new MenuText(character.GetDisplayName(true), new Loc(2, 1), Color.White);
                MenuText memberLv   = new MenuText(Text.FormatKey("MENU_TEAM_LEVEL_SHORT", character.Level), new Loc(menuWidth - 8 * 4, 1), DirV.Up, DirH.Right, Color.White);
                team.Add(new MenuElementChoice(() => { choose(teamIndex); }, true, memberName, memberLv));
            }

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

            if (teamSlot == -1)
            {
                teamSlot = Math.Min(Math.Max(0, defaultChoice), team.Count - 1);
            }

            Initialize(new Loc(16, 16), menuWidth, Text.FormatKey("MENU_TEAM_TITLE"), team.ToArray(), teamSlot);
        }
Exemplo n.º 5
0
        public DungeonsMenu(List <int> availables, List <ZoneLoc> groundDests, OnChooseSlot dungeonAction, OnChooseSlot groundAction)
        {
            chooseDungeonAction = dungeonAction;
            chooseGroundAction  = groundAction;
            dungeonIndices      = availables;
            List <MenuChoice> flatChoices = new List <MenuChoice>();

            for (int ii = 0; ii < dungeonIndices.Count; ii++)
            {
                int dungeonIndex = ii;
                flatChoices.Add(new MenuTextChoice(DataManager.Instance.DataIndices[DataManager.DataType.Zone].Entries[dungeonIndices[ii]].GetColoredName(), () => { chooseDungeon(dungeonIndex); }, true,
                                                   (DataManager.Instance.Save.DungeonUnlocks[dungeonIndices[ii]] == GameProgress.UnlockState.Completed) ? Color.White : Color.Cyan));
            }
            for (int ii = 0; ii < groundDests.Count; ii++)
            {
                ZoneData zone        = DataManager.Instance.GetZone(groundDests[ii].ID);
                int      groundIndex = ii;
                flatChoices.Add(new MenuTextChoice(DataManager.Instance.GetGround(zone.GroundMaps[groundDests[ii].StructID.ID]).GetColoredName(), () => { chooseGround(groundIndex); }));
            }
            List <MenuChoice[]> choices = SortIntoPages(flatChoices, SLOTS_PER_PAGE);

            summaryMenu = new DungeonSummary(Rect.FromPoints(new Loc(176, 16), new Loc(GraphicsManager.ScreenWidth - 16, 16 + GraphicsManager.MenuBG.TileHeight * 2 + VERT_SPACE * 7)));

            Initialize(new Loc(0, 0), 160, Text.FormatKey("MENU_DUNGEON_TITLE"), choices.ToArray(), 0, 0, Math.Min(SLOTS_PER_PAGE, flatChoices.Count));
        }
Exemplo n.º 6
0
        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);
        }
        public FacilityTeamChosenMenu(int teamSlot, OnChooseSlot action)
        {
            this.teamSlot         = teamSlot;
            this.chooseSlotAction = action;

            List <MenuTextChoice> choices = new List <MenuTextChoice>();

            choices.Add(new MenuTextChoice(Text.FormatKey("MENU_CHOOSE"), RememberAction));
            choices.Add(new MenuTextChoice(Text.FormatKey("MENU_TEAM_SUMMARY"), SummaryAction));
            choices.Add(new MenuTextChoice(Text.FormatKey("MENU_EXIT"), ExitAction));

            Initialize(new Loc(176, 16), CalculateChoiceLength(choices, 72), choices.ToArray(), 0);
        }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 9
0
        public MainStartingMenu(int startIndex, OnChooseSlot chooseAction, Action onCancel)
        {
            this.chooseAction = chooseAction;
            this.onCancel     = onCancel;
            List <MenuChoice> flatChoices = new List <MenuChoice>();

            for (int ii = 0; ii < DataManager.Instance.StartChars.Count; ii++)
            {
                MonsterID startChar = DataManager.Instance.StartChars[ii].mon;
                string    name      = DataManager.Instance.GetMonster(startChar.Species).GetColoredName();
                if (DataManager.Instance.StartChars[ii].name != "")
                {
                    name = DataManager.Instance.StartChars[ii].name;
                }
                int index = ii;
                flatChoices.Add(new MenuTextChoice(name, () => { this.chooseAction(index); }));
            }

            startIndex = Math.Clamp(startIndex, 0, flatChoices.Count - 1);

            Portrait = new SpeakerPortrait(new MonsterID(), new EmoteStyle(0), new Loc(200, 32), true);

            Initialize(new Loc(16, 16), 112, Text.FormatKey("MENU_CHARA_CHOICE_TITLE"), flatChoices.ToArray(), startIndex);
        }
Exemplo n.º 10
0
        public SwapShopMenu(List <Tuple <int, int[]> > goods, int[] priceList, int defaultChoice, OnChooseSlot chooseSlot)
        {
            Goods        = goods;
            PriceList    = priceList;
            action       = chooseSlot;
            AllowedGoods = new List <int>();

            itemPresence  = new bool[DataManager.Instance.DataIndices[DataManager.DataType.Item].Count];
            tradePresence = new bool[DataManager.Instance.DataIndices[DataManager.DataType.Item].Count];
            for (int ii = 0; ii < itemPresence.Length; ii++)
            {
                if (DataManager.Instance.Save.ActiveTeam.Storage[ii] > 0)
                {
                    updatePresence(ii);
                }
            }
            for (int ii = 0; ii < DataManager.Instance.Save.ActiveTeam.GetInvCount(); ii++)
            {
                updatePresence(DataManager.Instance.Save.ActiveTeam.GetInv(ii).ID);
            }

            for (int ii = 0; ii < DataManager.Instance.Save.ActiveTeam.Players.Count; ii++)
            {
                Character activeChar = DataManager.Instance.Save.ActiveTeam.Players[ii];
                if (activeChar.EquippedItem.ID > -1)
                {
                    updatePresence(activeChar.EquippedItem.ID);
                }
            }

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

            for (int ii = 0; ii < goods.Count; ii++)
            {
                int index = ii;

                bool  canView   = false;
                bool  canTrade  = true;
                int   wildcards = 0;
                int[] reqs      = goods[ii].Item2;
                for (int jj = 0; jj < reqs.Length; jj++)
                {
                    if (reqs[jj] > -1)
                    {
                        if (!itemPresence[reqs[jj]])
                        {
                            canTrade = false;
                        }
                        else
                        {
                            canView = true;
                        }
                    }
                    else
                    {
                        wildcards++;
                        canView = true;
                    }
                }

                if (canView)
                {
                    AllowedGoods.Add(ii);
                    ItemData itemEntry = DataManager.Instance.GetItem(goods[ii].Item1);
                    if (PriceList[itemEntry.Rarity] > DataManager.Instance.Save.ActiveTeam.Money || wildcards > presenceCount)
                    {
                        canTrade = false;
                    }
                    flatChoices.Add(new MenuTextChoice(itemEntry.GetIconName(), () => { choose(index); }, canTrade, canTrade ? Color.White : Color.Red));
                }
            }
            defaultChoice = Math.Min(defaultChoice, flatChoices.Count - 1);
            int startChoice         = defaultChoice % SLOTS_PER_PAGE;
            int startPage           = defaultChoice / SLOTS_PER_PAGE;
            List <MenuChoice[]> inv = SortIntoPages(flatChoices, SLOTS_PER_PAGE);


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

            tradeSummary = new TradeSummary(Rect.FromPoints(new Loc(16 + SWAP_MENU_WIDTH, summaryMenu.Bounds.Top - LINE_SPACE * 7 - GraphicsManager.MenuBG.TileHeight * 2),
                                                            new Loc(GraphicsManager.ScreenWidth - 16, summaryMenu.Bounds.Top)));
            moneySummary = new MoneySummary(Rect.FromPoints(new Loc(16 + SWAP_MENU_WIDTH, tradeSummary.Bounds.Top - LINE_SPACE * 2 - GraphicsManager.MenuBG.TileHeight * 2),
                                                            new Loc(GraphicsManager.ScreenWidth - 16, tradeSummary.Bounds.Top)));

            int buyLimit = DataManager.Instance.Save.ActiveTeam.GetMaxInvSlots(ZoneManager.Instance.CurrentZone) - DataManager.Instance.Save.ActiveTeam.GetInvCount();

            Initialize(new Loc(16, 16), SWAP_MENU_WIDTH, Text.FormatKey("MENU_SHOP_TITLE"), inv.ToArray(), startChoice, startPage, SLOTS_PER_PAGE);
        }