mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2024-11-27 20:34:03 +00:00
Break if layout doesn't contain icon; switch current/all default load in menu (#511)
* Return to break if layout doesn't contain icon; switch current/all default load in menu * Update menu.rs * unwrap_or_else * fix * Update menu.rs * Updated save_state_slot_enable icon --------- Co-authored-by: Matthew Edell <edell.matthew@gmail.com>
This commit is contained in:
parent
b5735c54d7
commit
99da64d2a0
3 changed files with 11 additions and 24 deletions
|
@ -317,7 +317,7 @@ pub unsafe fn quick_menu_loop() {
|
||||||
received_input = true;
|
received_input = true;
|
||||||
});
|
});
|
||||||
button_presses.y.read_press().then(|| {
|
button_presses.y.read_press().then(|| {
|
||||||
app.reset_current_submenu();
|
app.reset_all_submenus();
|
||||||
received_input = true;
|
received_input = true;
|
||||||
});
|
});
|
||||||
button_presses.l.read_press().then(|| {
|
button_presses.l.read_press().then(|| {
|
||||||
|
@ -330,7 +330,7 @@ pub unsafe fn quick_menu_loop() {
|
||||||
if is_gcc {
|
if is_gcc {
|
||||||
app.next_tab();
|
app.next_tab();
|
||||||
} else {
|
} else {
|
||||||
app.reset_all_submenus();
|
app.reset_current_submenu();
|
||||||
}
|
}
|
||||||
received_input = true;
|
received_input = true;
|
||||||
});
|
});
|
||||||
|
@ -344,7 +344,7 @@ pub unsafe fn quick_menu_loop() {
|
||||||
if !is_gcc {
|
if !is_gcc {
|
||||||
app.next_tab();
|
app.next_tab();
|
||||||
} else {
|
} else {
|
||||||
app.reset_all_submenus();
|
app.reset_current_submenu();
|
||||||
}
|
}
|
||||||
received_input = true;
|
received_input = true;
|
||||||
});
|
});
|
||||||
|
|
Binary file not shown.
|
@ -112,13 +112,10 @@ unsafe fn render_submenu_page(app: &App, root_pane: &mut Pane) {
|
||||||
// Hide all icon images, and strategically mark the icon that
|
// Hide all icon images, and strategically mark the icon that
|
||||||
// corresponds with a particular button to be visible.
|
// corresponds with a particular button to be visible.
|
||||||
submenu_ids.iter().for_each(|id| {
|
submenu_ids.iter().for_each(|id| {
|
||||||
// TODO: Break if ID not found on release
|
menu_button
|
||||||
let icon = menu_button
|
.find_pane_by_name_recursive(id)
|
||||||
.find_pane_by_name_recursive(id);
|
.unwrap_or_else(|| panic!("Unable to find icon {} in layout.arc", id))
|
||||||
if let Some(icon) = icon {
|
|
||||||
icon
|
|
||||||
.set_visible(id == &submenu.submenu_id);
|
.set_visible(id == &submenu.submenu_id);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
menu_button
|
menu_button
|
||||||
|
@ -195,20 +192,10 @@ unsafe fn render_toggle_page(app: &App, root_pane: &mut Pane) {
|
||||||
let submenu_ids = app.submenu_ids();
|
let submenu_ids = app.submenu_ids();
|
||||||
|
|
||||||
submenu_ids.iter().for_each(|id| {
|
submenu_ids.iter().for_each(|id| {
|
||||||
// TODO: Break if ID not found on release
|
menu_button
|
||||||
|
.find_pane_by_name_recursive(id)
|
||||||
let icon = menu_button
|
.unwrap_or_else(|| panic!("Unable to find icon {} in layout.arc", id))
|
||||||
|
|
||||||
.find_pane_by_name_recursive(id);
|
|
||||||
|
|
||||||
if let Some(icon) = icon {
|
|
||||||
|
|
||||||
icon
|
|
||||||
|
|
||||||
.set_visible(false);
|
.set_visible(false);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
title_text.set_text_string(name);
|
title_text.set_text_string(name);
|
||||||
|
@ -431,9 +418,9 @@ pub unsafe fn draw(root_pane: &mut Pane) {
|
||||||
|
|
||||||
let (left_tab_key, right_tab_key, save_defaults_key, reset_current_key, reset_all_key) =
|
let (left_tab_key, right_tab_key, save_defaults_key, reset_current_key, reset_all_key) =
|
||||||
if is_gcc {
|
if is_gcc {
|
||||||
(l_key, r_key, x_key, y_key, z_key)
|
(l_key, r_key, x_key, z_key, y_key)
|
||||||
} else {
|
} else {
|
||||||
(zl_key, zr_key, x_key, y_key, r_key)
|
(zl_key, zr_key, x_key, r_key, y_key)
|
||||||
};
|
};
|
||||||
|
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in a new issue