Ejemplo n.º 1
0
        /// <summary>
        /// Handles the TimerTick event of the EveMonClient control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void EveMonClient_TimerTick(object sender, EventArgs e)
        {
            if (!Character.IsTraining || !Visible)
            {
                return;
            }

            if (m_blinkAction == BlinkAction.Stop)
            {
                m_blinkAction = BlinkAction.Reset;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Draws the boxes.
        /// </summary>
        /// <param name="fractionCompleted">The fraction completed.</param>
        /// <param name="skill">The skill.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.DrawItemEventArgs"/> instance containing the event data.</param>
        private void DrawBoxes(double fractionCompleted, QueuedSkill skill, DrawItemEventArgs e)
        {
            Graphics g = e.Graphics;

            g.DrawRectangle(Pens.Black,
                            new Rectangle(e.Bounds.Right - BoxWidth - PadRight, e.Bounds.Top + PadTop, BoxWidth,
                                          BoxHeight));

            const int LevelBoxWidth = (BoxWidth - 4 - 3) / 5;

            for (int level = 1; level <= 5; level++)
            {
                Rectangle brect =
                    new Rectangle(e.Bounds.Right - BoxWidth - PadRight + 2 + LevelBoxWidth * (level - 1) + (level - 1),
                                  e.Bounds.Top + PadTop + 2, LevelBoxWidth, BoxHeight - 3);

                // Box color
                g.FillRectangle(skill.Skill != null && level < skill.Level ? Brushes.Black : Brushes.DarkGray, brect);

                if (skill.Skill == null)
                {
                    continue;
                }

                foreach (QueuedSkill qskill in Character.SkillQueue)
                {
                    if ((!qskill.IsTraining && skill == qskill && level == qskill.Level) ||
                        (skill == qskill && level <= qskill.Level && level > skill.Skill.Level &&
                         Math.Abs(fractionCompleted) < double.Epsilon))
                    {
                        g.FillRectangle(Brushes.RoyalBlue, brect);
                    }

                    // Blinking indicator of skill level in training
                    if (!qskill.IsTraining || skill != qskill || level != skill.Level ||
                        Math.Abs(fractionCompleted) < double.Epsilon)
                    {
                        continue;
                    }

                    if (m_blinkAction == BlinkAction.Blink)
                    {
                        g.FillRectangle(Brushes.RoyalBlue, brect);
                    }

                    m_blinkAction = m_blinkAction == BlinkAction.Reset
                        ? BlinkAction.Blink
                        : BlinkAction.Stop;
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Draws the boxes.
        /// </summary>
        /// <param name="skill">The skill.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.DrawItemEventArgs"/> instance containing the event data.</param>
        private void DrawBoxes(Skill skill, DrawItemEventArgs e)
        {
            Graphics g = e.Graphics;

            g.DrawRectangle(Pens.Black,
                            new Rectangle(e.Bounds.Right - BoxWidth - PadRight, e.Bounds.Top + PadTop, BoxWidth, BoxHeight));

            const int LevelBoxWidth = (BoxWidth - 4 - 3) / 5;

            for (int level = 1; level <= 5; level++)
            {
                Rectangle brect = new Rectangle(
                    e.Bounds.Right - BoxWidth - PadRight + 2 + LevelBoxWidth * (level - 1) + (level - 1),
                    e.Bounds.Top + PadTop + 2, LevelBoxWidth, BoxHeight - 3);

                g.FillRectangle(level <= skill.Level ? Brushes.Black : Brushes.DarkGray, brect);

                // Color indicator for a queued level
                CCPCharacter ccpCharacter = Character as CCPCharacter;
                if (ccpCharacter != null)
                {
                    SkillQueue skillQueue = ccpCharacter.SkillQueue;
                    if (skillQueue
                        .Any(qskill =>
                             (!skill.IsTraining && skill == qskill.Skill && level == qskill.Level) ||
                             (skill.IsTraining && skill == qskill.Skill && level == qskill.Level &&
                              level > skill.Level + 1)))
                    {
                        g.FillRectangle(Brushes.RoyalBlue, brect);
                    }
                }

                // Blinking indicator of skill in training level
                if (!skill.IsTraining || level != skill.Level + 1)
                {
                    continue;
                }

                if (m_blinkAction == BlinkAction.Blink)
                {
                    g.FillRectangle(Brushes.RoyalBlue, brect);
                }

                m_blinkAction = m_blinkAction == BlinkAction.Reset
                    ? BlinkAction.Blink
                    : BlinkAction.Stop;
            }
        }
Ejemplo n.º 4
0
    void UpdateTime()
    {
        // Get current time
        int time = Mathf.CeilToInt(_time);

        if (time != _currentTime)
        {
            if (_currentTime > 0)
            {
                // Frame
                frame.StopAction();
                frame.Show();
                frame.Play(BlinkAction.Create(2, 0.3f, false, false), () => { frame.Hide(); });

                // Play effect
                GameObject effect = numberEffect.gameObject;
                effect.StopAction(true);
                effect.Show();
                effect.transform.localScale = Vector3.one;
                effect.SetColor(_currentTime > 3 ? Color.white : alarmColor, true);

                numberEffect.Number = _currentTime;

                var zoomOut = ScaleAction.ScaleTo(alarmScale, alarmDuration);
                var fadeOut = FadeAction.RecursiveFadeOut(alarmDuration);
                var hide    = HideAction.Create();

                effect.Play(SequenceAction.Create(ParallelAction.ParallelAll(zoomOut, fadeOut), hide));
            }

            // Set current time
            _currentTime = time;

            // Update number
            number.Number = time;
        }
    }
Ejemplo n.º 5
0
        /// <summary>
        /// Draws the boxes.
        /// </summary>
        /// <param name="skill">The skill.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.DrawItemEventArgs"/> instance containing the event data.</param>
        private void DrawBoxes(Skill skill, DrawItemEventArgs e)
        {
            Graphics g = e.Graphics;

            g.DrawRectangle(Pens.Black,
                            new Rectangle(e.Bounds.Right - BoxWidth - PadRight, e.Bounds.Top + PadTop, BoxWidth, BoxHeight));

            const int LevelBoxWidth = (BoxWidth - 4 - 3) / 5;
            for (int level = 1; level <= 5; level++)
            {
                Rectangle brect = new Rectangle(
                    e.Bounds.Right - BoxWidth - PadRight + 2 + LevelBoxWidth * (level - 1) + (level - 1),
                    e.Bounds.Top + PadTop + 2, LevelBoxWidth, BoxHeight - 3);

                g.FillRectangle(level <= skill.Level ? Brushes.Black : Brushes.DarkGray, brect);

                // Color indicator for a queued level
                CCPCharacter ccpCharacter = Character as CCPCharacter;
                if (ccpCharacter != null)
                {
                    SkillQueue skillQueue = ccpCharacter.SkillQueue;
                    if (skillQueue
                        .Any(qskill =>
                            (!skill.IsTraining && skill == qskill.Skill && level == qskill.Level) ||
                            (skill.IsTraining && skill == qskill.Skill && level == qskill.Level &&
                             level > skill.Level + 1)))
                    {
                        g.FillRectangle(Brushes.RoyalBlue, brect);
                    }
                }

                // Blinking indicator of skill in training level
                if (!skill.IsTraining || level != skill.Level + 1)
                    continue;
                
                if (m_blinkAction == BlinkAction.Blink)
                    g.FillRectangle(Brushes.RoyalBlue, brect);

                m_blinkAction = m_blinkAction == BlinkAction.Reset
                    ? BlinkAction.Blink
                    : BlinkAction.Stop;
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Handles the TimerTick event of the EveMonClient control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void EveMonClient_TimerTick(object sender, EventArgs e)
        {
            if (!Character.IsTraining || !Visible)
                return;

            if (m_blinkAction == BlinkAction.Stop)
                m_blinkAction = BlinkAction.Reset;
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Draws the boxes.
        /// </summary>
        /// <param name="skill">The skill.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.DrawItemEventArgs"/> instance containing the event data.</param>
        private void DrawBoxes(Skill skill, DrawItemEventArgs e)
        {
            Graphics g       = e.Graphics;
            bool     isAlpha = skill.Character.CharacterStatus.IsAlpha;

            g.DrawRectangle(Pens.Black, new Rectangle(e.Bounds.Right - BoxWidth - PadRight,
                                                      e.Bounds.Top + PadTop, BoxWidth, BoxHeight));

            const int levelBoxWidth = (BoxWidth - 4 - 3) / 5, levelBoxHeight = BoxHeight - 3;
            int       square = Math.Min(levelBoxWidth, levelBoxHeight);

            for (int level = 1; level <= 5; level++)
            {
                Brush fillBrush = Brushes.DarkGray;
                int   alphaPad = 0, w, h;
                if (isAlpha && level > skill.StaticData.AlphaLimit)
                {
                    // Draw smaller gold square to indicate this level cannot be trained
                    fillBrush = Brushes.DarkGoldenrod;
                    alphaPad  = 2;
                }
                if (level <= skill.Level)
                {
                    // Trained
                    if (alphaPad > 0)
                    {
                        // And inactive
                        alphaPad = 0;
                    }
                    else
                    {
                        fillBrush = Brushes.Black;
                    }
                }

                // If the box is denoting an untrainable level, make it square
                if (alphaPad > 0)
                {
                    w = h = square - 2 * alphaPad;
                }
                else
                {
                    w = levelBoxWidth;
                    h = levelBoxHeight;
                }

                // Determine proper spacing to center it in the frame
                var brect = new Rectangle(e.Bounds.Right - BoxWidth - PadRight + 2 +
                                          (levelBoxWidth + 1) * (level - 1) + (levelBoxWidth - w) / 2,
                                          e.Bounds.Top + PadTop + 2 + (levelBoxHeight - h) / 2, w, h);

                // Color indicator for a queued level or one which is training now
                var ccpCharacter = Character as CCPCharacter;
                if (ccpCharacter != null)
                {
                    var skillQueue = ccpCharacter.SkillQueue;
                    // X || (!X && Y) == X || Y
                    if (skillQueue.Any(qskill => skill == qskill.Skill && level == qskill.
                                       Level && (!skill.IsTraining || level > skill.Level + 1)))
                    {
                        fillBrush = Brushes.RoyalBlue;
                    }
                }

                // Blink indicator of skill levels which are in training
                if (skill.IsTraining && level == skill.Level + 1)
                {
                    if (m_blinkAction == BlinkAction.Blink)
                    {
                        fillBrush = Brushes.RoyalBlue;
                    }
                    m_blinkAction = (m_blinkAction == BlinkAction.Reset) ? BlinkAction.Blink :
                                    BlinkAction.Stop;
                }

                g.FillRectangle(fillBrush, brect);
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Draws the boxes.
        /// </summary>
        /// <param name="fractionCompleted">The fraction completed.</param>
        /// <param name="skill">The skill.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.DrawItemEventArgs"/> instance containing the event data.</param>
        private void DrawBoxes(double fractionCompleted, QueuedSkill skill, DrawItemEventArgs e)
        {
            Graphics g = e.Graphics;

            g.DrawRectangle(Pens.Black,
                new Rectangle(e.Bounds.Right - BoxWidth - PadRight, e.Bounds.Top + PadTop, BoxWidth,
                    BoxHeight));

            const int LevelBoxWidth = (BoxWidth - 4 - 3) / 5;
            for (int level = 1; level <= 5; level++)
            {
                Rectangle brect =
                    new Rectangle(e.Bounds.Right - BoxWidth - PadRight + 2 + LevelBoxWidth * (level - 1) + (level - 1),
                        e.Bounds.Top + PadTop + 2, LevelBoxWidth, BoxHeight - 3);

                // Box color
                g.FillRectangle(skill.Skill != null && level < skill.Level ? Brushes.Black : Brushes.DarkGray, brect);

                if (skill.Skill == null)
                    continue;

                foreach (QueuedSkill qskill in Character.SkillQueue)
                {
                    if ((!qskill.IsTraining && skill == qskill && level == qskill.Level)
                        || (skill == qskill && level <= qskill.Level && level > skill.Skill.Level
                            && Math.Abs(fractionCompleted) < double.Epsilon))
                    {
                        g.FillRectangle(Brushes.RoyalBlue, brect);
                    }

                    // Blinking indicator of skill level in training
                    if (!qskill.IsTraining || skill != qskill || level != skill.Level ||
                        Math.Abs(fractionCompleted) < double.Epsilon)
                    {
                        continue;
                    }

                    if (m_blinkAction == BlinkAction.Blink)
                        g.FillRectangle(Brushes.RoyalBlue, brect);

                    m_blinkAction = m_blinkAction == BlinkAction.Reset
                        ? BlinkAction.Blink
                        : BlinkAction.Stop;
                }
            }
        }