/// <summary> /// Creates a new QuestDetailsScreen object. /// </summary> public QuestDetailsScreen(Quest quest) : base() { // check the parameter if (quest == null) { throw new ArgumentNullException("quest"); } this.quest = quest; this.IsPopup = true; currentDialogue = new List <Line>(); maxLines = 7; textPosition.X = 261f; AddStrings(this.quest.Name, Fonts.BreakTextIntoList(this.quest.Description, Fonts.DescriptionFont, (int)(715 * ScaledVector2.ScaleFactor)), GetRequirements(this.quest)); }
/// <summary> /// Creates a new InnScreen object. /// </summary> public InnScreen(Inn inn) : base() { // check the parameter if (inn == null) { throw new ArgumentNullException("inn"); } this.IsPopup = true; this.inn = inn; welcomeMessage = Fonts.BreakTextIntoList(inn.WelcomeMessage, Fonts.DescriptionFont, maxWidth); serviceRenderedMessage = Fonts.BreakTextIntoList(inn.PaidMessage, Fonts.DescriptionFont, maxWidth); noGoldMessage = Fonts.BreakTextIntoList(inn.NotEnoughGoldMessage, Fonts.DescriptionFont, maxWidth); selectionMark = 1; ChangeDialogue(welcomeMessage); }
/// <summary> /// Get the quest requirements /// </summary> /// <param name="quest">The particular quest</param> /// <returns>List of strings containing formatted output</returns> private List <Line> GetRequirements(Quest quest) { List <Line> reqdList; Line reqd; int currentCount = 0; int totalCount = 0; List <string> dialog; reqdList = new List <Line>(); reqd.font = Fonts.DescriptionFont; // Add Monster Requirements if (quest.MonsterRequirements.Count > 0) { reqd.color = headerColor; reqd.text = String.Empty; reqdList.Add(reqd); reqd.text = "Monster Progress"; reqdList.Add(reqd); for (int i = 0; i < quest.MonsterRequirements.Count; i++) { reqd.color = textColor; currentCount = quest.MonsterRequirements[i].CompletedCount; totalCount = quest.MonsterRequirements[i].Count; Monster monster = quest.MonsterRequirements[i].Content; reqd.text = monster.Name + " = " + currentCount + " / " + totalCount; if (currentCount == totalCount) { reqd.color = Color.Red; } reqdList.Add(reqd); } } // Add Item Requirements if (quest.GearRequirements.Count > 0) { reqd.color = headerColor; reqd.text = String.Empty; reqdList.Add(reqd); reqd.text = "Item Progress"; reqdList.Add(reqd); for (int i = 0; i < quest.GearRequirements.Count; i++) { reqd.color = textColor; currentCount = quest.GearRequirements[i].CompletedCount; totalCount = quest.GearRequirements[i].Count; Gear gear = quest.GearRequirements[i].Content; reqd.text = gear.Name + " = " + currentCount + " / " + totalCount; if (currentCount == totalCount) { reqd.color = Color.Red; } reqdList.Add(reqd); } } // Add Current Objective reqd.color = headerColor; reqd.text = String.Empty; reqdList.Add(reqd); reqd.text = "Current Objective"; reqdList.Add(reqd); reqd.color = textColor; switch (quest.Stage) { case Quest.QuestStage.InProgress: dialog = Fonts.BreakTextIntoList(quest.ObjectiveMessage, Fonts.DescriptionFont, 715); for (int i = 0; i < dialog.Count; i++) { reqd.text = dialog[i]; reqdList.Add(reqd); } break; case Quest.QuestStage.RequirementsMet: dialog = Fonts.BreakTextIntoList(quest.DestinationObjectiveMessage, Fonts.DescriptionFont, 715); for (int i = 0; i < dialog.Count; i++) { reqd.text = dialog[i]; reqdList.Add(reqd); } break; case Quest.QuestStage.Completed: reqd.font = Fonts.ButtonNamesFont; reqd.color = new Color(139, 21, 73); reqd.text = "Quest Completed"; reqdList.Add(reqd); break; } return(reqdList); }
public HelpScreen() : base() { textLines = Fonts.BreakTextIntoList(helpText, Fonts.DescriptionFont, (int)(590 * ScaledVector2.ScaleFactor)); }
public HelpScreen() : base() { textLines = Fonts.BreakTextIntoList(helpText, Fonts.DescriptionFont, 590); }