diff --git a/reffect/src/addon/ui/debug.rs b/reffect/src/addon/ui/debug.rs index 4df60d0..fcaad02 100644 --- a/reffect/src/addon/ui/debug.rs +++ b/reffect/src/addon/ui/debug.rs @@ -81,7 +81,7 @@ impl Addon { for slot in Slot::iter() { if let Some(ability) = skillbar.slot(slot) { - ui.text(format!("{}x {:>5}", ability.ammo, ability.id)); + ui.text(format!("{slot:<14} = {}x {:>5}", ability.ammo, ability.id)); let recharge = ability.recharge_remaining(passed); if recharge > 0 { diff --git a/reffect_api/src/ability.rs b/reffect_api/src/ability.rs index 9299616..c7f4867 100644 --- a/reffect_api/src/ability.rs +++ b/reffect_api/src/ability.rs @@ -1,4 +1,4 @@ -use strum::{EnumCount, EnumIter}; +use strum::{AsRefStr, Display, EnumCount, EnumIter, IntoStaticStr}; pub type SkillSlots = [Option; Slot::COUNT]; @@ -90,23 +90,67 @@ impl Ability { } /// Skillbar slot. -#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, EnumCount, EnumIter)] +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + PartialOrd, + Ord, + Hash, + Display, + AsRefStr, + IntoStaticStr, + EnumCount, + EnumIter, +)] pub enum Slot { + #[strum(serialize = "Weapon 1")] Weapon1, + + #[strum(serialize = "Weapon 2")] Weapon2, + + #[strum(serialize = "Weapon 3")] Weapon3, + + #[strum(serialize = "Weapon 4")] Weapon4, + + #[strum(serialize = "Weapon 5")] Weapon5, + Heal, + + #[strum(serialize = "Utility 1")] Utility1, + + #[strum(serialize = "Utility 2")] Utility2, + + #[strum(serialize = "Utility 3")] Utility3, + Elite, + + #[strum(serialize = "Profession 1")] Profession1, + + #[strum(serialize = "Profession 2")] Profession2, + + #[strum(serialize = "Profession 3")] Profession3, + + #[strum(serialize = "Profession 4")] Profession4, + + #[strum(serialize = "Profession 5")] Profession5, + + #[strum(serialize = "Special Action")] SpecialAction, + Mount, } diff --git a/reffect_api/src/buff.rs b/reffect_api/src/buff.rs index bf14415..7cfd156 100644 --- a/reffect_api/src/buff.rs +++ b/reffect_api/src/buff.rs @@ -1,5 +1,5 @@ use std::collections::{BTreeMap, HashMap}; -use strum::{AsRefStr, Display}; +use strum::{AsRefStr, Display, IntoStaticStr}; pub type BuffMap = BTreeMap; @@ -77,7 +77,9 @@ pub struct BuffInfo { /// Category of the buff. /// /// Any category except for Boon and Condition is mapped to [`Category::Effect`]. -#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, AsRefStr, Display)] +#[derive( + Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Display, AsRefStr, IntoStaticStr, +)] pub enum Category { /// Buff is a Boon. Boon = 0, @@ -94,7 +96,7 @@ pub enum Category { } /// Stacking behavior of the buff. -#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Display, AsRefStr, IntoStaticStr)] pub enum Stacking { // Other/unknown stacking type. Other,