From b6a2fbb82cc53525f11779b1bebac5bf68364f78 Mon Sep 17 00:00:00 2001 From: Lillian Vixe Date: Mon, 3 Jun 2024 15:47:29 -0700 Subject: [PATCH] fixed additions in structure mode. proof of selectable mode --- src/vvedit/s_editor_ui.rs | 45 +++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/src/vvedit/s_editor_ui.rs b/src/vvedit/s_editor_ui.rs index 3209e2b..67df208 100644 --- a/src/vvedit/s_editor_ui.rs +++ b/src/vvedit/s_editor_ui.rs @@ -504,6 +504,33 @@ pub fn edit_window_ui( } } }); + ui.collapsing("grid assets", |ui| { + // + for (id, _asset) in (&grid_assets).iter() { + let path = asset_server.get_path(id.untyped()); + if let Some(path) = path { + ui.label(path.to_string().as_str()); + } + } + }); + ui.collapsing("structure assets", |ui| { + ui.radio_value( + &mut shared_ui_state.selected_structure, + "".to_string(), + "Deselect", + ); + for (id, _asset) in (&structure_assets).iter() { + let path = asset_server.get_path(id.untyped()); + if let Some(path) = path { + //ui.label(path.to_string().as_str()); + ui.radio_value( + &mut shared_ui_state.selected_structure, + path.to_string(), + path.to_string().as_str(), + ); + } + } + }); let mut selected_structure = false; let mut selection = None; if shared_ui_state.selected_structure != "" { @@ -568,24 +595,6 @@ pub fn edit_window_ui( }) }); } - ui.collapsing("grid assets", |ui| { - // - for (id, _asset) in (&grid_assets).iter() { - let path = asset_server.get_path(id.untyped()); - if let Some(path) = path { - ui.label(path.to_string().as_str()); - } - } - }); - ui.collapsing("structure assets", |ui| { - // - for (id, _asset) in (&structure_assets).iter() { - let path = asset_server.get_path(id.untyped()); - if let Some(path) = path { - ui.label(path.to_string().as_str()); - } - } - }); if ui.button("Save Any Changes").clicked() { for each in &mut shared_ui_state.grids { if each.has_changed_since_last_save {