mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
Improvements to input descriptors being shown
This commit is contained in:
parent
e3e5f5f8a8
commit
1e1457c45c
@ -700,6 +700,8 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_extern.has_set_input_descriptors = true;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -484,6 +484,7 @@ struct global
|
|||||||
char gb_rom_path[PATH_MAX];
|
char gb_rom_path[PATH_MAX];
|
||||||
char bsx_rom_path[PATH_MAX];
|
char bsx_rom_path[PATH_MAX];
|
||||||
char sufami_rom_path[2][PATH_MAX];
|
char sufami_rom_path[2][PATH_MAX];
|
||||||
|
bool has_set_input_descriptors;
|
||||||
bool has_set_save_path;
|
bool has_set_save_path;
|
||||||
bool has_set_state_path;
|
bool has_set_state_path;
|
||||||
bool has_set_libretro_device[MAX_PLAYERS];
|
bool has_set_libretro_device[MAX_PLAYERS];
|
||||||
|
@ -442,6 +442,7 @@ static void config_set_defaults(void)
|
|||||||
g_settings.camera.allow = false;
|
g_settings.camera.allow = false;
|
||||||
|
|
||||||
g_settings.input.input_descriptor_label_show = input_descriptor_label_show;
|
g_settings.input.input_descriptor_label_show = input_descriptor_label_show;
|
||||||
|
|
||||||
rarch_assert(sizeof(g_settings.input.binds[0]) >= sizeof(retro_keybinds_1));
|
rarch_assert(sizeof(g_settings.input.binds[0]) >= sizeof(retro_keybinds_1));
|
||||||
rarch_assert(sizeof(g_settings.input.binds[1]) >= sizeof(retro_keybinds_rest));
|
rarch_assert(sizeof(g_settings.input.binds[1]) >= sizeof(retro_keybinds_rest));
|
||||||
memcpy(g_settings.input.binds[0], retro_keybinds_1, sizeof(retro_keybinds_1));
|
memcpy(g_settings.input.binds[0], retro_keybinds_1, sizeof(retro_keybinds_1));
|
||||||
@ -1531,6 +1532,9 @@ void config_load(void)
|
|||||||
g_settings.config_save_on_exit && g_settings.core_specific_config)
|
g_settings.config_save_on_exit && g_settings.core_specific_config)
|
||||||
config_save_file(g_extern.core_specific_config_path);
|
config_save_file(g_extern.core_specific_config_path);
|
||||||
|
|
||||||
|
/* Flush out some states that could have been set by core environment variables */
|
||||||
|
g_extern.has_set_input_descriptors = false;
|
||||||
|
|
||||||
if (!g_extern.block_config_read)
|
if (!g_extern.block_config_read)
|
||||||
{
|
{
|
||||||
config_set_defaults();
|
config_set_defaults();
|
||||||
|
@ -4537,10 +4537,13 @@ static bool setting_data_append_list_input_options(
|
|||||||
if (!keybind || keybind->meta)
|
if (!keybind || keybind->meta)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (g_settings.input.input_descriptor_label_show)
|
if (
|
||||||
|
g_settings.input.input_descriptor_label_show
|
||||||
|
&& (i < RARCH_FIRST_CUSTOM_BIND)
|
||||||
|
&& (g_extern.has_set_input_descriptors)
|
||||||
|
)
|
||||||
snprintf(label, sizeof(label), "%s %s", buffer[player],
|
snprintf(label, sizeof(label), "%s %s", buffer[player],
|
||||||
g_extern.system.input_desc_btn[player][i]
|
g_extern.system.input_desc_btn[player][i] ? g_extern.system.input_desc_btn[player][i] : "N/A");
|
||||||
? g_extern.system.input_desc_btn[player][i] : keybind->desc);
|
|
||||||
else
|
else
|
||||||
snprintf(label, sizeof(label), "%s %s", buffer[player], keybind->desc);
|
snprintf(label, sizeof(label), "%s %s", buffer[player], keybind->desc);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user