mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 07:20:36 +00:00
Create MENU_INPUT_CTL_BIND_SET_MIN_MAX
This commit is contained in:
parent
00a958edc2
commit
37d895d77b
@ -654,6 +654,16 @@ bool menu_input_ctl(enum menu_input_ctl_state state, void *data)
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case MENU_INPUT_CTL_BIND_SET_MIN_MAX:
|
||||
{
|
||||
menu_input_ctx_bind_limits_t *lim = (menu_input_ctx_bind_limits_t*)data;
|
||||
if (!lim || !menu_input)
|
||||
return false;
|
||||
|
||||
menu_input->binds.begin = lim->min;
|
||||
menu_input->binds.last = lim->max;
|
||||
}
|
||||
break;
|
||||
case MENU_INPUT_CTL_CHECK_INSIDE_HITBOX:
|
||||
{
|
||||
menu_input_ctx_hitbox_t *hitbox = (menu_input_ctx_hitbox_t*)data;
|
||||
@ -814,13 +824,6 @@ bool menu_input_ctl(enum menu_input_ctl_state state, void *data)
|
||||
|
||||
void menu_input_key_bind_set_min_max(unsigned min, unsigned max)
|
||||
{
|
||||
menu_input_t *menu_input = menu_input_get_ptr();
|
||||
|
||||
if (!menu_input)
|
||||
return;
|
||||
|
||||
menu_input->binds.begin = min;
|
||||
menu_input->binds.last = max;
|
||||
}
|
||||
|
||||
static int menu_input_mouse(unsigned *action)
|
||||
|
@ -94,6 +94,7 @@ enum menu_input_ctl_state
|
||||
MENU_INPUT_CTL_BIND_SINGLE,
|
||||
MENU_INPUT_CTL_BIND_ALL,
|
||||
MENU_INPUT_CTL_BIND_ITERATE,
|
||||
MENU_INPUT_CTL_BIND_SET_MIN_MAX,
|
||||
MENU_INPUT_CTL_START_LINE
|
||||
};
|
||||
|
||||
@ -120,14 +121,18 @@ typedef struct menu_input_ctx_line
|
||||
input_keyboard_line_complete_t cb;
|
||||
} menu_input_ctx_line_t;
|
||||
|
||||
typedef struct menu_input_ctx_bind_limits
|
||||
{
|
||||
unsigned min;
|
||||
unsigned max;
|
||||
} menu_input_ctx_bind_limits_t;
|
||||
|
||||
/* Keyboard input callbacks */
|
||||
void menu_input_st_uint_cb (void *userdata, const char *str);
|
||||
void menu_input_st_hex_cb (void *userdata, const char *str);
|
||||
void menu_input_st_string_cb(void *userdata, const char *str);
|
||||
void menu_input_st_cheat_cb (void *userdata, const char *str);
|
||||
|
||||
void menu_input_key_bind_set_min_max(unsigned min, unsigned max);
|
||||
|
||||
unsigned menu_input_frame_retropad(retro_input_t input, retro_input_t trigger_state);
|
||||
|
||||
void menu_input_post_iterate(int *ret, unsigned action);
|
||||
|
@ -2572,6 +2572,7 @@ static int setting_action_ok_bind_all_save_autoconfig(void *data, bool wraparoun
|
||||
static int setting_action_ok_bind_defaults(void *data, bool wraparound)
|
||||
{
|
||||
unsigned i;
|
||||
menu_input_ctx_bind_limits_t lim;
|
||||
struct retro_keybind *target = NULL;
|
||||
const struct retro_keybind *def_binds = NULL;
|
||||
rarch_setting_t *setting = (rarch_setting_t*)data;
|
||||
@ -2590,8 +2591,10 @@ static int setting_action_ok_bind_defaults(void *data, bool wraparound)
|
||||
if (!target)
|
||||
return -1;
|
||||
|
||||
menu_input_key_bind_set_min_max(
|
||||
MENU_SETTINGS_BIND_BEGIN, MENU_SETTINGS_BIND_LAST);
|
||||
lim.min = MENU_SETTINGS_BIND_BEGIN;
|
||||
lim.max = MENU_SETTINGS_BIND_LAST;
|
||||
|
||||
menu_input_ctl(MENU_INPUT_CTL_BIND_SET_MIN_MAX, &lim);
|
||||
|
||||
for (i = MENU_SETTINGS_BIND_BEGIN;
|
||||
i <= MENU_SETTINGS_BIND_LAST; i++, target++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user