Esempio n. 1
0
        private void listView_skills_SelectedIndexChanged(object sender, EventArgs e)
        {
            string text = "";

            if (listView_skills.SelectedIndices.Count > 0)
            {
                uint      id = Util.GetUInt32(listView_skills.Items[listView_skills.SelectedIndices[0]].SubItems[2].Text);
                UserSkill us = null;

                if (Globals.SkillListLock.TryEnterReadLock(Globals.THREAD_WAIT_GUI))
                {
                    try
                    {
                        us = Util.GetSkill(id);
                    }
                    finally
                    {
                        Globals.SkillListLock.ExitReadLock();
                    }
                }

                if (us != null)
                {
                    text = Util.GetSkillName(us.ID, us.Level) + Environment.NewLine +
                           "Level: " + us.Level.ToString() + Environment.NewLine +
                           (us.Passive == 0x01 ? "Passive" : "Active") + Environment.NewLine +
                           Util.GetSkillDesc(us.ID, us.Level, 1) + Environment.NewLine +
                           Util.GetSkillDesc(us.ID, us.Level, 2) + Environment.NewLine +
                           Util.GetSkillDesc(us.ID, us.Level, 3) + Environment.NewLine +
                           "Type ID: " + us.ID;
                }
            }

            toolTip1.SetToolTip(listView_skills, text);
        }
Esempio n. 2
0
        static public int GetSkillReuse(uint id)
        {
            long      getskill_reuse = 0;
            UserSkill us             = Util.GetSkill(id);

            if (us.IsReady())
            {
                getskill_reuse = 0;
            }
            else
            {
                getskill_reuse = (us.NextTime.Ticks - System.DateTime.Now.Ticks) / System.TimeSpan.TicksPerMillisecond;
            }
            return((int)getskill_reuse);
        }
Esempio n. 3
0
        public bool IsReady()
        {
            Globals.SkillListLock.EnterReadLock();
            try
            {
                if (Globals.gamedata.skills.ContainsKey(SkillID))
                {
                    UserSkill us = Util.GetSkill(SkillID);

                    if (us.IsReady())
                    {
                        return(true);
                    }
                }
            }
            finally
            {
                Globals.SkillListLock.ExitReadLock();
            }
            return(false);
        }