Skip to content

Commit

Permalink
Add default custom reminders
Browse files Browse the repository at this point in the history
  • Loading branch information
Zerthox committed Feb 13, 2023
1 parent 946250e commit 85aaded
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 27 deletions.
25 changes: 0 additions & 25 deletions src/data/definitions.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,4 @@
{
// custom buff reminders
"reminders": [
{
"id": 9283,
"name": "Reinforced"
},

// fractal potions
{
"id": 32473,
"name": "Offensive",
"mode": "Fractal"
},
{
"id": 32134,
"name": "Defensive",
"mode": "Fractal"
},
{
"id": 33024,
"name": "Mobility",
"mode": "Fractal"
}
],

// food buff definitions
"food": [
{
Expand Down
22 changes: 22 additions & 0 deletions src/reminder/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,28 @@ pub struct CustomReminder {
pub mode: GameMode,
}

impl CustomReminder {
/// Creates a new custom reminder.
pub fn new(id: u32, name: impl Into<String>, mode: GameMode) -> Self {
Self {
id,
name: name.into(),
mode,
}
}

/// Returns the default custom reminders.
pub fn defaults() -> Vec<Self> {
vec![
Self::new(9283, "Reinforced", GameMode::All),
// fractal potions
Self::new(32473, "Offensive", GameMode::Fractal),
Self::new(32134, "Defensive", GameMode::Fractal),
Self::new(33024, "Mobility", GameMode::Fractal),
]
}
}

/// Game mode.
#[derive(
Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize,
Expand Down
4 changes: 2 additions & 2 deletions src/reminder/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ pub struct ReminderSettings {

impl ReminderSettings {
/// Creates new reminder settings with the defaults.
pub const fn new() -> Self {
pub fn new() -> Self {
Self {
food: true,
util: true,
custom: Vec::new(),
custom: CustomReminder::defaults(),
duration: Reminder::DEFAULT_DURATION,
position: 0.2,
only_bosses: true,
Expand Down

0 comments on commit 85aaded

Please sign in to comment.