コード例 #1
0
ファイル: TopMenu.cs プロジェクト: RogueCollab/RogueEssence
        public TopMenu()
        {
            bool inMod = PathMod.Mod != "";
            List <MenuTextChoice> choices = new List <MenuTextChoice>();

            if (DataManager.Instance.Save != null)
            {
                if (DataManager.Instance.Save.Rescue != null)
                {
                    if (DataManager.Instance.Save.Rescue.SOS.RescuingTeam == null)
                    {
                        choices.Add(new MenuTextChoice(Text.FormatKey("MENU_TOP_RESCUE_AWAIT"), () => { MenuManager.Instance.AddMenu(new RescueMenu(), false); }));
                    }
                    else
                    {
                        choices.Add(new MenuTextChoice(Text.FormatKey("MENU_TOP_CONTINUE"), () => { Continue(DataManager.Instance.Save.Rescue.SOS); }));
                    }
                }
                else
                {
                    choices.Add(new MenuTextChoice(Text.FormatKey("MENU_TOP_CONTINUE"), () => { Continue(null); }));
                }
                if (DataManager.Instance.Save.ActiveTeam.Name != "" && !inMod)
                {
                    choices.Add(new MenuTextChoice(Text.FormatKey("MENU_TOP_ROGUE"), () => { MenuManager.Instance.AddMenu(new RogueMenu(), false); }));
                }
            }
            else
            {
                choices.Add(new MenuTextChoice(Text.FormatKey("MENU_TOP_NEW"), () => { MainStartingMenu.StartFlow(new MonsterID(-1, -1, -1, Gender.Unknown), null, -1); }));
            }


            if (DataManager.Instance.FoundRecords(PathMod.ModSavePath(DataManager.REPLAY_PATH)) || DataManager.Instance.Save != null || RecordHeaderData.LoadHighScores().Count > 0)
            {
                choices.Add(new MenuTextChoice(Text.FormatKey("MENU_TOP_RECORD"), () => { MenuManager.Instance.AddMenu(new RecordsMenu(), false); }));
            }
            choices.Add(new MenuTextChoice(Text.FormatKey("MENU_OPTIONS_TITLE"), () => { MenuManager.Instance.AddMenu(new OptionsMenu(), false); }));

            if (!inMod)
            {
                string[] modsPath = Directory.GetDirectories(PathMod.MODS_PATH);
                if (DataManager.Instance.Save != null && modsPath.Length > 0)
                {
                    choices.Add(new MenuTextChoice(Text.FormatKey("MENU_MODS_TITLE"), () => { MenuManager.Instance.AddMenu(new ModsMenu(), false); }));
                }
            }
            else
            {
                choices.Add(new MenuTextChoice(Text.FormatKey("MENU_MODS_EXIT"), exitMod));
            }
            choices.Add(new MenuTextChoice(Text.FormatKey("MENU_QUIT_GAME"), exitGame));

            Initialize(new Loc(16, 16), CalculateChoiceLength(choices, 72), choices.ToArray(), 0);

            titleMenu = new SummaryMenu(Rect.FromPoints(new Loc(Bounds.End.X + 16, 16), new Loc(GraphicsManager.ScreenWidth - 16, 16 + LINE_SPACE + GraphicsManager.MenuBG.TileHeight * 2)));
            MenuText title = new MenuText(Path.GetFileName(PathMod.Mod), new Loc((titleMenu.Bounds.X + titleMenu.Bounds.End.X) / 2, titleMenu.Bounds.Y + GraphicsManager.MenuBG.TileHeight), DirH.None);

            titleMenu.Elements.Add(title);
        }
コード例 #2
0
ファイル: HotkeyMenu.cs プロジェクト: Parakoopa/RogueEssence
        public HotkeyMenu(int skillSlot)
        {
            this.skillSlot = skillSlot;
            Loc center = new Loc();

            if (skillSlot == 0)
            {
                center = new Loc(GraphicsManager.ScreenWidth / 4, GraphicsManager.ScreenHeight / 4);
            }
            else if (skillSlot == 1)
            {
                center = new Loc(GraphicsManager.ScreenWidth * 3 / 4, GraphicsManager.ScreenHeight / 4);
            }
            else if (skillSlot == 2)
            {
                center = new Loc(GraphicsManager.ScreenWidth / 4, GraphicsManager.ScreenHeight * 3 / 4 - 32);
            }
            else if (skillSlot == 3)
            {
                center = new Loc(GraphicsManager.ScreenWidth * 3 / 4, GraphicsManager.ScreenHeight * 3 / 4 - 32);
            }

            Bounds       = Rect.FromPoints(center - new Loc(56 + GraphicsManager.MenuBG.TileWidth, 0), center + new Loc(56 + GraphicsManager.MenuBG.TileWidth, LINE_SPACE * 2 + GraphicsManager.MenuBG.TileHeight * 2));
            skillText    = new MenuText("", center + new Loc(-48, GraphicsManager.MenuBG.TileHeight), DirH.Left);
            skillElement = new MenuText("", center + new Loc(-48, GraphicsManager.MenuBG.TileHeight + LINE_SPACE), DirH.Left);
            skillCharges = new MenuText("", center + new Loc(48, GraphicsManager.MenuBG.TileHeight + LINE_SPACE), DirH.Right);
        }
コード例 #3
0
        public SpoilsMenu(List <Tuple <InvItem, InvItem> > goods)
        {
            Goods = goods;

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

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

                MenuText boxText  = new MenuText(goods[index].Item1.GetDisplayName(), new Loc(2, 1));
                MenuText itemText = new MenuText("\u2192 " + goods[index].Item2.GetDisplayName(), new Loc((SPOILS_MENU_WIDTH - 8 * 4) / 2 - 16, 1));
                flatChoices.Add(new MenuElementChoice(choose, true, boxText, itemText));
            }

            int startChoice         = 0;
            int startPage           = 0;
            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)));

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

            Initialize(new Loc(16, 16), SPOILS_MENU_WIDTH, Text.FormatKey("MENU_TREASURE_TITLE"), inv.ToArray(), startChoice, startPage, SLOTS_PER_PAGE);
        }
コード例 #4
0
        public OfferFeaturesMenu(Rect bounds, TradeTeamMenu baseMenu)
        {
            Bounds        = bounds;
            this.baseMenu = baseMenu;

            Portrait = new SpeakerPortrait(new MonsterID(), new EmoteStyle(0),
                                           Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight), false);

            Nickname = new MenuText("", Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 48, GraphicsManager.MenuBG.TileHeight));
            Name     = new MenuText("", Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 48, GraphicsManager.MenuBG.TileHeight + VERT_SPACE));

            Level = new MenuText("", Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 48, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 2));

            Elements = new MenuText("", Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 3));

            MainDiv = new MenuDivider(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 4 - 2), Bounds.End.X - Bounds.X - GraphicsManager.MenuBG.TileWidth * 2);

            Skills = new MenuText[CharData.MAX_SKILL_SLOTS];
            for (int ii = 0; ii < CharData.MAX_SKILL_SLOTS; ii++)
            {
                Skills[ii] = new MenuText("", Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * (ii + 4)));
            }

            IntrinsicDiv = new MenuDivider(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 8 - 2), Bounds.End.X - Bounds.X - GraphicsManager.MenuBG.TileWidth * 2);

            Intrinsic = new MenuText("", Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 8));
        }
コード例 #5
0
        public AddToTeamMenu(OnChooseTeam teamChoice, Action refuseAction)
        {
            int menuWidth = 152;

            this.teamChoice   = teamChoice;
            this.refuseAction = refuseAction;

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

            for (int ii = 0; ii < DungeonScene.Instance.ActiveTeam.Assembly.Count; ii++)
            {
                int       index      = ii;
                Character character  = DungeonScene.Instance.ActiveTeam.Assembly[index];
                MenuText  memberName = new MenuText(character.BaseName, new Loc(2, 1), character.Dead ? Color.Red : Color.White);
                MenuText  memberLv   = new MenuText(Text.FormatKey("MENU_TEAM_LEVEL_SHORT", character.Level), new Loc(menuWidth - 8 * 4, 1),
                                                    DirV.Up, DirH.Right, character.Dead ? Color.Red : Color.White);
                flatChoices.Add(new MenuElementChoice(() => { choose(index); }, !character.Dead, memberName, memberLv));
            }
            List <MenuChoice[]> box = SortIntoPages(flatChoices, SLOTS_PER_PAGE);

            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)));

            portrait = new SpeakerPortrait(new MonsterID(), new EmoteStyle(0), new Loc(GraphicsManager.ScreenWidth - 32 - 40, 16), true);

            Initialize(new Loc(16, 16), menuWidth, Text.FormatKey("MENU_ASSEMBLY_TITLE"), box.ToArray(), 0, 0, SLOTS_PER_PAGE);
        }
コード例 #6
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);
        }
コード例 #7
0
        //TODO: merge with the Withdraw menu, maybe.  don't worry about this right now because it's not used for anything
        public StorageMenu(Character player, bool multiSelect, OnMultiChoice storageChoice, Action refuseAction)
        {
            this.multiSelect   = multiSelect;
            this.storageChoice = storageChoice;
            this.refuseAction  = refuseAction;

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

            for (int ii = 0; ii < DataManager.Instance.Save.ActiveTeam.Storage.Length; ii++)
            {
                int index = ii;
                if (DataManager.Instance.Save.ActiveTeam.Storage[ii] > 0)
                {
                    availableItems.Add(index);
                    MenuText menuText  = new MenuText(DataManager.Instance.GetItem(ii).GetIconName(), new Loc(2, 1));
                    MenuText menuCount = new MenuText("(" + DataManager.Instance.Save.ActiveTeam.Storage[ii] + ")", new Loc(ItemMenu.ITEM_MENU_WIDTH - 8 * 4, 1), DirV.Up, DirH.Right, Color.White);
                    flatChoices.Add(new MenuElementChoice(() => { choose(index); }, true, menuText, menuCount));
                }
            }
            for (int ii = 0; ii < DataManager.Instance.Save.ActiveTeam.BoxStorage.Count; ii++)
            {
                int index = ii + DataManager.Instance.DataIndices[DataManager.DataType.Item].Count;
                availableItems.Add(index);
                flatChoices.Add(new MenuTextChoice(DataManager.Instance.Save.ActiveTeam.BoxStorage[ii].GetDisplayName(), () => { choose(index); }));
            }
            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)));


            Initialize(new Loc(16, 16), ItemMenu.ITEM_MENU_WIDTH, Text.FormatKey("MENU_STORAGE_TITLE"), inv.ToArray(), 0, 0, SLOTS_PER_PAGE);
        }
コード例 #8
0
        public GamepadControlsMenu()
        {
            actionButtons = new Buttons[DiagManager.Instance.CurSettings.ActionButtons.Length];

            DiagManager.Instance.CurSettings.ActionButtons.CopyTo(actionButtons, 0);

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

            for (int ii = 0; ii < actionButtons.Length; ii++)
            {
                int index = ii;
                if (!Settings.UsedByGamepad((FrameInput.InputType)index))
                {
                    continue;
                }
                MenuText buttonName = new MenuText(((FrameInput.InputType)index).ToLocal(), new Loc(2, 1), Color.White);
                MenuText buttonType = new MenuText("(" + actionButtons[index].ToLocal() + ")", new Loc(200, 1), DirH.Right);
                flatChoices.Add(new MenuElementChoice(() => { chooseAction(index, buttonType); }, true, buttonName, buttonType));
            }

            flatChoices.Add(new MenuTextChoice(Text.FormatKey("MENU_CONTROLS_RESET"), resetDefaults));
            flatChoices.Add(new MenuTextChoice(Text.FormatKey("MENU_CONTROLS_CONFIRM"), confirm));
            List <MenuChoice[]> choices = SortIntoPages(flatChoices, SLOTS_PER_PAGE);

            Initialize(new Loc(16, 16), 232, Text.FormatKey("MENU_GAMEPAD_TITLE"), choices.ToArray(), 0, 0, SLOTS_PER_PAGE);
        }
コード例 #9
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);
        }
コード例 #10
0
ファイル: TeachMenu.cs プロジェクト: RogueCollab/RogueEssence
        public TeachMenu(int slot, bool held)
        {
            this.slot = slot;
            this.held = held;

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

            foreach (Character character in DataManager.Instance.Save.ActiveTeam.Players)
            {
                bool canLearn  = CanLearnSkill(character, DataManager.Instance.Save.ActiveTeam.Leader, slot, held) && !character.Dead;
                int  teamIndex = team.Count;
                team.Add(new MenuTextChoice(character.GetDisplayName(true), () => { choose(teamIndex); }, canLearn, canLearn ? Color.White : Color.Red));
            }

            Loc summaryStart = new Loc(16, 16 + team.Count * VERT_SPACE + GraphicsManager.MenuBG.TileHeight * 2 + ContentOffset);

            summaryMenu = new SummaryMenu(new Rect(summaryStart, new Loc(144, CharData.MAX_SKILL_SLOTS * VERT_SPACE + GraphicsManager.MenuBG.TileHeight * 2 + ContentOffset)));

            SummaryTitle = new MenuText("", summaryMenu.Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth + 8, GraphicsManager.MenuBG.TileHeight));
            summaryMenu.Elements.Add(SummaryTitle);
            summaryMenu.Elements.Add(new MenuDivider(summaryMenu.Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + LINE_SPACE), 144 - GraphicsManager.MenuBG.TileWidth * 2));
            Skills       = new MenuText[CharData.MAX_SKILL_SLOTS];
            SkillCharges = new MenuText[CharData.MAX_SKILL_SLOTS];
            for (int ii = 0; ii < Skills.Length; ii++)
            {
                Skills[ii] = new MenuText("", summaryMenu.Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth + 8, GraphicsManager.MenuBG.TileHeight + ContentOffset + VERT_SPACE * ii));
                summaryMenu.Elements.Add(Skills[ii]);
                SkillCharges[ii] = new MenuText("", new Loc(summaryMenu.Bounds.End.X - GraphicsManager.MenuBG.TileWidth, summaryMenu.Bounds.Y + GraphicsManager.MenuBG.TileHeight + ContentOffset + VERT_SPACE * ii), DirH.Right);
                summaryMenu.Elements.Add(SkillCharges[ii]);
            }

            Initialize(new Loc(16, 16), 144, Text.FormatKey("MENU_TEACH_TITLE"), team.ToArray(), 0);
        }
コード例 #11
0
        public ScoreMenu(Dictionary <int, List <RecordHeaderData> > scoreDict, int chosenZone, string highlightedPath)
        {
            this.scoreDict       = scoreDict;
            this.chosenZone      = chosenZone;
            this.highlightedPath = highlightedPath;
            List <RecordHeaderData> scores = scoreDict[chosenZone];

            Bounds = Rect.FromPoints(new Loc(GraphicsManager.ScreenWidth / 2 - 128, 16), new Loc(GraphicsManager.ScreenWidth / 2 + 128, 224));

            string zoneName = DataManager.Instance.DataIndices[DataManager.DataType.Zone].Entries[chosenZone].Name.ToLocal();

            Title = new MenuText(Text.FormatKey("MENU_SCORES_TITLE") + ": " + zoneName, Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth + 8, GraphicsManager.MenuBG.TileHeight));
            Div   = new MenuDivider(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + LINE_SPACE), Bounds.End.X - Bounds.X - GraphicsManager.MenuBG.TileWidth * 2);

            Scores = new MenuText[scores.Count * 3];
            for (int ii = 0; ii < scores.Count; ii++)
            {
                Color color = (scores[ii].Path == highlightedPath) ? Color.Yellow : Color.White;
                Scores[ii * 3] = new MenuText((ii + 1) + ". ",
                                              new Loc(Bounds.X + GraphicsManager.MenuBG.TileWidth * 2 + 12, Bounds.Y + GraphicsManager.MenuBG.TileHeight + VERT_SPACE * ii + TitledStripMenu.TITLE_OFFSET), DirV.Up, DirH.Right, color);
                Scores[ii * 3 + 1] = new MenuText(scores[ii].Name,
                                                  new Loc(Bounds.X + GraphicsManager.MenuBG.TileWidth * 2 + 12, Bounds.Y + GraphicsManager.MenuBG.TileHeight + VERT_SPACE * ii + TitledStripMenu.TITLE_OFFSET), color);
                Scores[ii * 3 + 2] = new MenuText(scores[ii].Score.ToString(),
                                                  new Loc(Bounds.End.X - GraphicsManager.MenuBG.TileWidth * 2, Bounds.Y + GraphicsManager.MenuBG.TileHeight + VERT_SPACE * ii + TitledStripMenu.TITLE_OFFSET), DirV.Up, DirH.Right, color);
            }
        }
コード例 #12
0
        public TeachInfoMenu(int itemNum)
        {
            Bounds = Rect.FromPoints(new Loc(16, 24), new Loc(GraphicsManager.ScreenWidth - 16, GraphicsManager.ScreenHeight - 72));

            ItemData       itemData = DataManager.Instance.GetItem(itemNum);
            ItemIndexState effect   = itemData.ItemStates.GetWithDefault <ItemIndexState>();

            SkillData   skillEntry   = DataManager.Instance.GetSkill(effect.Index);
            ElementData elementEntry = DataManager.Instance.GetElement(skillEntry.Data.Element);

            SkillName    = new MenuText(skillEntry.GetColoredName(), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight));
            SkillCharges = new MenuText(Text.FormatKey("MENU_SKILLS_TOTAL_CHARGES", skillEntry.BaseCharges), Bounds.Start + new Loc((Bounds.End.X - Bounds.X) / 2, GraphicsManager.MenuBG.TileHeight));

            SkillElement  = new MenuText(Text.FormatKey("MENU_SKILLS_ELEMENT", elementEntry.GetIconName()), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE));
            SkillCategory = new MenuText(Text.FormatKey("MENU_SKILLS_CATEGORY", skillEntry.Data.Category.ToLocal()), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 2));

            BasePowerState powerState = skillEntry.Data.SkillStates.GetWithDefault <BasePowerState>();

            SkillPower   = new MenuText(Text.FormatKey("MENU_SKILLS_POWER", (powerState != null ? powerState.Power.ToString() : "---")), Bounds.Start + new Loc((Bounds.End.X - Bounds.X) / 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE));
            SkillHitRate = new MenuText(Text.FormatKey("MENU_SKILLS_HIT_RATE", (skillEntry.Data.HitRate > -1 ? skillEntry.Data.HitRate + "%" : "---")), Bounds.Start + new Loc((Bounds.End.X - Bounds.X) / 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 2));

            SkillTargets = new MenuText(Text.FormatKey("MENU_SKILLS_RANGE", skillEntry.HitboxAction.GetDescription()), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 3));


            Description = new DialogueText(skillEntry.Desc.ToLocal(), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 4),
                                           Bounds.End.X - GraphicsManager.MenuBG.TileWidth * 4 - Bounds.X, LINE_SPACE, false);

            MenuDiv = new MenuDivider(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 3 + LINE_SPACE),
                                      Bounds.End.X - Bounds.X - GraphicsManager.MenuBG.TileWidth * 2);
        }
コード例 #13
0
 public TeamModeNotice()
 {
     Bounds          = Rect.FromPoints(new Loc(GraphicsManager.ScreenWidth / 2 - 48, 16), new Loc(GraphicsManager.ScreenWidth / 2 + 48, 16 + LINE_SPACE + GraphicsManager.MenuBG.TileHeight * 2));
     menuText        = new MenuText("", new Loc(GraphicsManager.ScreenWidth / 2, Bounds.Y + GraphicsManager.MenuBG.TileHeight), DirH.None);
     timeSinceUpdate = new FrameTick();
     Visible         = false;
 }
コード例 #14
0
ファイル: ShopMenu.cs プロジェクト: RogueCollab/RogueEssence
        public ShopMenu(List <Tuple <InvItem, int> > goods, int defaultChoice, OnMultiChoice chooseSlots)
        {
            Goods  = goods;
            action = chooseSlots;

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

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

                bool     canAfford = goods[index].Item2 <= DataManager.Instance.Save.ActiveTeam.Money;
                MenuText itemText  = new MenuText(goods[index].Item1.GetDisplayName(), new Loc(2, 1), canAfford ? Color.White : Color.Red);
                MenuText itemPrice = new MenuText(goods[index].Item2.ToString(), new Loc(ItemMenu.ITEM_MENU_WIDTH - 8 * 4, 1), DirV.Up, DirH.Right, Color.Lime);
                flatChoices.Add(new MenuElementChoice(() => { choose(index); }, true, itemText, itemPrice));
            }
            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)));

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

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

            Initialize(new Loc(16, 16), SELL_MENU_WIDTH, Text.FormatKey("MENU_SHOP_TITLE"), inv.ToArray(), startChoice, startPage, SLOTS_PER_PAGE, false, buyLimit);
        }
コード例 #15
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);
        }
コード例 #16
0
 public SeedSummary(Rect bounds) : base(bounds)
 {
     Details = new MenuText(Text.FormatKey("MENU_SEED_CUSTOMIZE", DiagManager.Instance.GetControlString(FrameInput.InputType.SortItems)), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight));
     Elements.Add(Details);
     MenuDiv = new MenuDivider(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + LINE_SPACE),
                               Bounds.End.X - Bounds.X - GraphicsManager.MenuBG.TileWidth * 2);
     Elements.Add(MenuDiv);
 }
コード例 #17
0
 public MoneySummary(Rect bounds)
     : base(bounds)
 {
     Title = new MenuText(Text.FormatKey("MENU_STORAGE_MONEY") + ":", Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight), DirH.Left);
     Elements.Add(Title);
     Money = new MenuText(Text.FormatKey("MONEY_AMOUNT", DataManager.Instance.Save.ActiveTeam.Money), Bounds.Start + new Loc(Bounds.Width / 2, GraphicsManager.MenuBG.TileHeight + LINE_SPACE), DirH.None);
     Elements.Add(Money);
 }
コード例 #18
0
 public CharaSummary(Rect bounds) : base(bounds)
 {
     Details = new MenuText(Text.FormatKey("MENU_CHARA_CUSTOMIZE", DiagManager.Instance.CurSettings.ActionKeys[(int)FrameInput.InputType.SortItems].ToLocal()), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight));
     Elements.Add(Details);
     MenuDiv = new MenuDivider(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + LINE_SPACE),
                               Bounds.End.X - Bounds.X - GraphicsManager.MenuBG.TileWidth * 2);
     Elements.Add(MenuDiv);
 }
コード例 #19
0
 public TradeSummary(Rect bounds)
     : base(bounds)
 {
     Title = new MenuText(Text.FormatKey("MENU_SWAP_NEEDED"), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight));
     Elements.Add(Title);
     MenuDiv = new MenuDivider(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + LINE_SPACE),
                               Bounds.End.X - Bounds.X - GraphicsManager.MenuBG.TileWidth * 2);
     Elements.Add(MenuDiv);
 }
コード例 #20
0
        public SwapGiveMenu(int defaultChoice, int openSpaces, OnMultiChoice chooseSlots)
        {
            action       = chooseSlots;
            AllowedGoods = new List <int>();

            int[] itemPresence = new int[DataManager.Instance.DataIndices[DataManager.DataType.Item].Count];
            for (int ii = 0; ii < itemPresence.Length; ii++)
            {
                itemPresence[ii] += DataManager.Instance.Save.ActiveTeam.Storage[ii];
            }

            for (int ii = 0; ii < DataManager.Instance.Save.ActiveTeam.GetInvCount(); ii++)
            {
                itemPresence[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)
                {
                    itemPresence[activeChar.EquippedItem.ID]++;
                }
            }

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

            for (int ii = 0; ii < itemPresence.Length; ii++)
            {
                int index = ii;
                if (itemPresence[index] > 0)
                {
                    ItemEntrySummary itemEntry = DataManager.Instance.DataIndices[DataManager.DataType.Item].Entries[ii] as ItemEntrySummary;

                    if (itemEntry.ContainsState <MaterialState>())
                    {
                        AllowedGoods.Add(index);

                        MenuText menuText  = new MenuText(DataManager.Instance.GetItem(ii).GetIconName(), new Loc(2, 1));
                        MenuText menuCount = new MenuText("(" + itemPresence[index] + ")", new Loc(ItemMenu.ITEM_MENU_WIDTH - 8 * 4, 1), DirV.Up, DirH.Right, Color.White);
                        flatChoices.Add(new MenuElementChoice(() => { }, true, menuText, menuCount));
                    }
                }
            }
            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)));

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

            Initialize(new Loc(16, 16), ItemMenu.ITEM_MENU_WIDTH, Text.FormatKey("MENU_SHOP_TITLE"), inv.ToArray(), startChoice, startPage, SLOTS_PER_PAGE, false, new IntRange(openSpaces));
        }
コード例 #21
0
 public MsgLogMenu()
 {
     entries  = new List <MenuText>();
     dividers = new List <MenuDivider>();
     Bounds   = Rect.FromPoints(new Loc(LiveMsgLog.SIDE_BUFFER, 24), new Loc(GraphicsManager.ScreenWidth - LiveMsgLog.SIDE_BUFFER, GraphicsManager.ScreenHeight - 8));
     Title    = new MenuText(Text.FormatKey("MENU_MSG_LOG_TITLE"), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth + 8, GraphicsManager.MenuBG.TileHeight));
     Div      = new MenuDivider(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + LINE_SPACE), Bounds.End.X - Bounds.X - GraphicsManager.MenuBG.TileWidth * 2);
     LoadMsgs();
 }
コード例 #22
0
        public OfferItemsMenu(Rect bounds, TradeItemMenu baseMenu)
        {
            Bounds        = bounds;
            this.baseMenu = baseMenu;

            Title   = new MenuText(Text.FormatKey("MENU_TRADE_ITEM_OFFER"), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth + 8, GraphicsManager.MenuBG.TileHeight));
            MainDiv = new MenuDivider(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + LINE_SPACE), Bounds.End.X - Bounds.X - GraphicsManager.MenuBG.TileWidth * 2);

            Items = new MenuText[0];
        }
コード例 #23
0
        private void chooseAction(int index, MenuText buttonType)
        {
            buttonType.Text = "[" + Text.FormatKey("MENU_CONTROLS_CHOOSE_KEY") + "]";

            MenuManager.Instance.AddMenu(new GetKeyMenu(Settings.ForbiddenKeys, (Keys key) =>
            {
                actionKeys[index] = key;
                refresh();
            }), true);
        }
コード例 #24
0
 public DungeonSummary(Rect bounds) : base(bounds)
 {
     DungeonName = new MenuText("", Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight));
     Elements.Add(DungeonName);
     MenuDiv = new MenuDivider(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + LINE_SPACE),
                               Bounds.End.X - Bounds.X - GraphicsManager.MenuBG.TileWidth * 2);
     Elements.Add(MenuDiv);
     Floors = new MenuText("", Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + TitledStripMenu.TITLE_OFFSET));
     Elements.Add(Floors);
 }
コード例 #25
0
        private void chooseAction(int index, MenuText buttonType)
        {
            buttonType.SetText("(" + Text.FormatKey("MENU_CONTROLS_CHOOSE_BUTTON") + ")");

            MenuManager.Instance.AddMenu(new GetButtonMenu(Settings.ForbiddenButtons, (Buttons button) =>
            {
                actionButtons[index] = button;
                refresh();
            }, () => { refresh(); }), true);
        }
コード例 #26
0
        public InfoMenu(string title, string message)
        {
            Bounds = new Rect(new Loc(40, 32), new Loc(240, 176));

            Title = new MenuText(title, Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth + 8, GraphicsManager.MenuBG.TileHeight));
            Div   = new MenuDivider(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + LINE_SPACE), Bounds.End.X - Bounds.X - GraphicsManager.MenuBG.TileWidth * 2);

            Info = new DialogueText(message, Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + TitledStripMenu.TITLE_OFFSET),
                                    Bounds.End.X - GraphicsManager.MenuBG.TileWidth * 3 - Bounds.X, LINE_SPACE, false);
        }
コード例 #27
0
        public HotkeyMenu(int skillSlot)
        {
            this.skillSlot = skillSlot;
            Loc center = new Loc();

            Bounds       = Rect.FromPoints(center - new Loc(56 + GraphicsManager.MenuBG.TileWidth, 0), center + new Loc(56 + GraphicsManager.MenuBG.TileWidth, LINE_SPACE * 2 + GraphicsManager.MenuBG.TileHeight * 2));
            skillText    = new MenuText("", center + new Loc(-48, GraphicsManager.MenuBG.TileHeight), DirH.Left);
            skillElement = new MenuText("", center + new Loc(-48, GraphicsManager.MenuBG.TileHeight + LINE_SPACE), DirH.Left);
            skillCharges = new MenuText("", center + new Loc(48, GraphicsManager.MenuBG.TileHeight + LINE_SPACE), DirH.Right);
        }
コード例 #28
0
 public ItemSummary(Rect bounds)
     : base(bounds)
 {
     Description = new DialogueText("", Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight),
                                    Bounds.End.X - GraphicsManager.MenuBG.TileWidth * 4 - Bounds.X, LINE_SPACE, false);
     Elements.Add(Description);
     SalePrice = new MenuText("", new Loc(Bounds.End.X - GraphicsManager.MenuBG.TileWidth * 2, Bounds.Y + GraphicsManager.MenuBG.TileHeight + 4 * LINE_SPACE), DirH.Right);
     Elements.Add(SalePrice);
     Rarity = new MenuText("", new Loc(Bounds.Start.X + GraphicsManager.MenuBG.TileWidth * 2, Bounds.Y + GraphicsManager.MenuBG.TileHeight + 4 * LINE_SPACE), DirH.Left);
     Elements.Add(Rarity);
 }
コード例 #29
0
        public CharaChoiceMenu(string teamName, int chosenDungeon, ulong?seed)
        {
            GenderSetting    = Gender.Unknown;
            SkinSetting      = 0;
            IntrinsicSetting = -1;
            FormSetting      = -1;

            startChars = new List <int>();
            for (int ii = 0; ii < DataManager.Instance.DataIndices[DataManager.DataType.Monster].Count; ii++)
            {
                if (DataManager.Instance.Save.Dex[ii] == GameProgress.UnlockState.Completed && DataManager.Instance.DataIndices[DataManager.DataType.Monster].Entries[ii].Released)
                {
                    startChars.Add(ii);
                }
                else if (DataManager.Instance.StartChars.Contains(ii))
                {
                    startChars.Add(ii);
                }
            }


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

            flatChoices.Add(new MenuTextChoice(Text.FormatKey("MENU_START_RANDOM"), () => { choose(startChars[MathUtils.Rand.Next(startChars.Count)]); }));
            for (int ii = 0; ii < startChars.Count; ii++)
            {
                int startChar = startChars[ii];
                flatChoices.Add(new MenuTextChoice(DataManager.Instance.DataIndices[DataManager.DataType.Monster].Entries[startChar].Name.ToLocal(), () => { choose(startChar); }));
            }
            List <MenuChoice[]> box = SortIntoPages(flatChoices, SLOTS_PER_PAGE);

            int totalSlots = SLOTS_PER_PAGE;

            if (box.Count == 1)
            {
                totalSlots = box[0].Length;
            }

            team       = teamName;
            chosenDest = chosenDungeon;
            this.seed  = seed;

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

            infoMenu = new CharaSummary(new Rect(new Loc(152, 128), new Loc(136, LINE_SPACE + GraphicsManager.MenuBG.TileHeight * 2)));

            Initialize(new Loc(16, 16), 112, Text.FormatKey("MENU_CHARA_CHOICE_TITLE"), box.ToArray(), 0, 0, totalSlots, false, -1);

            titleMenu = new SummaryMenu(Rect.FromPoints(new Loc(Bounds.End.X + 8, 16), new Loc(GraphicsManager.ScreenWidth - 8, 16 + LINE_SPACE + GraphicsManager.MenuBG.TileHeight * 2)));
            MenuText title = new MenuText(Text.FormatKey("MENU_START_TEAM", team), new Loc((titleMenu.Bounds.X + titleMenu.Bounds.End.X) / 2, titleMenu.Bounds.Y + GraphicsManager.MenuBG.TileHeight), DirH.None);

            title.Color = TextTan;
            titleMenu.Elements.Add(title);
        }
コード例 #30
0
        public DexMenu()
        {
            int lastEntry  = -1;
            int seen       = 0;
            int befriended = 0;

            for (int ii = 1; ii < DataManager.Instance.Save.Dex.Length; ii++)
            {
                if (DataManager.Instance.Save.Dex[ii] > 0)
                {
                    lastEntry = ii;
                    seen++;
                    if (DataManager.Instance.Save.Dex[ii] == GameProgress.UnlockState.Completed)
                    {
                        befriended++;
                    }
                }
            }

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

            for (int ii = 1; ii <= lastEntry; ii++)
            {
                if (DataManager.Instance.Save.Dex[ii] > 0)
                {
                    Color color = (DataManager.Instance.Save.Dex[ii] == GameProgress.UnlockState.Completed) ? Color.White : Color.Gray;

                    //name
                    MenuText dexNum  = new MenuText(ii.ToString("D3"), new Loc(2, 1), color);
                    MenuText dexName = new MenuText(DataManager.Instance.DataIndices[DataManager.DataType.Monster].Entries[ii].Name.ToLocal(), new Loc(24, 1), color);
                    flatChoices.Add(new MenuElementChoice(() => { choose(ii); }, true, dexNum, dexName));
                }
                else
                {
                    //???
                    MenuText dexNum  = new MenuText(ii.ToString("D3"), new Loc(2, 1), Color.Gray);
                    MenuText dexName = new MenuText("???", new Loc(24, 1), Color.Gray);
                    flatChoices.Add(new MenuElementChoice(() => { choose(ii); }, true, dexNum, dexName));
                }
            }
            List <MenuChoice[]> choices = SortIntoPages(flatChoices, SLOTS_PER_PAGE);

            summaryMenu = new SummaryMenu(new Rect(new Loc(208, 16), new Loc(96, LINE_SPACE * 2 + GraphicsManager.MenuBG.TileHeight * 2)));
            MenuText seenText = new MenuText(Text.FormatKey("MENU_DEX_SEEN", seen), summaryMenu.Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight));

            summaryMenu.Elements.Add(seenText);
            MenuText befriendedText = new MenuText(Text.FormatKey("MENU_DEX_CAUGHT", befriended), summaryMenu.Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + LINE_SPACE));

            summaryMenu.Elements.Add(befriendedText);

            portrait = new SpeakerPortrait(new MonsterID(), new EmoteStyle(0), new Loc(232, 72), true);

            Initialize(new Loc(0, 0), 208, Text.FormatKey("MENU_DEX_TITLE"), choices.ToArray(), 0, 0, SLOTS_PER_PAGE);
        }