From e698587c4181f61e8ddefeccead48b0cc479d65d Mon Sep 17 00:00:00 2001 From: Melody Madeline Lyons Date: Sun, 30 Jun 2024 20:27:04 -0700 Subject: [PATCH] Add menu use se modal to item editor --- crates/ui/src/windows/items.rs | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/crates/ui/src/windows/items.rs b/crates/ui/src/windows/items.rs index e7d988de..9ad1adcf 100644 --- a/crates/ui/src/windows/items.rs +++ b/crates/ui/src/windows/items.rs @@ -23,18 +23,13 @@ // Program grant you additional permission to convey the resulting work. use luminol_components::UiExt; +use luminol_core::Modal; /// Database - Items management window. -#[derive(Default)] pub struct Window { - // ? Items ? selected_item_name: Option, - // ? Icon Graphic Picker ? - _icon_picker: Option, - - // ? Menu Sound Effect Picker ? - _menu_se_picker: Option, + menu_se_picker: luminol_modals::sound_picker::Modal, previous_item: Option, @@ -43,7 +38,21 @@ pub struct Window { impl Window { pub fn new() -> Self { - Default::default() + Self { + selected_item_name: None, + menu_se_picker: luminol_modals::sound_picker::Modal::new( + luminol_audio::Source::SE, + "Menu Use SE", + ), + previous_item: None, + view: luminol_components::DatabaseView::new(), + } + } +} + +impl Default for Window { + fn default() -> Self { + Self::new() } } @@ -183,7 +192,7 @@ impl luminol_core::Window for Window { modified |= columns[0] .add(luminol_components::Field::new( "Menu Use SE", - egui::Label::new("TODO"), + self.menu_se_picker.button(&mut item.menu_se, update_state), )) .changed();