tirbofish/dropbear · commit
6c5410e6bfea89331b287677c91650d748354fc8
quitting + loading docks from files :)
Signature present but could not be verified.
Unverified
@@ -1,5 +1,5 @@ [build] -jobs = 8 +jobs = 8 [profile.dev] opt-level = 0 @@ -12,7 +12,9 @@ anyhow = "1.0.98" ron = "0.10.1" chrono = "0.4.41" egui-toast = { git = "https://github.com/creativcoder/egui-toast" } -egui_dock = { git = "https://github.com/Adanos020/egui_dock" } +egui_dock = { git = "https://github.com/Adanos020/egui_dock", features = [ + "serde", +] } once_cell = "1.21" [dependencies.rhai] @@ -1,4 +1,4 @@ -use std::{collections::HashSet, path::PathBuf, str::FromStr, sync::Arc}; +use std::{collections::HashSet, path::PathBuf, sync::Arc}; use dropbear_engine::{ async_trait::async_trait, @@ -74,6 +74,21 @@ impl Editor { } } + pub fn save_project_config(&self) -> anyhow::Result<()> { + let mut config = PROJECT.write().unwrap(); + config.dock_layout = Some(self.dock_state.clone()); + let project_path = config.project_path.clone(); + config.write_to(&PathBuf::from(project_path)) + } + + pub fn load_project_config(&mut self) -> anyhow::Result<()> { + let config = PROJECT.read().unwrap(); + if let Some(layout) = &config.dock_layout {
Large diffs are not rendered by default. Showing the first 50 of 243 lines. Show full diff