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,
|
static int action_left_cheat(unsigned type, const char *label,
|
||||||
bool wraparound)
|
bool wraparound)
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
cheat_manager_t *cheat = global->cheat;
|
|
||||||
size_t idx = type - MENU_SETTINGS_CHEAT_BEGIN;
|
size_t idx = type - MENU_SETTINGS_CHEAT_BEGIN;
|
||||||
|
return generic_action_cheat_toggle(idx, type, label,
|
||||||
if (!cheat)
|
wraparound);
|
||||||
return -1;
|
|
||||||
|
|
||||||
cheat->cheats[idx].state = !cheat->cheats[idx].state;
|
|
||||||
cheat_manager_update(cheat, idx);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_left_input_desc(unsigned type, const char *label,
|
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);
|
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)
|
bool wraparound)
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
cheat_manager_t *cheat = global->cheat;
|
cheat_manager_t *cheat = global->cheat;
|
||||||
size_t idx = type - MENU_SETTINGS_CHEAT_BEGIN;
|
|
||||||
|
|
||||||
if (!cheat)
|
if (!cheat)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -77,6 +76,14 @@ int action_right_cheat(unsigned type, const char *label,
|
||||||
return 0;
|
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,
|
int action_right_input_desc(unsigned type, const char *label,
|
||||||
bool wraparound)
|
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,
|
int shader_action_parameter_preset_right(unsigned type, const char *label,
|
||||||
bool wraparound);
|
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,
|
int action_ok_push_generic_list(const char *path,
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx);
|
const char *label, unsigned type, size_t idx, size_t entry_idx);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue