/// <summary> /// Initializes a new instance of the <see cref="World"/> class. /// </summary> /// <param name="getTime">Interface to get the current time.</param> /// <param name="camera">Primary world view camera.</param> /// <param name="userInfo">The user info. Can be null.</param> public World(IGetTime getTime, ICamera2D camera, UserInfo userInfo) { _userInfo = userInfo; _getTime = getTime; _camera = camera; MapDrawingExtensions.Add(new EmoticonMapDrawingExtension<Emoticon, EmoticonInfo<Emoticon>>(_emoticonDisplayManager)); if (userInfo != null) { Func<QuestID, bool> questStartReqs = x => UserInfo.HasStartQuestRequirements.HasRequirements(x) ?? false; Func<QuestID, bool> questFinishReqs = x => UserInfo.QuestInfo.ActiveQuests.Contains(x) && (UserInfo.HasFinishQuestRequirements.HasRequirements(x) ?? false); var e = new QuestMapDrawingExtension<Character>(userInfo.QuestInfo, questStartReqs, questFinishReqs, m => m.Spatial.GetMany<Character>(m.Camera.GetViewArea(), c => !c.ProvidedQuests.IsEmpty()), c => c.ProvidedQuests) { QuestAvailableCanStartIndicator = new Grh(GrhInfo.GetData("Quest", "can start")), QuestStartedIndicator = new Grh(GrhInfo.GetData("Quest", "started")), QuestAvailableCannotStartIndicator = new Grh(GrhInfo.GetData("Quest", "cannot start")), QuestTurnInIndicator = new Grh(GrhInfo.GetData("Quest", "turnin")) }; MapDrawingExtensions.Add(e); } }
/// <summary> /// Initializes a new instance of the <see cref="FriendsForm"/> class. /// </summary> /// <param name="userInfo">The user info.</param> /// <param name="parent">The parent.</param> /// <exception cref="ArgumentNullException"><paramref name="userInfo" /> is <c>null</c>.</exception> public FriendsForm(UserInfo userInfo, Control parent) : base(parent, Vector2.Zero, new Vector2(225, 400)) { if (userInfo == null) throw new ArgumentNullException("userInfo"); AddBtn = new Button(this, new Vector2(30, 300), new Vector2(30, 25)) { Text = "Add" }; AddBtn.Clicked += AddBtn_Clicked; RemoveBtn = new Button(this, new Vector2(90, 300), new Vector2(30, 25)) { Text = "Remove" }; RemoveBtn.Clicked += RemoveBtn_Clicked; SendBtn = new Button(this, new Vector2(150, 300), new Vector2(30, 25)) { Text = "Send" }; SendBtn.Clicked += SendBtn_Clicked; // Create the input and output TextBoxes InputTextBox = new TextBox(this, new Vector2(10, 270), new Vector2(120, 25)) { IsMultiLine = false, IsEnabled = true, Font = GameScreenHelper.DefaultChatFont, BorderColor = new Color(255, 255, 255, 100) }; _userInfo = userInfo; for (int i = 0; i < 50; i++) { var position = new Vector2(10, (30 + 15 * i)); FriendsCollection[i] = new Label(this, position) { Text = "", CanFocus = false, Tag = i, Font = GameScreenHelper.DefaultChatFont }; FriendsCollection[i].MouseDown += Friend_Clicked; } }
/// <summary> /// Initializes a new instance of the <see cref="StatsForm"/> class. /// </summary> /// <param name="userInfo">The user info.</param> /// <param name="parent">The parent.</param> /// <exception cref="ArgumentNullException"><paramref name="userInfo" /> is <c>null</c>.</exception> public StatsForm(UserInfo userInfo, Control parent) : base(parent, Vector2.Zero, new Vector2(225, 275)) { if (userInfo == null) throw new ArgumentNullException("userInfo"); _addStatGrh = new Grh(GrhInfo.GetData("GUI", "AddStat")); _userInfo = userInfo; _yOffset = 2; NewUserInfoLabel("Level", x => x.Level.ToString()); NewUserInfoLabel("Exp", x => x.Exp.ToString()); NewUserInfoLabel("StatPoints", x => x.StatPoints.ToString()); AddLine(); NewUserInfoLabel("HP", x => x.HP + " / " + x.ModStats[StatType.MaxHP]); NewUserInfoLabel("MP", x => x.MP + " / " + x.ModStats[StatType.MaxMP]); AddLine(); NewStatLabel(StatType.MinHit); NewStatLabel(StatType.MaxHit); NewStatLabel(StatType.Defence); AddLine(); NewStatLabel(StatType.Str); NewStatLabel(StatType.Agi); NewStatLabel(StatType.Int); }
/// <summary> /// Initializes a new instance of the <see cref="UserQuestInformationExtended"/> class. /// </summary> /// <param name="userInfo">The user info.</param> /// <exception cref="ArgumentNullException"><paramref name="userInfo" /> is <c>null</c>.</exception> public UserQuestInformationExtended(UserInfo userInfo) { if (userInfo == null) throw new ArgumentNullException("userInfo"); _userInfo = userInfo; }