Ejemplo n.º 1
0
        internal Vector2 GetMapMousePosition()
        {
            if (m_inputHandler.RightButtonIsDown())
            {
                if (!m_inputHandler.MouseIsOverInterface)
                {
                    return(m_camera.LogicalizeCordinates(m_inputHandler.GetMouseState().X, m_inputHandler.GetMouseState().Y));
                }
            }

            return(Vector2.Zero);
        }
        //Metod för utritning av QuestLog
        private void DrawQuestLog()
        {
            List <Objective> progress   = m_questSystem.ObjectiveList;
            List <Objective> quest      = m_questSystem.CurrentQuest.Objectives;
            Vector2          position   = new Vector2(405, 150);
            Rectangle        textRect   = m_camera.VisualizeRectangle(new Rectangle((int)position.X + 8, (int)position.Y + 53, 225, 350));
            Rectangle        closeCross = GetCloseButton(position.X, position.Y, QLOG);

            m_spriteBatch.Draw(m_textures[QLOG], position, Color.White);

            if (m_questSystem.CurrentQuest.Status != Model.QuestSystem.PRE)
            {
                m_spriteBatch.DrawString(m_spriteFontSegoeSmall, m_conversation.GetLogMessage(textRect), m_camera.LogicalizeCordinates(textRect.X, textRect.Y), Color.White);

                int changeRow = 150;
                for (int i = 0; i < progress.Count; i++)
                {
                    m_spriteBatch.DrawString(m_spriteFontSegoeSmall, progress[i].Amount + "/" + quest[i].Amount + " - " + quest[i].Name, m_camera.LogicalizeCordinates(textRect.X, textRect.Y + changeRow), Color.White);
                    changeRow += 18;
                }
            }

            if (m_inputHandler.MouseIsOver(new Rectangle((int)position.X, (int)position.Y, m_textures[QLOG].Bounds.Width, m_textures[QLOG].Bounds.Height)))
            {
                m_inputHandler.MouseIsOverInterface = true;
            }
            if (m_inputHandler.DidGetTargetedByLeftClick(closeCross))
            {
                m_questSystem.IsWatchingQuestLog = false;
            }
        }