Hook up more select function callbacks

This commit is contained in:
twinaphex 2015-06-06 20:40:17 +02:00
parent b9d7b4e52f
commit 1d1cd2d0f8
3 changed files with 27 additions and 3 deletions

View File

@ -35,6 +35,12 @@ extern char core_updater_path[PATH_MAX_LENGTH];
int core_setting_right(unsigned type, const char *label,
bool wraparound);
int action_right_input_desc(unsigned type, const char *label,
bool wraparound);
int action_right_cheat(unsigned type, const char *label,
bool wraparound);
/* End of function callbacks */
void menu_entries_common_load_content(bool persist);

View File

@ -66,7 +66,7 @@ static int shader_action_parameter_preset_right(unsigned type, const char *label
return 0;
}
static int action_right_cheat(unsigned type, const char *label,
int action_right_cheat(unsigned type, const char *label,
bool wraparound)
{
global_t *global = global_get_ptr();
@ -82,7 +82,7 @@ static int action_right_cheat(unsigned type, const char *label,
return 0;
}
static int action_right_input_desc(unsigned type, const char *label,
int action_right_input_desc(unsigned type, const char *label,
bool wraparound)
{
unsigned inp_desc_index_offset = type - MENU_SETTINGS_INPUT_DESC_BEGIN;

View File

@ -63,6 +63,18 @@ static int action_select_core_setting(const char *path, const char *label, unsig
return core_setting_right(type, label, true);
}
static int action_select_cheat(const char *path, const char *label, unsigned type,
size_t idx)
{
return action_right_cheat(type, label, true);
}
static int action_select_input_desc(const char *path, const char *label, unsigned type,
size_t idx)
{
return action_right_input_desc(type, label, true);
}
void menu_entries_cbs_init_bind_select(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
@ -73,7 +85,13 @@ void menu_entries_cbs_init_bind_select(menu_file_list_cbs_t *cbs,
cbs->action_select = action_select_default;
if ((type >= MENU_SETTINGS_CORE_OPTION_START))
if (type >= MENU_SETTINGS_CHEAT_BEGIN
&& type <= MENU_SETTINGS_CHEAT_END)
cbs->action_select = action_select_cheat;
else if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN
&& type <= MENU_SETTINGS_INPUT_DESC_END)
cbs->action_select = action_select_input_desc;
else if ((type >= MENU_SETTINGS_CORE_OPTION_START))
cbs->action_select = action_select_core_setting;
else
{