Skip to content

Commit

Permalink
Fixed scenes not (de)serializing correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
samclane committed Jan 13, 2025
1 parent cbecef0 commit 74cf121
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::{
device_info::DeviceInfo,
scenes::Scene,
shortcut::{KeyboardShortcutAction, ShortcutEdit},
HSBK32,
};

const DEFAULT_REFRESH_RATE_MS: u64 = 500;
Expand All @@ -22,7 +23,7 @@ pub struct Settings {
pub custom_shortcuts: Vec<KeyboardShortcutAction>,
pub refresh_rate_ms: u64,
pub follow_rate_ms: u64,
pub scenes: Vec<Scene>, // Add this line
pub scenes: Vec<Scene>,
}

impl Default for Settings {
Expand All @@ -31,7 +32,7 @@ impl Default for Settings {
custom_shortcuts: Vec::new(),
refresh_rate_ms: DEFAULT_REFRESH_RATE_MS,
follow_rate_ms: DEFAULT_FOLLOW_RATE_MS,
scenes: Vec::new(), // Initialize scenes
scenes: Vec::new(),
}
}
}
Expand All @@ -56,8 +57,8 @@ impl MantleApp {

self.render_add_shortcut_ui(ui);

ui.separator(); // Add separator
self.render_scenes_ui(ui); // Add this line
ui.separator();
self.render_scenes_ui(ui);
});

self.show_settings = show_settings;
Expand Down Expand Up @@ -379,7 +380,7 @@ impl MantleApp {
.color()
.cloned()
.unwrap_or_else(crate::color::default_hsbk);
((*device).clone(), color.into())
((*device).clone(), HSBK32::from(color))
})
.collect();
let scene = Scene {
Expand Down

0 comments on commit 74cf121

Please sign in to comment.