From 7c6de820966d36b53e25cf38bbf658d5d76dca00 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 4 Sep 2016 23:27:08 +0200 Subject: [PATCH] Cleanups --- menu/menu_displaylist.c | 3 ++- menu/menu_driver.c | 2 +- menu/menu_popup.c | 14 +++++++++++++- menu/menu_popup.h | 4 ++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 86547bdcc2..e2ccc2ec21 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -28,6 +28,7 @@ #include "menu_content.h" #include "menu_driver.h" #include "menu_navigation.h" +#include "menu_popup.h" #include "menu_cbs.h" #ifdef HAVE_LIBRETRODB @@ -4177,7 +4178,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) case DISPLAYLIST_HELP: menu_entries_append_enum(info->list, info->path, info->label, MSG_UNKNOWN, info->type, info->directory_ptr, 0); - menu->help_screen.push = false; + menu_popup_unset_pending_push(menu); break; case DISPLAYLIST_SETTING_ENUM: { diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 45758a05c0..5b7f484fb4 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -181,7 +181,7 @@ static bool menu_init(menu_handle_t *menu_data) && !string_is_empty(settings->path.bundle_assets_src) && !string_is_empty(settings->path.bundle_assets_dst) #ifdef IOS - && menu_data->help_screen.push + && menu_popup_is_push_pending(menu_data) #else && (settings->bundle_assets_extract_version_current != settings->bundle_assets_extract_last_version) diff --git a/menu/menu_popup.c b/menu/menu_popup.c index df52ce90ff..ee6575b26c 100644 --- a/menu/menu_popup.c +++ b/menu/menu_popup.c @@ -220,6 +220,18 @@ int menu_popup_iterate_help(menu_handle_t *menu, return 0; } +bool menu_popup_is_push_pending(menu_handle_t *menu) +{ + return menu->help_screen.push; +} + +void menu_popup_unset_pending_push(menu_handle_t *menu) +{ + if (!menu) + return; + menu->help_screen.push = false; +} + void menu_popup_push_pending(menu_handle_t *menu, bool push, enum menu_help_type type) { @@ -233,7 +245,7 @@ void menu_popup_push(menu_handle_t *menu) { menu_displaylist_info_t info = {0}; - if (!menu->help_screen.push) + if (!menu_popup_is_push_pending(menu)) return; info.list = menu_entries_get_menu_stack_ptr(0); diff --git a/menu/menu_popup.h b/menu/menu_popup.h index 6287d75a32..adb97dfa5b 100644 --- a/menu/menu_popup.h +++ b/menu/menu_popup.h @@ -32,6 +32,10 @@ void menu_popup_push_pending(menu_handle_t *menu, int menu_popup_iterate_help(menu_handle_t *menu, char *s, size_t len, const char *label); +void menu_popup_unset_pending_push(menu_handle_t *menu); + +bool menu_popup_is_push_pending(menu_handle_t *menu); + void menu_popup_push(menu_handle_t *menu); RETRO_END_DECLS