From 835bbc6f6838bf3a87740151938fcafd80ce2a0d Mon Sep 17 00:00:00 2001 From: MrHuu Date: Sat, 3 Sep 2022 20:40:01 +0200 Subject: [PATCH] (3DS) Set bottom_asset directory default (#14376) - Fix default value while generating retroarch.cfg - Update 'Asset not found' error message --- configuration.c | 6 ++++++ gfx/drivers/ctr_gfx.c | 34 ++++++++++++++++++++++++++-------- intl/msg_hash_us.h | 2 +- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/configuration.c b/configuration.c index d109d9a605..a839d83255 100644 --- a/configuration.c +++ b/configuration.c @@ -3644,6 +3644,12 @@ static bool config_load_file(global_t *global, *settings->paths.directory_core_assets = '\0'; if (string_is_equal(settings->paths.directory_assets, "default")) *settings->paths.directory_assets = '\0'; +#ifdef _3DS + if (string_is_equal(settings->paths.directory_bottom_assets, "default")) + configuration_set_string(settings, + settings->paths.directory_bottom_assets, + g_defaults.dirs[DEFAULT_DIR_BOTTOM_ASSETS]); +#endif if (string_is_equal(settings->paths.directory_dynamic_wallpapers, "default")) *settings->paths.directory_dynamic_wallpapers = '\0'; if (string_is_equal(settings->paths.directory_thumbnails, "default")) diff --git a/gfx/drivers/ctr_gfx.c b/gfx/drivers/ctr_gfx.c index 53c946a36c..7147cfcbf1 100644 --- a/gfx/drivers/ctr_gfx.c +++ b/gfx/drivers/ctr_gfx.c @@ -503,8 +503,7 @@ static void bottom_menu_control(void* data, bool lcd_bottom) return; #endif - if ( !lcd_bottom - || ctr->bottom_menu == CTR_BOTTOM_MENU_NOT_AVAILABLE) + if (!lcd_bottom) { BIT64_SET(lifecycle_state, RARCH_MENU_TOGGLE); return; @@ -524,6 +523,13 @@ static void bottom_menu_control(void* data, bool lcd_bottom) fadeCount = 256; } + if (ctr->bottom_menu == CTR_BOTTOM_MENU_NOT_AVAILABLE) + { + BIT64_SET(lifecycle_state, RARCH_MENU_TOGGLE); + ctr->refresh_bottom_menu = true; + return; + } + switch (ctr->bottom_menu) { case CTR_BOTTOM_MENU_DEFAULT: @@ -700,14 +706,26 @@ static void ctr_render_bottom_screen(void *data) switch (ctr->bottom_menu) { case CTR_BOTTOM_MENU_NOT_AVAILABLE: - params.color = COLOR_ABGR(255, 255, 255, 255); - params.scale = 1.6f; - params.x = 0.0f; - params.y = 0.5f; + { + char str_path[PATH_MAX_LENGTH]; + const char *dir_assets = settings->paths.directory_bottom_assets; - font_driver_render_msg_bottom(ctr, - msg_hash_to_str(MSG_3DS_BOTTOM_MENU_ASSET_NOT_FOUND), + params.color = COLOR_ABGR(255, 255, 255, 255); + params.scale = 1.6f; + params.x = 0.0f; + params.y = 0.5f; + + font_driver_render_msg_bottom(ctr, + msg_hash_to_str(MSG_3DS_BOTTOM_MENU_ASSET_NOT_FOUND), + ¶ms); + + sprintf(str_path, "%s\n/bottom_menu.png", dir_assets); + + params.scale = 1.10f; + params.y -= 0.10f; + font_driver_render_msg_bottom(ctr, str_path, ¶ms); + } break; case CTR_BOTTOM_MENU_DEFAULT: params.color = COLOR_ABGR(255, 255, 255, 255); diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 9d3ae59e40..25ba6d3f7e 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -13861,7 +13861,7 @@ MSG_HASH( ) MSG_HASH( MSG_3DS_BOTTOM_MENU_ASSET_NOT_FOUND, - "bottom_menu.png not found\nin the assets/ctr folder" + "Asset(s) not found" ) MSG_HASH( MSG_3DS_BOTTOM_MENU_NO_STATE_DATA,