Ejemplo n.º 1
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            NextButton.Draw(spriteBatch);
            PreviousButton.Draw(spriteBatch);
            var drawVect = new Vector2(TopLeft.X + 80, TopLeft.Y + 56);

            for (int i = 0; i < 5; i++)
            {
                spriteBatch.DrawString(game.mediumFont, days[i], drawVect, Color.Black, 0, TextMethods.CenterText(game.mediumFont, days[i]), 1, SpriteEffects.None, 0.16f);
                drawVect.X = drawVect.X + 109;
            }
            drawVect = new Vector2(TopLeft.X + 30, TopLeft.Y + 79);
            for (int i = (viewedMonth * 15) + 1; i < (viewedMonth * 15) + 16; i++)
            {
                spriteBatch.DrawString(game.mediumFont, i - (15 * viewedMonth) + ".", new Vector2(drawVect.X + 2, drawVect.Y + 2), Color.Black, 0, Vector2.Zero, 1, SpriteEffects.None, 0.16f);
                if (game.party.QuestStats.DayCounter == i)
                {
                    spriteBatch.Draw(dayRimShine, new Rectangle((int)drawVect.X, (int)drawVect.Y, 107, 102), null, Color.White, 0, Vector2.Zero, SpriteEffects.None, 0.17f);
                }
                if (game.calendarEvents.ContainsKey(i))
                {
                    if (game.calendarEvents[i].NoClass)
                    {
                        spriteBatch.DrawString(game.smallFont, strings[7], new Vector2(drawVect.X + 2, drawVect.Y + 21), Color.Black, 0, Vector2.Zero, 1, SpriteEffects.None, 0.16f);
                    }
                    if (game.calendarEvents[i].Exam)
                    {
                        spriteBatch.DrawString(game.smallFont, strings[6], new Vector2(drawVect.X + 2, drawVect.Y + 21), Color.Black, 0, Vector2.Zero, 1, SpriteEffects.None, 0.16f);
                    }
                    if (game.calendarEvents[i].Classes != null)
                    {
                        var classes = "~";
                        if (game.calendarEvents[i].Classes.Length == 1)
                        {
                            classes = classes + strings[game.calendarEvents[i].Classes[0]] + "~";
                        }
                        else
                        {
                            classes = classes + strings[game.calendarEvents[i].Classes[0]] + "/" + strings[game.calendarEvents[i].Classes[1]] + "~";
                        }
                        spriteBatch.DrawString(game.smallFont, classes, new Vector2(drawVect.X + 2, drawVect.Y + 21), Color.Black, 0, Vector2.Zero, 1, SpriteEffects.None, 0.16f);
                    }
                    if (game.calendarEvents[i].ExpiredQuests != null)
                    {
                        var ExpQuestVector = new Point((int)drawVect.X + 2, (int)drawVect.Y + 70);
                        var rect           = new Rectangle(ExpQuestVector.X, ExpQuestVector.Y, 28, 28);
                        for (int e = 0; e < game.calendarEvents[i].ExpiredQuests.Length; e++)
                        {
                            var quest = game.party.QuestStats.Quests.Find(q => q.questID == game.calendarEvents[i].ExpiredQuests[e]);
                            if (quest != null)
                            {
                                if (rect.X < drawVect.X + 108)
                                {
                                    if (quest.mainQuest)
                                    {
                                        spriteBatch.Draw(MainQuestWarningIcon, rect, null, Color.White, 0, Vector2.Zero, SpriteEffects.None, 0.16f);
                                    }
                                    else
                                    {
                                        spriteBatch.Draw(SideQuestWarningIcon, rect, null, Color.White, 0, Vector2.Zero, SpriteEffects.None, 0.16f);
                                    }
                                    if (Input.IsMouseOver(rect))
                                    {
                                        DrawMethods.DrawToolTip(spriteBatch, game.Input.oldMouseState.Position.ToVector2(), game.smallFont, tooltip, strings[8] + '"' + quest.Title + '"');
                                    }
                                    rect.X += 28;
                                }
                            }
                        }
                    }
                }
                //this goes at the end of the loop to set the next line
                drawVect.X += 108;
                if (i - (15 * viewedMonth) == 5)
                {
                    drawVect = new Vector2(TopLeft.X + 30, TopLeft.Y + 184);
                    continue;
                }
                if (i - (15 * viewedMonth) == 10)
                {
                    drawVect = new Vector2(TopLeft.X + 30, TopLeft.Y + 289);
                }
            }
            drawVect = new Vector2(TopLeft.X + 146, TopLeft.Y + 428);
            var month = GetMonthStringIndex(viewedMonth);

            spriteBatch.DrawString(game.mediumFont, months[month], drawVect, Color.Black, 0, TextMethods.CenterText(game.mediumFont, months[month]), 1, SpriteEffects.None, 0.16f);
            base.Draw(spriteBatch);
        }
Ejemplo n.º 2
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);
            var drawVector = new Point(game.GetScreenWidth() / 2 - 350, game.GetScreenHeight() / 2 - 295);

            if (displayTutHighlight)
            {
                spriteBatch.Draw(tutHighlight, new Rectangle(drawVector.X + 7, drawVector.Y + 533, 63, 52), null, new Color(255, 255, 255, highlightAlpha), 0, Vector2.Zero, SpriteEffects.FlipHorizontally, 0f);
            }
            BackButton.Draw(spriteBatch);
            if (Input.IsMouseOver(helpRectangle))
            {
                DrawMethods.DrawToolTip(spriteBatch, new Vector2(game.Input.oldMouseState.X, game.Input.oldMouseState.Y), game.smallFont, tooltipWindow, strings[16 + (int)stage]);
                displayTutHighlight = false;
            }
            if (!canAdvanceToNextStage())
            {
                spriteBatch.Draw(greyedOut, new Rectangle(drawVector.X + 632, drawVector.Y + 533, 61, 50), Color.White);
            }
            else
            {
                NextButton.Draw(spriteBatch);
            }
            switch (stage)
            {
            case (Stage.Naming):
            {
                spriteBatch.DrawString(game.mediumFont, strings[0], new Vector2(drawVector.X + 350, drawVector.Y + 32), Color.Black, 0.0f, TextMethods.CenterText(game.mediumFont, strings[0]), 1.0f, SpriteEffects.None, 0.0f);
                drawVector.X += 125;
                drawVector.Y += 132;
                spriteBatch.Draw(nameBar, new Rectangle(drawVector.X, drawVector.Y, 500, 68), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.001f);
                drawVector.X += 6;
                drawVector.Y += 6;
                spriteBatch.DrawString(game.largeFont, playerName, drawVector.ToVector2(), Color.Black, 0.0f, new Vector2(0, 0), 1.0f, SpriteEffects.None, 0.0f);
                if (displayCursor && nameInputActive)
                {
                    spriteBatch.DrawString(game.largeFont, "|", new Vector2(drawVector.X + game.largeFont.MeasureString(playerName.Substring(0, cursorPosition)).X - 12, drawVector.Y), Color.Black, 0.0f, new Vector2(0, 0), 1.0f, SpriteEffects.None, 0.0f);
                }
                spriteBatch.Draw(genderCircle, new Rectangle(baseOffset.X + 160, baseOffset.Y + 282, 70, 70), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.001f);
                spriteBatch.Draw(maleIcon, new Rectangle(baseOffset.X + 172, baseOffset.Y + 296, 44, 44), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0f);
                spriteBatch.Draw(genderCircle, new Rectangle(baseOffset.X + 460, baseOffset.Y + 282, 70, 70), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.001f);
                spriteBatch.Draw(femaleIcon, new Rectangle(baseOffset.X + 474, baseOffset.Y + 296, 44, 44), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0f);
                if (gender == Gender.Male)
                {
                    spriteBatch.Draw(genderHighlight, new Rectangle(baseOffset.X + 160, baseOffset.Y + 282, 70, 70), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0f);
                }
                if (gender == Gender.Female)
                {
                    spriteBatch.Draw(genderHighlight, new Rectangle(baseOffset.X + 460, baseOffset.Y + 282, 70, 70), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.0f);
                }
                break;
            }

            case (Stage.Arcana):
            {
                spriteBatch.DrawString(game.mediumFont, strings[1], new Vector2(drawVector.X + 350, drawVector.Y + 32), Color.Black, 0.0f, TextMethods.CenterText(game.mediumFont, strings[1]), 1.0f, SpriteEffects.None, 0.0f);
                drawVector = new Point(game.GetScreenWidth() / 2 - 200, game.GetScreenHeight() / 2 - 180);
                spriteBatch.Draw(ArcanaWheel, new Rectangle(drawVector.X, drawVector.Y, 400, 400), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.02f);
                for (int i = 0; i < arcanaRecs.Length; i++)
                {
                    if (game.Input.IsMouseOver(arcanaRecs[i]))
                    {
                        DrawMethods.DrawToolTip(spriteBatch, new Vector2(game.Input.oldMouseState.X, game.Input.oldMouseState.Y), game.smallFont, tooltipWindow, strings[4 + i]);
                        break;
                    }
                }
                if (selectedArcana != Arcana.Null)
                {
                    spriteBatch.Draw(arcanaHighlight, arcanaRecs[(int)selectedArcana], null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.01f);
                }
                break;
            }

            case (Stage.Attributes):
            {
                spriteBatch.DrawString(game.mediumFont, strings[2], new Vector2(drawVector.X + 300, drawVector.Y + 32), Color.Black, 0.0f, TextMethods.CenterText(game.mediumFont, strings[2]), 1.0f, SpriteEffects.None, 0.0f);
                drawVector = new Point(game.GetScreenWidth() / 2 - 240, game.GetScreenHeight() / 2 - 230);
                spriteBatch.Draw(attributesWindow, new Rectangle(drawVector.X, drawVector.Y, 508, 426), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.02f);
                spriteBatch.DrawString(game.mediumFont, Health.ToString(), new Vector2(drawVector.X + 94, drawVector.Y + 339), Color.Black, 0.0f, TextMethods.CenterText(game.mediumFont, Health.ToString()), 1.0f, SpriteEffects.None, 0.01f);
                spriteBatch.DrawString(game.mediumFont, Mana.ToString(), new Vector2(drawVector.X + 198, drawVector.Y + 339), Color.Black, 0.0f, TextMethods.CenterText(game.mediumFont, Mana.ToString()), 1.0f, SpriteEffects.None, 0.01f);
                spriteBatch.DrawString(game.mediumFont, charAttributes[Attributes.Strength].ToString(), new Vector2(drawVector.X + 124, drawVector.Y + 99), Color.Black, 0.0f, TextMethods.CenterText(game.mediumFont, charAttributes[Attributes.Strength].ToString()), 1.0f, SpriteEffects.None, 0.01f);
                spriteBatch.DrawString(game.mediumFont, charAttributes[Attributes.Magic].ToString(), new Vector2(drawVector.X + 124, drawVector.Y + 181), Color.Black, 0.0f, TextMethods.CenterText(game.mediumFont, charAttributes[Attributes.Magic].ToString()), 1.0f, SpriteEffects.None, 0.01f);
                spriteBatch.DrawString(game.mediumFont, charAttributes[Attributes.Dexterity].ToString(), new Vector2(drawVector.X + 124, drawVector.Y + 262), Color.Black, 0.0f, TextMethods.CenterText(game.mediumFont, charAttributes[Attributes.Dexterity].ToString()), 1.0f, SpriteEffects.None, 0.01f);

                var recs = new Rectangle[5];
                recs[0] = new Rectangle(drawVector.X + 15, drawVector.Y + 66, 204, 70);
                recs[1] = new Rectangle(drawVector.X + 15, drawVector.Y + 147, 204, 70);
                recs[2] = new Rectangle(drawVector.X + 15, drawVector.Y + 228, 204, 70);
                recs[3] = new Rectangle(drawVector.X + 13, drawVector.Y + 305, 101, 63);
                recs[4] = new Rectangle(drawVector.X + 118, drawVector.Y + 305, 101, 63);
                for (int i = 0; i < recs.Length; i++)
                {
                    if (game.Input.IsMouseOver(recs[i]))
                    {
                        attributeDesc = strings[10 + i];
                        goto DrawRemainingPoints;
                    }
                }
                if (pointsToAllocate > 0)
                {
                    for (int i = 0; i < AttributeButtons.Length; i++)
                    {
                        AttributeButtons[i].Draw(spriteBatch);
                    }
                }

                attributeDesc = strings[15];
DrawRemainingPoints:
                spriteBatch.DrawString(game.mediumFont, TextMethods.WrapText(game.mediumFont, attributeDesc, 214), new Vector2(drawVector.X + 263, drawVector.Y + 75), Color.Black, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.01f);
                drawVector    = new Point(game.GetScreenWidth() / 2 - 350, game.GetScreenHeight() / 2 - 295);
                drawVector.X += 73;
                drawVector.Y += 548;
                spriteBatch.Draw(pointsRemainingBox, new Rectangle(drawVector.X, drawVector.Y, 210, 36), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.02f);
                drawVector.X += 4;
                drawVector.Y += 8;
                spriteBatch.DrawString(game.mediumFont, strings[16] + pointsToAllocate, drawVector.ToVector2(), Color.Black, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.01f);
                break;
            }

            case (Stage.Finish):
            {
                spriteBatch.DrawString(game.mediumFont, strings[3], new Vector2(drawVector.X + 300, drawVector.Y + 32), Color.Black, 0.0f, TextMethods.CenterText(game.mediumFont, strings[3]), 1.0f, SpriteEffects.None, 0.0f);
                drawVector = new Point(game.GetScreenWidth() / 2 - 240, game.GetScreenHeight() / 2 - 230);
                spriteBatch.Draw(FinishPanel, new Rectangle(drawVector.X, drawVector.Y, 508, 426), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.02f);
                spriteBatch.DrawString(game.largeFont, playerName, new Vector2(drawVector.X + 18, drawVector.Y + 8), Color.Black, 0.0f, Vector2.Zero, 1, SpriteEffects.None, 0.01f);
                if (gender == Gender.Male)
                {
                    spriteBatch.Draw(maleIcon, new Rectangle(drawVector.X + 54, drawVector.Y + 244, 44, 44), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.0f);
                }
                if (gender == Gender.Female)
                {
                    spriteBatch.Draw(femaleIcon, new Rectangle(drawVector.X + 54, drawVector.Y + 244, 44, 44), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.0f);
                }
                spriteBatch.DrawString(game.mediumFont, Health + "/" + Health, new Vector2(drawVector.X + 256, drawVector.Y + 113), Color.Black, 0.0f, TextMethods.CenterText(game.mediumFont, Health + "/" + Health), 1.0f, SpriteEffects.None, 0.01f);
                spriteBatch.DrawString(game.mediumFont, Mana + "/" + Mana, new Vector2(drawVector.X + 256, drawVector.Y + 171), Color.Black, 0.0f, TextMethods.CenterText(game.mediumFont, Mana + "/" + Mana), 1.0f, SpriteEffects.None, 0.01f);
                spriteBatch.DrawString(game.mediumFont, charAttributes[Attributes.Strength].ToString(), new Vector2(drawVector.X + 256, drawVector.Y + 229), Color.Black, 0.0f, TextMethods.CenterText(game.mediumFont, charAttributes[Attributes.Strength].ToString()), 1.0f, SpriteEffects.None, 0.01f);
                spriteBatch.DrawString(game.mediumFont, charAttributes[Attributes.Magic].ToString(), new Vector2(drawVector.X + 256, drawVector.Y + 287), Color.Black, 0.0f, TextMethods.CenterText(game.mediumFont, charAttributes[Attributes.Magic].ToString()), 1.0f, SpriteEffects.None, 0.01f);
                spriteBatch.DrawString(game.mediumFont, charAttributes[Attributes.Dexterity].ToString(), new Vector2(drawVector.X + 256, drawVector.Y + 345), Color.Black, 0.0f, TextMethods.CenterText(game.mediumFont, charAttributes[Attributes.Dexterity].ToString()), 1.0f, SpriteEffects.None, 0.01f);
                spriteBatch.Draw(arcanas[(int)selectedArcana], new Rectangle(drawVector.X + 15, drawVector.Y + 94, 120, 120), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 0.01f);
                drawVector = new Point(game.GetScreenWidth() / 2 - 350, game.GetScreenHeight() / 2 - 295);
                spriteBatch.Draw(finishTick, new Rectangle(drawVector.X + 632, drawVector.Y + 533, 61, 50), null, Color.White, 0, Vector2.Zero, SpriteEffects.None, 0.029f);
                break;
            }
            }
        }