(Menu) Create menu_entries_get_description

This commit is contained in:
twinaphex 2014-09-03 21:26:05 +02:00
parent a03d1475f9
commit 836124c217
3 changed files with 348 additions and 333 deletions

View File

@ -78,11 +78,14 @@ static int menu_info_screen_iterate(unsigned action)
setting_data_get_description(current_setting, msg, sizeof(msg));
else
{
const char *label = NULL;
unsigned info_type;
file_list_get_at_offset(driver.menu->selection_buf,
driver.menu->selection_ptr, NULL, NULL,
driver.menu->selection_ptr, NULL, &label,
&info_type);
if (menu_entries_get_description(label, msg, sizeof(msg)) == -1)
{
switch (info_type)
{
case MENU_SETTINGS_SHADER_PRESET:
@ -114,26 +117,6 @@ static int menu_info_screen_iterate(unsigned action)
"in the menu might not be correct."
);
break;
#if 0
case MENU_SETTINGS_SHADER_APPLY:
snprintf(msg, sizeof(msg),
" -- Apply Shader Changes. \n"
" \n"
"After changing shader settings, use this to \n"
"apply changes. \n"
" \n"
"Changing shader settings is a somewhat \n"
"expensive operation so it has to be \n"
"done explicitly. \n"
" \n"
"When you apply shaders, the menu shader \n"
"settings are saved to a temporary file (either \n"
"menu.cgp or menu.glslp) and loaded. The file \n"
"persists after RetroArch exits. The file is \n"
"saved to Shader Directory."
);
break;
#endif
case MENU_SETTINGS_SHADER_PASSES:
snprintf(msg, sizeof(msg),
" -- Shader Passes. \n"
@ -431,6 +414,7 @@ static int menu_info_screen_iterate(unsigned action)
}
}
}
}
if (driver.video_data && driver.menu_ctx &&
driver.menu_ctx->render_messagebox)

View File

@ -840,3 +840,31 @@ void menu_entries_push(file_list_t *list,
menu_clear_navigation(driver.menu);
driver.menu->need_refresh = true;
}
int menu_entries_get_description(const char *label,
char *msg, size_t sizeof_msg)
{
if (!strcmp(label, "shader_apply_changes"))
{
snprintf(msg, sizeof_msg,
" -- Apply Shader Changes. \n"
" \n"
"After changing shader settings, use this to \n"
"apply changes. \n"
" \n"
"Changing shader settings is a somewhat \n"
"expensive operation so it has to be \n"
"done explicitly. \n"
" \n"
"When you apply shaders, the menu shader \n"
"settings are saved to a temporary file (either \n"
"menu.cgp or menu.glslp) and loaded. The file \n"
"persists after RetroArch exits. The file is \n"
"saved to Shader Directory."
);
return 0;
}
return -1;
}

View File

@ -37,4 +37,7 @@ void menu_entries_pop(file_list_t *list);
void menu_flush_stack_type(file_list_t *list, unsigned final_type);
int menu_entries_get_description(const char *label, char *msg,
size_t sizeof_msg);
#endif