mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-23 11:45:27 +00:00
Create generic_action_cheat_toggle
This commit is contained in:
parent
b28892bcf1
commit
bc323cc262
@ -59,17 +59,9 @@ static int shader_action_parameter_preset_left(unsigned type, const char *label,
|
||||
static int action_left_cheat(unsigned type, const char *label,
|
||||
bool wraparound)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
cheat_manager_t *cheat = global->cheat;
|
||||
size_t idx = type - MENU_SETTINGS_CHEAT_BEGIN;
|
||||
|
||||
if (!cheat)
|
||||
return -1;
|
||||
|
||||
cheat->cheats[idx].state = !cheat->cheats[idx].state;
|
||||
cheat_manager_update(cheat, idx);
|
||||
|
||||
return 0;
|
||||
return generic_action_cheat_toggle(idx, type, label,
|
||||
wraparound);
|
||||
}
|
||||
|
||||
static int action_left_input_desc(unsigned type, const char *label,
|
||||
|
@ -61,12 +61,11 @@ int shader_action_parameter_preset_right(unsigned type, const char *label,
|
||||
MENU_SETTINGS_SHADER_PRESET_PARAMETER_0);
|
||||
}
|
||||
|
||||
int action_right_cheat(unsigned type, const char *label,
|
||||
int generic_action_cheat_toggle(size_t idx, unsigned type, const char *label,
|
||||
bool wraparound)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
cheat_manager_t *cheat = global->cheat;
|
||||
size_t idx = type - MENU_SETTINGS_CHEAT_BEGIN;
|
||||
|
||||
if (!cheat)
|
||||
return -1;
|
||||
@ -77,6 +76,14 @@ int action_right_cheat(unsigned type, const char *label,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int action_right_cheat(unsigned type, const char *label,
|
||||
bool wraparound)
|
||||
{
|
||||
size_t idx = type - MENU_SETTINGS_CHEAT_BEGIN;
|
||||
return generic_action_cheat_toggle(idx, type, label,
|
||||
wraparound);
|
||||
}
|
||||
|
||||
int action_right_input_desc(unsigned type, const char *label,
|
||||
bool wraparound)
|
||||
{
|
||||
|
@ -38,6 +38,9 @@ int shader_action_parameter_right(unsigned type, const char *label, bool wraparo
|
||||
int shader_action_parameter_preset_right(unsigned type, const char *label,
|
||||
bool wraparound);
|
||||
|
||||
int generic_action_cheat_toggle(size_t idx, unsigned type, const char *label,
|
||||
bool wraparound);
|
||||
|
||||
int action_ok_push_generic_list(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user