mirror of
https://github.com/libretro/RetroArch
synced 2025-02-27 09:41:14 +00:00
Add 'Hide Unbound Input Descriptor'
This commit is contained in:
parent
9374136a9b
commit
23569044ff
@ -640,6 +640,8 @@ static const bool input_autodetect_enable = true;
|
||||
* of the default ones. */
|
||||
static const bool input_descriptor_label_show = true;
|
||||
|
||||
static const bool input_descriptor_hide_unbound = false;
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
#include "intl/intl.h"
|
||||
|
||||
|
@ -379,6 +379,7 @@ struct settings
|
||||
|
||||
char autoconfig_dir[PATH_MAX];
|
||||
bool input_descriptor_label_show;
|
||||
bool input_descriptor_hide_unbound;
|
||||
} input;
|
||||
|
||||
struct
|
||||
|
@ -320,6 +320,9 @@
|
||||
# default ones.
|
||||
# input_descriptor_label_show = true
|
||||
|
||||
# Hide input descriptors that were not set by the core.
|
||||
# input_descriptor_hide_unbound = false
|
||||
|
||||
# Directory for joypad autoconfigs.
|
||||
# If a joypad is plugged in, that joypad will be autoconfigured if a config file
|
||||
# corresponding to that joypad is present in joypad_autoconfig_dir.
|
||||
|
@ -442,6 +442,7 @@ static void config_set_defaults(void)
|
||||
g_settings.camera.allow = false;
|
||||
|
||||
g_settings.input.input_descriptor_label_show = input_descriptor_label_show;
|
||||
g_settings.input.input_descriptor_hide_unbound = input_descriptor_hide_unbound;
|
||||
|
||||
rarch_assert(sizeof(g_settings.input.binds[0]) >= sizeof(retro_keybinds_1));
|
||||
rarch_assert(sizeof(g_settings.input.binds[1]) >= sizeof(retro_keybinds_rest));
|
||||
@ -1001,6 +1002,8 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
"netplay_client_swap_input");
|
||||
CONFIG_GET_BOOL(input.input_descriptor_label_show,
|
||||
"input_descriptor_label_show");
|
||||
CONFIG_GET_BOOL(input.input_descriptor_hide_unbound,
|
||||
"input_descriptor_hide_unbound");
|
||||
|
||||
for (i = 0; i < MAX_PLAYERS; i++)
|
||||
{
|
||||
@ -1565,6 +1568,8 @@ bool config_save_file(const char *path)
|
||||
g_settings.input.netplay_client_swap_input);
|
||||
config_set_bool(conf, "input_descriptor_label_show",
|
||||
g_settings.input.input_descriptor_label_show);
|
||||
config_set_bool(conf, "input_descriptor_hide_unbound",
|
||||
g_settings.input.input_descriptor_hide_unbound);
|
||||
config_set_bool(conf, "load_dummy_on_core_shutdown",
|
||||
g_settings.load_dummy_on_core_shutdown);
|
||||
config_set_bool(conf, "fps_show", g_settings.fps_show);
|
||||
|
@ -4321,6 +4321,18 @@ static bool setting_data_append_list_input_options(
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
|
||||
CONFIG_BOOL(
|
||||
g_settings.input.input_descriptor_hide_unbound,
|
||||
"input_descriptor_hide_unbound",
|
||||
"Hide Unbound Core Input Descriptors",
|
||||
input_descriptor_hide_unbound,
|
||||
"OFF",
|
||||
"ON",
|
||||
group_info.name,
|
||||
subgroup_info.name,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
|
||||
END_SUB_GROUP(list, list_info);
|
||||
|
||||
START_SUB_GROUP(
|
||||
@ -4529,6 +4541,7 @@ static bool setting_data_append_list_input_options(
|
||||
|
||||
for (i = 0; i < RARCH_BIND_LIST_END; i ++)
|
||||
{
|
||||
bool do_add = true;
|
||||
char label[PATH_MAX];
|
||||
char name[PATH_MAX];
|
||||
const struct input_bind_map* keybind =
|
||||
@ -4543,13 +4556,25 @@ static bool setting_data_append_list_input_options(
|
||||
&& (g_extern.has_set_input_descriptors)
|
||||
&& (i != RARCH_TURBO_ENABLE)
|
||||
)
|
||||
{
|
||||
if (g_extern.system.input_desc_btn[user][i])
|
||||
snprintf(label, sizeof(label), "%s %s", buffer[user],
|
||||
g_extern.system.input_desc_btn[user][i] ? g_extern.system.input_desc_btn[user][i] : "N/A");
|
||||
g_extern.system.input_desc_btn[user][i]);
|
||||
else
|
||||
{
|
||||
snprintf(label, sizeof(label), "%s %s", buffer[user], "N/A");
|
||||
|
||||
if (g_settings.input.input_descriptor_hide_unbound)
|
||||
do_add = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
snprintf(label, sizeof(label), "%s %s", buffer[user], keybind->desc);
|
||||
|
||||
snprintf(name, sizeof(name), "p%u_%s", user + 1, keybind->base);
|
||||
|
||||
if (do_add)
|
||||
{
|
||||
CONFIG_BIND(
|
||||
g_settings.input.binds[user][i],
|
||||
user + 1,
|
||||
@ -4561,6 +4586,7 @@ static bool setting_data_append_list_input_options(
|
||||
subgroup_info.name);
|
||||
settings_list_current_add_bind_type(list, list_info, i + MENU_SETTINGS_BIND_BEGIN);
|
||||
}
|
||||
}
|
||||
END_SUB_GROUP(list, list_info);
|
||||
}
|
||||
START_SUB_GROUP(
|
||||
|
Loading…
x
Reference in New Issue
Block a user