Skip to content

Commit

Permalink
Adjust debug window
Browse files Browse the repository at this point in the history
  • Loading branch information
Zerthox committed Dec 10, 2024
1 parent c79a88e commit 4c5c74f
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 6 deletions.
2 changes: 1 addition & 1 deletion reffect/src/addon/ui/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
48 changes: 46 additions & 2 deletions reffect_api/src/ability.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use strum::{EnumCount, EnumIter};
use strum::{AsRefStr, Display, EnumCount, EnumIter, IntoStaticStr};

pub type SkillSlots = [Option<Ability>; Slot::COUNT];

Expand Down Expand Up @@ -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,
}
8 changes: 5 additions & 3 deletions reffect_api/src/buff.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::collections::{BTreeMap, HashMap};
use strum::{AsRefStr, Display};
use strum::{AsRefStr, Display, IntoStaticStr};

pub type BuffMap = BTreeMap<u32, Buff>;

Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 4c5c74f

Please sign in to comment.