protected override void OnDrawItem(DrawItemEventArgs e) { if (e.Index == -1 || Items[e.Index] == null) { base.OnDrawItem(e); return; } object item = Items[e.Index]; if (Enum.IsDefined(typeof(EHomuSkillUsage), item) == false) { base.OnDrawItem(e); return; } EHomuSkillUsage skill = (EHomuSkillUsage)Enum.Parse(typeof(EHomuSkillUsage), item.ToString()); Color texCol = Color.Black; if (skill == EHomuSkillUsage.NoSkill) { texCol = Color.Gray; } if ((e.State & DrawItemState.Selected) != 0) { e.Graphics.FillRectangle(new SolidBrush(Color.LightBlue), e.Bounds); } else { e.Graphics.FillRectangle(new SolidBrush(BackColor), e.Bounds); } e.Graphics.DrawString(skill.ToString(), Font, new SolidBrush(texCol), new Point(e.Bounds.X, e.Bounds.Y)); }
public static bool FromConfig(this string Value, out EHomuSkillUsage Skill) { Skill = (EHomuSkillUsage)(-1); if (Value == "WITH_no_skill") { Skill = EHomuSkillUsage.NoSkill; } else if (Value == "WITH_one_skill") { Skill = EHomuSkillUsage.OneSkill; } else if (Value == "WITH_two_skills") { Skill = EHomuSkillUsage.TwoSkills; } else if (Value == "WITH_max_skills") { Skill = EHomuSkillUsage.MaxSkills; } else if (Value == "WITH_full_power") { Skill = EHomuSkillUsage.FullPower; } else if (Value == "WITH_slow_power") { Skill = EHomuSkillUsage.SlowPower; } return(Skill != (EHomuSkillUsage)(-1)); }
public HomuTactListEntry(int id, string name, EHomuBehavior behav, EHomuSkillUsage skill, int priority) { ID = id; Name = name; Behavior = behav; Skill = skill; Priority = priority; }
public static bool FromConfig(this string Value, out EHomuSkillUsage Skill) { Skill = (EHomuSkillUsage)(-1); if (Value == "WITH_no_skill") Skill = EHomuSkillUsage.NoSkill; else if (Value == "WITH_one_skill") Skill = EHomuSkillUsage.OneSkill; else if (Value == "WITH_two_skills") Skill = EHomuSkillUsage.TwoSkills; else if (Value == "WITH_max_skills") Skill = EHomuSkillUsage.MaxSkills; else if (Value == "WITH_full_power") Skill = EHomuSkillUsage.FullPower; else if (Value == "WITH_slow_power") Skill = EHomuSkillUsage.SlowPower; return (Skill != (EHomuSkillUsage)(-1)); }
public bool AddTact(int ID, string Name, EHomuBehavior Behav, EHomuSkillUsage Skill, int Priority) { Add(new HomuTactListEntry(ID, Name, Behav, Skill, Priority)); return(true); }