mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2026-01-22 10:20:24 +00:00
Add icons to the new menu (#482)
* Added test icons to layout, toggle visibility of icon based on submenu_id * disable icon container pane when menu is open * Add icons to 'layout.arc' * Add remaining icons to 'layout.arc' * Apply suggestions from code review Co-authored-by: jugeeya <jugeeya@live.com> * Incorporate feedback, remove deltas from formatting differences * Updated some icon textures, updated layout * Swapped x for check icon on selected toggles * Moved logic to collect submenu id's to app impl --------- Co-authored-by: Matthew Edell <edell.matthew@gmail.com> Co-authored-by: jugeeya <jugeeya@live.com>
This commit is contained in:
@@ -578,6 +578,23 @@ impl<'a> App<'a> {
|
||||
defaults_menu: serde_json::from_str(self.default_menu.1.clone().as_str()).unwrap(),
|
||||
}).unwrap()
|
||||
}
|
||||
|
||||
pub fn submenu_ids(&self) -> Vec<&str> {
|
||||
return self.menu_items
|
||||
.values()
|
||||
.flat_map(|multi_stateful_list| {
|
||||
multi_stateful_list
|
||||
.lists
|
||||
.iter()
|
||||
.flat_map(|sub_stateful_list| {
|
||||
sub_stateful_list
|
||||
.items
|
||||
.iter()
|
||||
.map(|submenu| submenu.submenu_id)
|
||||
})
|
||||
})
|
||||
.collect::<Vec<&str>>();
|
||||
}
|
||||
}
|
||||
|
||||
fn render_submenu_page<B: Backend>(f: &mut Frame<B>, app: &mut App, list_chunks: Vec<Rect>, help_chunk: Rect) {
|
||||
|
||||
Reference in New Issue
Block a user