1
0
mirror of https://github.com/libretro/RetroArch synced 2025-03-02 19:13:34 +00:00

menu_entries_cbs.c - Code deduplication

This commit is contained in:
twinaphex 2015-01-20 08:57:32 +01:00
parent 120375dfe6
commit d5573aa2f7

@ -157,13 +157,6 @@ static int action_ok_load_state(const char *path,
return 0; return 0;
} }
static int action_ok_cheat(const char *path,
const char *label, unsigned type, size_t idx)
{
menu_input_key_start_line(driver.menu, "Input Cheat",
label, type, idx, menu_input_st_cheat_callback);
return 0;
}
static int action_ok_save_state(const char *path, static int action_ok_save_state(const char *path,
const char *label, unsigned type, size_t idx) const char *label, unsigned type, size_t idx)
@ -448,37 +441,44 @@ static int action_ok_shader_preset_load(const char *path,
#endif #endif
} }
static int action_ok_shader_preset_save_as(const char *path, static int action_ok_save_as_generic(const char *desc,
const char *label, unsigned type, size_t idx) const char *label, unsigned type, size_t idx,
input_keyboard_line_complete_t cb)
{ {
if (!driver.menu) if (!driver.menu)
return -1; return -1;
menu_input_key_start_line(driver.menu, "Preset Filename", menu_input_key_start_line(driver.menu, desc,
label, type, idx, menu_input_st_string_callback); label, type, idx, cb);
return 0; return 0;
} }
static int action_ok_cheat(const char *path,
const char *label, unsigned type, size_t idx)
{
return action_ok_save_as_generic("Input Cheat",
label, type, idx, menu_input_st_cheat_callback);
}
static int action_ok_shader_preset_save_as(const char *path,
const char *label, unsigned type, size_t idx)
{
return action_ok_save_as_generic("Preset Filename",
label, type, idx, menu_input_st_string_callback);
}
static int action_ok_cheat_file_save_as(const char *path, static int action_ok_cheat_file_save_as(const char *path,
const char *label, unsigned type, size_t idx) const char *label, unsigned type, size_t idx)
{ {
if (!driver.menu) return action_ok_save_as_generic("Cheat Filename",
return -1;
menu_input_key_start_line(driver.menu, "Cheat Filename",
label, type, idx, menu_input_st_string_callback); label, type, idx, menu_input_st_string_callback);
return 0;
} }
static int action_ok_remap_file_save_as(const char *path, static int action_ok_remap_file_save_as(const char *path,
const char *label, unsigned type, size_t idx) const char *label, unsigned type, size_t idx)
{ {
if (!driver.menu) return action_ok_save_as_generic("Remapping Filename",
return -1;
menu_input_key_start_line(driver.menu, "Remapping Filename",
label, type, idx, menu_input_st_string_callback); label, type, idx, menu_input_st_string_callback);
return 0;
} }
static int action_ok_path_use_directory(const char *path, static int action_ok_path_use_directory(const char *path,