added the new multiple levels to the save/load

This commit is contained in:
grimsace
2026-04-28 10:13:06 -05:00
parent e2a14feb82
commit dddf27ea6b
2 changed files with 15 additions and 13 deletions
+6 -6
View File
@@ -9,14 +9,14 @@ use crate::ui::UiSettings;
#[derive(Serialize, Deserialize)]
pub struct DungeonSave {
pub settings: UiSettings,
pub layout: DungeonLayout,
pub svg: String,
pub layouts: Vec<DungeonLayout>,
pub svgs: Vec<String>,
}
pub fn save_dungeon(
settings: &UiSettings,
layout: &DungeonLayout,
svg: String,
layouts: Vec<DungeonLayout>,
svgs: Vec<String>,
) -> Result<PathBuf, String> {
let path = FileDialog::new()
.set_title("Save Dungeon State")
@@ -27,8 +27,8 @@ pub fn save_dungeon(
let save_data = DungeonSave {
settings: settings.clone(),
layout: layout.clone(),
svg,
layouts,
svgs,
};
let json = serde_json::to_string_pretty(&save_data)