Example #1
0
        private void OnUpdate(object sender, ElapsedEventArgs e)
        {
            timerUpdate.Stop();
            if (closed || isInitializing || disposed)
            {
                return;
            }

            this.Invoke((MethodInvoker) delegate
            {
                if (closed || isInitializing || disposed)
                {
                    return;
                }

                if (!initedCursorPos)
                {
                    initedCursorPos = true;
                    Cursor.Position = SkillBar.SkillBarLocation;
                }
                Color col = ColorUtils.GetColorAt(SkillBar.SkillBarLocation);
                lblSkillBarLocation.Text = $"Skill bar location: {SkillBar.SkillBarLocation}, Color: R:{col.R}, G:{col.G}, B:{col.B}";
                for (int i = 0; i < skillsInt.Count; i++)
                {
                    if (skillsInt[i] != Constants.NONE)
                    {
                        skills[i].Display(SkillBar.GetSkillForNumber(skillsInt[i]));
                    }
                }
                timerUpdate.Start();
            });
        }
        private void InitSkills()
        {
            _skills = new List <SkillInfo>();
            int count = SavedData.GetAttackSkillsCount();

            for (int i = 0; i < count; ++i)
            {
                int skillNumber = SavedData.GetAttackSkillAtPos(i);
                if (skillNumber != Constants.NONE)
                {
                    SkillInfo skill = SkillBar.GetSkillForNumber(skillNumber);
                    _skills.Add(skill);
                }
            }
        }