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)); }
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); }
public void SetPortrait(MonsterID speaker, EmoteStyle emotion) { if (speaker.IsValid()) { Loc loc = new Loc(DialogueBox.SIDE_BUFFER, Bounds.Y - 56); speakerPic = new SpeakerPortrait(speaker, emotion, loc, true); } }
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); }
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); }
public void SetContact(string name, string stats, string lastSeen, string id, ProfilePic[] portraits) { Name.SetText(name); Stats.SetText(stats); LastSeen.SetText(lastSeen); ID.SetText(id); Portraits = new SpeakerPortrait[portraits.Length]; for (int ii = 0; ii < portraits.Length; ii++) { Portraits[ii] = new SpeakerPortrait(portraits[ii].ID, new EmoteStyle(portraits[ii].Emote, true), new Loc(Bounds.End.X - GraphicsManager.MenuBG.TileWidth + (GraphicsManager.PortraitSize + 2) * (ii - portraits.Length), Bounds.Y + GraphicsManager.MenuBG.TileHeight), false); } }
public MainStartingMenu() { List <MenuChoice> flatChoices = new List <MenuChoice>(); for (int ii = 0; ii < DataManager.Instance.StartChars.Count; ii++) { int startChar = DataManager.Instance.StartChars[ii]; flatChoices.Add(new MenuTextChoice(DataManager.Instance.GetMonster(startChar).Name.ToLocal(), () => { choose(startChar); })); } 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(), 0); }
public void SetAOK(AOKMail aok) { Title.SetText(Text.FormatKey("MENU_AOK_TITLE")); Portraits = new SpeakerPortrait[aok.RescuingProfile.Length]; for (int ii = 0; ii < aok.RescuingProfile.Length; ii++) { Portraits[ii] = new SpeakerPortrait(aok.RescuingProfile[ii], new EmoteStyle(GraphicsManager.AOKEmotion, true), new Loc(Bounds.X + Bounds.Width / 2 - (GraphicsManager.PortraitSize * aok.RescuingProfile.Length + (aok.RescuingProfile.Length - 1) * 2) / 2 + ii * (GraphicsManager.PortraitSize + 2), Bounds.Y + GraphicsManager.MenuBG.TileHeight + TitledStripMenu.TITLE_OFFSET), false); } Name.SetText(Text.FormatKey("MENU_AOK_TEAM", aok.RescuingTeam)); LastSeen.SetText(Text.FormatKey("MENU_SOS_DATE", aok.DateRescued)); Goal.SetText(Text.FormatKey("MENU_SOS_GOAL", aok.GoalText.ToLocal().Replace('\n', ' '))); Reward.SetText(aok.OfferedItem.Value > 0 ? Text.FormatKey("MENU_SOS_REWARD", aok.OfferedItem.GetDungeonName()) : ""); }
public void SetSOS(SOSMail sos) { Title.SetText(Text.FormatKey("MENU_SOS_TITLE")); Portraits = new SpeakerPortrait[sos.TeamProfile.Length]; for (int ii = 0; ii < sos.TeamProfile.Length; ii++) { Portraits[ii] = new SpeakerPortrait(sos.TeamProfile[ii], new EmoteStyle(sos.RescuedBy == null ? GraphicsManager.SOSEmotion : 0, true), new Loc(Bounds.X + Bounds.Width / 2 - (GraphicsManager.PortraitSize * sos.TeamProfile.Length + (sos.TeamProfile.Length - 1) * 2) / 2 + ii * (GraphicsManager.PortraitSize + 2), Bounds.Y + GraphicsManager.MenuBG.TileHeight + TitledStripMenu.TITLE_OFFSET), false); } Name.SetText(Text.FormatKey("MENU_SOS_CLIENT", sos.TeamName)); LastSeen.SetText(Text.FormatKey("MENU_SOS_DATE", sos.DateDefeated)); Goal.SetText(Text.FormatKey("MENU_SOS_GOAL", sos.GoalText.ToLocal().Replace('\n', ' '))); Reward.SetText(sos.OfferedItem.Value > 0 ? Text.FormatKey("MENU_SOS_REWARD", sos.OfferedItem.GetDungeonName()) : ""); }
public void Initialize(GameProgress ending) { Bounds = Rect.FromPoints(new Loc(GraphicsManager.ScreenWidth / 2 - 140, 16), new Loc(GraphicsManager.ScreenWidth / 2 + 140, 224)); Ending = ending; Title = new MenuText(GetTitle(), new Loc(GraphicsManager.ScreenWidth / 2, Bounds.Y + GraphicsManager.MenuBG.TileHeight), DirH.None); Div = new MenuDivider(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + LINE_SPACE), Bounds.End.X - Bounds.X - GraphicsManager.MenuBG.TileWidth * 2); List <Character> charList = GetChars(); Stats = new MenuText[charList.Count * 4]; Portraits = new SpeakerPortrait[charList.Count]; for (int ii = 0; ii < charList.Count; ii++) { CharData character = charList[ii]; MonsterData dexEntry = DataManager.Instance.GetMonster(character.BaseForm.Species); BaseMonsterForm formEntry = dexEntry.Forms[character.BaseForm.Form]; Portraits[ii] = new SpeakerPortrait(character.BaseForm, new EmoteStyle(0), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + 44 * ii + TitledStripMenu.TITLE_OFFSET), false); string speciesText = character.BaseName + " / " + CharData.GetFullFormName(character.BaseForm); Stats[ii * 4] = new MenuText(speciesText, Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 48, GraphicsManager.MenuBG.TileHeight + 44 * ii + TitledStripMenu.TITLE_OFFSET)); Stats[ii * 4 + 1] = new MenuText(Text.FormatKey("MENU_TEAM_LEVEL_SHORT", character.Level), new Loc(Bounds.End.X - GraphicsManager.MenuBG.TileWidth * 2 - 24, Bounds.Y + GraphicsManager.MenuBG.TileHeight + 44 * ii + TitledStripMenu.TITLE_OFFSET)); if (Ending.UUID == character.OriginalUUID) { Stats[ii * 4 + 2] = new MenuText(Text.FormatKey("MENU_TEAM_MET_AT", character.MetAt), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 48, GraphicsManager.MenuBG.TileHeight + VERT_SPACE + 44 * ii + TitledStripMenu.TITLE_OFFSET)); } else { Stats[ii * 4 + 2] = new MenuText(Text.FormatKey("MENU_TEAM_TRADED_FROM", character.OriginalTeam), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 48, GraphicsManager.MenuBG.TileHeight + VERT_SPACE + 44 * ii + TitledStripMenu.TITLE_OFFSET)); } Stats[ii * 4 + 3] = new MenuText((String.IsNullOrEmpty(character.DefeatAt) ? "" : Text.FormatKey("MENU_TEAM_FELL_AT", character.DefeatAt)), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 48, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 2 + 44 * ii + TitledStripMenu.TITLE_OFFSET)); base.Initialize(); } }
public AssemblyMenu(int defaultChoice, Action teamChanged) { int menuWidth = 152; this.teamChanged = teamChanged; List <MenuChoice> flatChoices = new List <MenuChoice>(); for (int ii = 0; ii < DataManager.Instance.Save.ActiveTeam.Players.Count; ii++) { int index = ii; Character character = DataManager.Instance.Save.ActiveTeam.Players[index]; bool enabled = !ChoosingLeader(ii); MenuText memberName = new MenuText(character.BaseName, new Loc(2, 1), enabled ? Color.Lime : TextIndigo); MenuText memberLv = new MenuText(Text.FormatKey("MENU_TEAM_LEVEL_SHORT", character.Level), new Loc(menuWidth - 8 * 4, 1), DirV.Up, DirH.Right, enabled ? Color.Lime : TextIndigo); flatChoices.Add(new MenuElementChoice(() => { Choose(index, false); }, true, memberName, memberLv)); } for (int ii = 0; ii < DataManager.Instance.Save.ActiveTeam.Assembly.Count; ii++) { int index = ii; Character character = DataManager.Instance.Save.ActiveTeam.Assembly[index]; Color color = CanChooseAssembly(ii) ? (character.IsFavorite ? Color.Yellow : Color.White) : Color.Red; MenuText memberName = new MenuText(character.BaseName, new Loc(2, 1), color); MenuText memberLv = new MenuText(Text.FormatKey("MENU_TEAM_LEVEL_SHORT", character.Level), new Loc(menuWidth - 8 * 4, 1), DirV.Up, DirH.Right, color); flatChoices.Add(new MenuElementChoice(() => { Choose(index, true); }, true, memberName, memberLv)); } List <MenuChoice[]> box = SortIntoPages(flatChoices, SLOTS_PER_PAGE); defaultChoice = Math.Min(defaultChoice, flatChoices.Count - 1); int startChoice = defaultChoice % SLOTS_PER_PAGE; int startPage = defaultChoice / 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(), startChoice, startPage, SLOTS_PER_PAGE); }
public void SetAOK(AOKMail mail) { if (mail != null) { Name.Text = mail.TeamName; Reward.Text = Text.FormatKey("MENU_SOS_REWARD", mail.OfferedItem.Value > -1 ? mail.OfferedItem.GetDungeonName() : "---"); LastSeen.Text = Text.FormatKey("MENU_SOS_DATE", mail.DateDefeated); Goal.Text = Text.FormatKey("MENU_SOS_GOAL", mail.GoalText.ToLocal().Replace('\n', ' ')); Portraits = new SpeakerPortrait[mail.TeamProfile.Length]; for (int ii = 0; ii < mail.TeamProfile.Length; ii++) { Portraits[ii] = new SpeakerPortrait(mail.TeamProfile[ii], new EmoteStyle(0, true), new Loc(Bounds.End.X - GraphicsManager.MenuBG.TileWidth + (GraphicsManager.PortraitSize + 2) * (ii - mail.TeamProfile.Length), Bounds.Y + GraphicsManager.MenuBG.TileHeight), false); } } else { setError(); } }
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); }
public MemberFeaturesMenu(int teamSlot, bool assembly, bool allowAssembly) { Bounds = Rect.FromPoints(new Loc(24, 16), new Loc(296, 224)); this.teamSlot = teamSlot; this.assembly = assembly; this.allowAssembly = allowAssembly; Character player = assembly ? DataManager.Instance.Save.ActiveTeam.Assembly[teamSlot] : DataManager.Instance.Save.ActiveTeam.Players[teamSlot]; //TODO: align this text properly Title = new MenuText(Text.FormatKey("MENU_TEAM_FEATURES") + " (1/3)", 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); Portrait = new SpeakerPortrait(player.BaseForm, new EmoteStyle(0), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + TitledStripMenu.TITLE_OFFSET), false); string speciesText = player.GetDisplayName(true) + " / " + CharData.GetFullFormName(player.BaseForm); Name = new MenuText(speciesText, Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 48, GraphicsManager.MenuBG.TileHeight + TitledStripMenu.TITLE_OFFSET)); ElementData element1 = DataManager.Instance.GetElement(player.Element1); ElementData element2 = DataManager.Instance.GetElement(player.Element2); string typeString = element1.GetIconName(); if (player.Element2 != 00) { typeString += "/" + element2.GetIconName(); } bool origElements = (player.Element1 == DataManager.Instance.GetMonster(player.BaseForm.Species).Forms[player.BaseForm.Form].Element1); origElements &= (player.Element2 == DataManager.Instance.GetMonster(player.BaseForm.Species).Forms[player.BaseForm.Form].Element2); Elements = new MenuText(Text.FormatKey("MENU_TEAM_ELEMENT", typeString), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 48, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 1 + TitledStripMenu.TITLE_OFFSET), origElements ? Color.White : Color.Yellow); Level = new MenuText(Text.FormatKey("MENU_TEAM_LEVEL_SHORT", player.Level), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 48, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 2 + TitledStripMenu.TITLE_OFFSET)); HP = new MenuText(Text.FormatKey("MENU_TEAM_HP", player.HP, player.MaxHP), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 3 + TitledStripMenu.TITLE_OFFSET)); Fullness = new MenuText(Text.FormatKey("MENU_TEAM_HUNGER", player.Fullness, player.MaxFullness), Bounds.Start + new Loc((Bounds.End.X - Bounds.X) / 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 3 + TitledStripMenu.TITLE_OFFSET)); MainDiv = new MenuDivider(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 5), Bounds.End.X - Bounds.X - GraphicsManager.MenuBG.TileWidth * 2); SkillTitle = new MenuText(Text.FormatKey("MENU_TEAM_SKILLS"), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 4 + TitledStripMenu.TITLE_OFFSET)); Skills = new MenuText[CharData.MAX_SKILL_SLOTS * 3]; for (int ii = 0; ii < CharData.MAX_SKILL_SLOTS; ii++) { SlotSkill skill = player.BaseSkills[ii]; string skillString = "-----"; string skillCharges = "--"; string totalCharges = "/--"; if (skill.SkillNum > -1) { SkillData data = DataManager.Instance.GetSkill(skill.SkillNum); skillString = data.GetIconName(); skillCharges = skill.Charges.ToString(); totalCharges = "/" + (data.BaseCharges + player.ChargeBoost); } Skills[ii * 3] = new MenuText(skillString, Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * (ii + 5) + TitledStripMenu.TITLE_OFFSET)); Skills[ii * 3 + 1] = new MenuText(skillCharges, new Loc(Bounds.End.X - GraphicsManager.MenuBG.TileWidth * 2 - 16 - GraphicsManager.TextFont.CharSpace, Bounds.Y + GraphicsManager.MenuBG.TileHeight + VERT_SPACE * (ii + 5) + TitledStripMenu.TITLE_OFFSET), DirH.Right); Skills[ii * 3 + 2] = new MenuText(totalCharges, new Loc(Bounds.End.X - GraphicsManager.MenuBG.TileWidth * 2 - 16, Bounds.Y + GraphicsManager.MenuBG.TileHeight + VERT_SPACE * (ii + 5) + TitledStripMenu.TITLE_OFFSET), DirH.Left); } IntrinsicDiv = new MenuDivider(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 10), Bounds.End.X - Bounds.X - GraphicsManager.MenuBG.TileWidth * 2); bool origIntrinsic = (player.Intrinsics[0].Element.ID == player.BaseIntrinsics[0]); IntrinsicData entry = DataManager.Instance.GetIntrinsic(player.Intrinsics[0].Element.ID); Intrinsic = new MenuText(Text.FormatKey("MENU_TEAM_INTRINSIC", entry.GetColoredName()), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 9 + TitledStripMenu.TITLE_OFFSET), origIntrinsic ? Color.White : Color.Yellow); IntrinsicDesc = new DialogueText(entry.Desc.ToLocal(), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 10 + TitledStripMenu.TITLE_OFFSET), Bounds.End.X - GraphicsManager.MenuBG.TileWidth * 3 - Bounds.X, LINE_SPACE, false); }
public MemberInfoMenu(int teamSlot, bool assembly, bool allowAssembly) { Bounds = Rect.FromPoints(new Loc(24, 16), new Loc(296, 224)); this.teamSlot = teamSlot; this.assembly = assembly; this.allowAssembly = allowAssembly; Character player = assembly ? DataManager.Instance.Save.ActiveTeam.Assembly[teamSlot] : DataManager.Instance.Save.ActiveTeam.Players[teamSlot]; //TODO: align the page text properly Title = new MenuText(Text.FormatKey("MENU_TEAM_INFO") + " (3/3)", 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); MonsterData dexEntry = DataManager.Instance.GetMonster(player.BaseForm.Species); BaseMonsterForm formEntry = dexEntry.Forms[player.BaseForm.Form]; Portrait = new SpeakerPortrait(player.BaseForm, new EmoteStyle(0), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + TitledStripMenu.TITLE_OFFSET), false); string speciesName = dexEntry.GetColoredName(); if (player.BaseForm.Skin > 0) { speciesName += " (" + DataManager.Instance.GetSkin(player.BaseForm.Skin).GetColoredName() + ")"; } if (player.BaseForm.Gender != Gender.Genderless) { speciesName += (player.BaseForm.Gender == Gender.Male) ? " (\u2642)" : " (\u2640)"; } else { speciesName += " (-)"; } Species = new MenuText(Text.FormatKey("MENU_TEAM_SPECIES", speciesName), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 48, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 0 + TitledStripMenu.TITLE_OFFSET)); Category = new MenuText(dexEntry.Title.ToLocal(), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 48, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 1 + TitledStripMenu.TITLE_OFFSET)); if (DataManager.Instance.Save.UUID == player.OriginalUUID) { MetAt = new MenuText(Text.FormatKey("MENU_TEAM_MET_AT", player.MetAt), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 48, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 2 + TitledStripMenu.TITLE_OFFSET)); } else { MetAt = new MenuText(Text.FormatKey("MENU_TEAM_TRADED_FROM", player.OriginalTeam), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 48, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 2 + TitledStripMenu.TITLE_OFFSET)); } MainDiv = new MenuDivider(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 5), Bounds.End.X - Bounds.X - GraphicsManager.MenuBG.TileWidth * 2); Promotions = new MenuText(Text.FormatKey("MENU_TEAM_PROMOTION"), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 4 + TitledStripMenu.TITLE_OFFSET)); List <MenuText> validPromotions = new List <MenuText>(); bool inDungeon = (GameManager.Instance.CurrentScene == DungeonScene.Instance); for (int ii = 0; ii < dexEntry.Promotions.Count; ii++) { if (!DataManager.Instance.DataIndices[DataManager.DataType.Monster].Entries[dexEntry.Promotions[ii].Result].Released) { continue; } if (dexEntry.Promotions[ii].IsQualified(player, inDungeon)) { validPromotions.Add(new MenuText(DataManager.Instance.GetMonster(dexEntry.Promotions[ii].Result).GetColoredName() + ": " + dexEntry.Promotions[ii].GetReqString(), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 8, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * (validPromotions.Count + 5) + TitledStripMenu.TITLE_OFFSET))); } else { bool hardReq = false; foreach (PromoteDetail detail in dexEntry.Promotions[ii].Details) { if (detail.IsHardReq() && !detail.GetReq(player)) { hardReq = true; break; } } if (!hardReq) { validPromotions.Add(new MenuText(DataManager.Instance.GetMonster(dexEntry.Promotions[ii].Result).GetColoredName() + ": " + dexEntry.Promotions[ii].GetReqString(), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 8, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * (validPromotions.Count + 5) + TitledStripMenu.TITLE_OFFSET), Color.Red)); } } } if (validPromotions.Count > 0) { PromoteMethods = validPromotions.ToArray(); } else { PromoteMethods = new MenuText[1]; PromoteMethods[0] = new MenuText(Text.FormatKey("MENU_TEAM_PROMOTE_NONE"), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 5 + TitledStripMenu.TITLE_OFFSET)); } }
//allow moving up and down (but don't alter the team choice selection because it's hard) public MemberStatsMenu(int teamSlot, bool assembly, bool allowAssembly) { Bounds = Rect.FromPoints(new Loc(24, 16), new Loc(296, 224)); this.teamSlot = teamSlot; this.assembly = assembly; this.allowAssembly = allowAssembly; Character player = assembly ? DataManager.Instance.Save.ActiveTeam.Assembly[teamSlot] : DataManager.Instance.Save.ActiveTeam.Players[teamSlot]; //TODO: align the page text properly Title = new MenuText(Text.FormatKey("MENU_STATS_TITLE") + " (2/3)", 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); Portrait = new SpeakerPortrait(player.BaseForm, new EmoteStyle(0), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + TitledStripMenu.TITLE_OFFSET), false); string speciesText = player.BaseName + " / " + player.FullFormName; Name = new MenuText(speciesText, Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 48, GraphicsManager.MenuBG.TileHeight + TitledStripMenu.TITLE_OFFSET)); ElementData element1 = DataManager.Instance.GetElement(player.Element1); ElementData element2 = DataManager.Instance.GetElement(player.Element2); string typeString = String.Format("{0}\u2060{1}", element1.Symbol, element1.Name.ToLocal()); if (player.Element2 != 00) { typeString += "/" + String.Format("{0}\u2060{1}", element2.Symbol, element2.Name.ToLocal()); } BaseMonsterForm monsterForm = DataManager.Instance.GetMonster(player.BaseForm.Species).Forms[player.BaseForm.Form]; bool origElements = (player.Element1 == monsterForm.Element1); origElements &= (player.Element2 == monsterForm.Element2); Elements = new MenuText(Text.FormatKey("MENU_TEAM_ELEMENT", typeString), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 48, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 1 + TitledStripMenu.TITLE_OFFSET), origElements ? Color.White : Color.Yellow); Level = new MenuText(Text.FormatKey("MENU_TEAM_LEVEL_SHORT", player.Level), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 48, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 2 + TitledStripMenu.TITLE_OFFSET)); int expToNext = 0; if (player.Level < DataManager.Instance.MaxLevel) { int growth = DataManager.Instance.GetMonster(player.BaseForm.Species).EXPTable; GrowthData growthData = DataManager.Instance.GetGrowth(growth); expToNext = growthData.GetExpToNext(player.Level); } EXP = new MenuText(Text.FormatKey("MENU_TEAM_EXP", player.EXP, expToNext), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 3 + TitledStripMenu.TITLE_OFFSET)); MainDiv = new MenuDivider(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 5), Bounds.End.X - Bounds.X - GraphicsManager.MenuBG.TileWidth * 2); StatsTitle = new MenuText(Text.FormatKey("MENU_TEAM_STATS"), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 4 + TitledStripMenu.TITLE_OFFSET)); HPLabel = new MenuText(Text.FormatKey("MENU_LABEL", Data.Stat.HP.ToLocal("tiny")), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 8, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 5 + TitledStripMenu.TITLE_OFFSET)); AttackLabel = new MenuText(Text.FormatKey("MENU_LABEL", Data.Stat.Attack.ToLocal("tiny")), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 8, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 6 + TitledStripMenu.TITLE_OFFSET), player.ProxyAtk > -1 ? Color.Yellow : Color.White); DefenseLabel = new MenuText(Text.FormatKey("MENU_LABEL", Data.Stat.Defense.ToLocal("tiny")), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 8, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 7 + TitledStripMenu.TITLE_OFFSET), player.ProxyDef > -1 ? Color.Yellow : Color.White); MAtkLabel = new MenuText(Text.FormatKey("MENU_LABEL", Data.Stat.MAtk.ToLocal("tiny")), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 8, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 8 + TitledStripMenu.TITLE_OFFSET), player.ProxyMAtk > -1 ? Color.Yellow : Color.White); MDefLabel = new MenuText(Text.FormatKey("MENU_LABEL", Data.Stat.MDef.ToLocal("tiny")), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 8, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 9 + TitledStripMenu.TITLE_OFFSET), player.ProxyMDef > -1 ? Color.Yellow : Color.White); SpeedLabel = new MenuText(Text.FormatKey("MENU_LABEL", Data.Stat.Speed.ToLocal("tiny")), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 8, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 10 + TitledStripMenu.TITLE_OFFSET), player.ProxySpeed > -1 ? Color.Yellow : Color.White); HP = new MenuText(player.MaxHP.ToString(), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 72, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 5 + TitledStripMenu.TITLE_OFFSET), DirH.Right); Attack = new MenuText(player.Atk.ToString(), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 72, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 6 + TitledStripMenu.TITLE_OFFSET), DirV.Up, DirH.Right, player.ProxyAtk > -1 ? Color.Yellow : Color.White); Defense = new MenuText(player.Def.ToString(), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 72, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 7 + TitledStripMenu.TITLE_OFFSET), DirV.Up, DirH.Right, player.ProxyDef > -1 ? Color.Yellow : Color.White); MAtk = new MenuText(player.MAtk.ToString(), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 72, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 8 + TitledStripMenu.TITLE_OFFSET), DirV.Up, DirH.Right, player.ProxyMAtk > -1 ? Color.Yellow : Color.White); MDef = new MenuText(player.MDef.ToString(), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 72, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 9 + TitledStripMenu.TITLE_OFFSET), DirV.Up, DirH.Right, player.ProxyMDef > -1 ? Color.Yellow : Color.White); Speed = new MenuText(player.Speed.ToString(), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 72, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 10 + TitledStripMenu.TITLE_OFFSET), DirV.Up, DirH.Right, player.ProxySpeed > -1 ? Color.Yellow : Color.White); int hpLength = calcLength(Stat.HP, monsterForm, player.MaxHP, player.Level); HPBar = new MenuStatBar(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 76, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 5 + TitledStripMenu.TITLE_OFFSET), hpLength, calcColor(hpLength)); int atkLength = calcLength(Stat.Attack, monsterForm, player.Atk, player.Level); AttackBar = new MenuStatBar(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 76, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 6 + TitledStripMenu.TITLE_OFFSET), atkLength, calcColor(atkLength)); int defLength = calcLength(Stat.Defense, monsterForm, player.Def, player.Level); DefenseBar = new MenuStatBar(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 76, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 7 + TitledStripMenu.TITLE_OFFSET), defLength, calcColor(defLength)); int mAtkLength = calcLength(Stat.MAtk, monsterForm, player.MAtk, player.Level); MAtkBar = new MenuStatBar(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 76, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 8 + TitledStripMenu.TITLE_OFFSET), mAtkLength, calcColor(mAtkLength)); int mDefLength = calcLength(Stat.MDef, monsterForm, player.MDef, player.Level); MDefBar = new MenuStatBar(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 76, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 9 + TitledStripMenu.TITLE_OFFSET), mDefLength, calcColor(mDefLength)); int speedLength = calcLength(Stat.Speed, monsterForm, player.Speed, player.Level); SpeedBar = new MenuStatBar(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2 + 76, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 10 + TitledStripMenu.TITLE_OFFSET), speedLength, calcColor(speedLength)); ItemDiv = new MenuDivider(Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 12), Bounds.End.X - Bounds.X - GraphicsManager.MenuBG.TileWidth * 2); Item = new MenuText(player.EquippedItem.ID > -1 ? Text.FormatKey("MENU_HELD_ITEM", player.EquippedItem.GetName()) : Text.FormatKey("MENU_HELD_NO_ITEM"), Bounds.Start + new Loc(GraphicsManager.MenuBG.TileWidth * 2, GraphicsManager.MenuBG.TileHeight + VERT_SPACE * 11 + TitledStripMenu.TITLE_OFFSET)); }