Skip to content

Commit 7524366

Browse files
sonninnosLibretroAdmin
authored andcommitted
Binds+remaps icon+label+order cleanup
1 parent a42f68c commit 7524366

6 files changed

Lines changed: 282 additions & 332 deletions

File tree

intl/msg_hash_us.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4165,7 +4165,7 @@ MSG_HASH(
41654165
)
41664166
MSG_HASH(
41674167
MENU_ENUM_LABEL_VALUE_INPUT_DEVICE_RESERVED_DEVICE_NAME,
4168-
"Reserved Device for This Player"
4168+
"Device Reserved for This Player"
41694169
)
41704170
MSG_HASH(
41714171
MENU_ENUM_SUBLABEL_INPUT_DEVICE_RESERVED_DEVICE_NAME,

menu/cbs/menu_cbs_deferred_push.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
684684
{MENU_ENUM_LABEL_DEFERRED_CPU_PERFPOWER_LIST, deferred_push_cpu_perfpower},
685685
{MENU_ENUM_LABEL_DEFERRED_CPU_POLICY_ENTRY, deferred_push_cpu_policy},
686686
#endif
687-
{MENU_ENUM_LABEL_DEFERRED_REMAPPINGS_PORT_LIST, deferred_push_remappings_port },
687+
{MENU_ENUM_LABEL_DEFERRED_REMAPPINGS_PORT_LIST, deferred_push_remappings_port},
688688
{MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_LIST, deferred_push_accounts_list},
689689
{MENU_ENUM_LABEL_CORE_LIST, deferred_push_core_list},
690690
{MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY, deferred_push_history_list},

menu/drivers/ozone.c

Lines changed: 40 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -2537,10 +2537,11 @@ static uintptr_t ozone_entries_icon_get_texture(
25372537
case MENU_SETTING_ACTION:
25382538
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_SETTING];
25392539
case MENU_SETTINGS_INPUT_LIBRETRO_DEVICE:
2540-
case MENU_SETTINGS_INPUT_INPUT_REMAP_PORT:
2541-
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_SETTING];
2540+
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_SETTINGS];
25422541
case MENU_SETTINGS_INPUT_ANALOG_DPAD_MODE:
25432542
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_ADC];
2543+
case MENU_SETTINGS_INPUT_INPUT_REMAP_PORT:
2544+
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_OVERRIDE];
25442545
}
25452546

25462547
#ifdef HAVE_CHEEVOS
@@ -2565,110 +2566,73 @@ static uintptr_t ozone_entries_icon_get_texture(
25652566
if ( type >= MENU_SETTINGS_INPUT_BEGIN
25662567
&& type <= MENU_SETTINGS_INPUT_DESC_KBD_END)
25672568
{
2569+
size_t enum_label_len = strlen(enum_label);
2570+
25682571
/* This part is only utilized by Input User # Binds */
2569-
unsigned input_id;
25702572
if (type < MENU_SETTINGS_INPUT_DESC_BEGIN)
25712573
{
2572-
input_id = MENU_SETTINGS_INPUT_BEGIN;
2573-
if (type == input_id)
2574-
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_ADC];
2575-
#ifdef HAVE_LIBNX
2576-
/* Account for the additional split JoyCon option in Input Port # Binds */
2577-
input_id++;
2578-
#endif
2579-
if (type >= input_id + 1 && type <= input_id + 3)
2574+
if ( string_ends_with_size(enum_label, "_joypad_index", enum_label_len, STRLEN_CONST("_joypad_index")))
25802575
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_SETTINGS];
2581-
if (type == input_id + 4)
2576+
else if (string_ends_with_size(enum_label, "_mouse_index", enum_label_len, STRLEN_CONST("_mouse_index")))
25822577
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_MOUSE];
2583-
if (type == input_id + 5)
2578+
else if (string_ends_with_size(enum_label, "_analog_dpad_mode", enum_label_len, STRLEN_CONST("_analog_dpad_mode")))
2579+
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_ADC];
2580+
else if (string_ends_with_size(enum_label, "_bind_all", enum_label_len, STRLEN_CONST("_bind_all")))
25842581
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BIND_ALL];
2585-
if (type == input_id + 6)
2582+
else if (string_ends_with_size(enum_label, "_bind_defaults", enum_label_len, STRLEN_CONST("_bind_defaults")))
25862583
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_RELOAD];
2587-
if (type == input_id + 7)
2584+
else if (string_ends_with_size(enum_label, "_save_autoconfig", enum_label_len, STRLEN_CONST("_save_autoconfig")))
25882585
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_SAVING];
2589-
if (type >= input_id + 32 && type <= input_id + 42)
2590-
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_LGUN];
2591-
if (type == input_id + 43)
2592-
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_TURBO];
2593-
if (type == input_id + 44)
2586+
else if (string_ends_with_size(enum_label, "_turbo", enum_label_len, STRLEN_CONST("_turbo"))
2587+
|| string_ends_with_size(enum_label, "_hold", enum_label_len, STRLEN_CONST("_hold")))
25942588
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_TURBO];
2595-
/* Align to use the same code of Quickmenu controls */
2596-
input_id = input_id + 8;
2597-
}
2598-
else
2599-
{
2600-
/* Quickmenu controls repeats the same icons for all users */
2601-
if (type < MENU_SETTINGS_INPUT_DESC_KBD_BEGIN)
2602-
input_id = MENU_SETTINGS_INPUT_DESC_BEGIN;
2603-
else
2604-
input_id = MENU_SETTINGS_INPUT_DESC_KBD_BEGIN;
2605-
while (type > (input_id + 23))
2606-
input_id = (input_id + 24);
2607-
2608-
/* Human readable bind order */
2609-
if (type < (input_id + RARCH_ANALOG_BIND_LIST_END))
2610-
{
2611-
unsigned index = 0;
2612-
int input_num = type - input_id;
2613-
for (index = 0; index < ARRAY_SIZE(input_config_bind_order); index++)
2614-
{
2615-
if (input_num == (int)input_config_bind_order[index])
2616-
{
2617-
type = input_id + index;
2618-
break;
2619-
}
2620-
}
2621-
}
2589+
else if (strstr(enum_label, "_gun_"))
2590+
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_LGUN];
2591+
else if (string_starts_with_size(enum_label, "input_device_reserv", STRLEN_CONST("input_device_reserv")))
2592+
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_OVERRIDE];
26222593
}
26232594

26242595
/* This is used for both Input Port Binds and Quickmenu controls */
2625-
if (type == input_id)
2596+
if ( string_ends_with_size(enum_label, "_up", enum_label_len, STRLEN_CONST("_up")))
26262597
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_DPAD_U];
2627-
if (type == (input_id + 1))
2598+
else if (string_ends_with_size(enum_label, "_down", enum_label_len, STRLEN_CONST("_down")))
26282599
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_DPAD_D];
2629-
if (type == (input_id + 2))
2600+
else if (string_ends_with_size(enum_label, "_left", enum_label_len, STRLEN_CONST("_left")))
26302601
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_DPAD_L];
2631-
if (type == (input_id + 3))
2602+
else if (string_ends_with_size(enum_label, "_right", enum_label_len, STRLEN_CONST("_right")))
26322603
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_DPAD_R];
2633-
if (type == (input_id + 4))
2604+
else if (string_ends_with_size(enum_label, "_b", enum_label_len, STRLEN_CONST("_b")))
26342605
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_D];
2635-
if (type == (input_id + 5))
2606+
else if (string_ends_with_size(enum_label, "_a", enum_label_len, STRLEN_CONST("_a")))
26362607
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_R];
2637-
if (type == (input_id + 6))
2608+
else if (string_ends_with_size(enum_label, "_y", enum_label_len, STRLEN_CONST("_y")))
26382609
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_L];
2639-
if (type == (input_id + 7))
2610+
else if (string_ends_with_size(enum_label, "_x", enum_label_len, STRLEN_CONST("_x")))
26402611
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_U];
2641-
if (type == (input_id + 8))
2612+
else if (string_ends_with_size(enum_label, "_select", enum_label_len, STRLEN_CONST("_select")))
26422613
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_SELECT];
2643-
if (type == (input_id + 9))
2614+
else if (string_ends_with_size(enum_label, "_start", enum_label_len, STRLEN_CONST("_start")))
26442615
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_START];
2645-
if (type == (input_id + 10))
2616+
else if (string_ends_with_size(enum_label, "_l", enum_label_len, STRLEN_CONST("_l")))
26462617
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_LB];
2647-
if (type == (input_id + 11))
2618+
else if (string_ends_with_size(enum_label, "_r", enum_label_len, STRLEN_CONST("_r")))
26482619
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_RB];
2649-
if (type == (input_id + 12))
2620+
else if (string_ends_with_size(enum_label, "_l2", enum_label_len, STRLEN_CONST("_l2")))
26502621
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_LT];
2651-
if (type == (input_id + 13))
2622+
else if (string_ends_with_size(enum_label, "_r2", enum_label_len, STRLEN_CONST("_r2")))
26522623
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_RT];
2653-
if (type == (input_id + 14))
2624+
else if (string_ends_with_size(enum_label, "_l3", enum_label_len, STRLEN_CONST("_l3")))
26542625
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_P];
2655-
if (type == (input_id + 15))
2626+
else if (string_ends_with_size(enum_label, "_r3", enum_label_len, STRLEN_CONST("_r3")))
26562627
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_P];
2657-
if (type == (input_id + 16))
2658-
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_U];
2659-
if (type == (input_id + 17))
2660-
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_D];
2661-
if (type == (input_id + 18))
2662-
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_L];
2663-
if (type == (input_id + 19))
2664-
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_R];
2665-
if (type == (input_id + 20))
2628+
2629+
else if (string_ends_with_size(enum_label, "_y_minus", enum_label_len, STRLEN_CONST("_y_minus")))
26662630
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_U];
2667-
if (type == (input_id + 21))
2631+
else if (string_ends_with_size(enum_label, "_y_plus", enum_label_len, STRLEN_CONST("_y_plus")))
26682632
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_D];
2669-
if (type == (input_id + 22))
2633+
else if (string_ends_with_size(enum_label, "_x_minus", enum_label_len, STRLEN_CONST("_x_minus")))
26702634
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_L];
2671-
if (type == (input_id + 23))
2635+
else if (string_ends_with_size(enum_label, "_x_plus", enum_label_len, STRLEN_CONST("_x_plus")))
26722636
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_R];
26732637
}
26742638

@@ -5997,10 +5961,9 @@ static void ozone_draw_entries(
59975961

59985962
MENU_ENTRY_INITIALIZE(entry);
59995963
entry.flags |= MENU_ENTRY_FLAG_RICH_LABEL_ENABLED
5964+
| MENU_ENTRY_FLAG_LABEL_ENABLED
60005965
| MENU_ENTRY_FLAG_VALUE_ENABLED
60015966
| MENU_ENTRY_FLAG_SUBLABEL_ENABLED;
6002-
if (ozone->flags & OZONE_FLAG_IS_CONTENTLESS_CORES)
6003-
entry.flags |= MENU_ENTRY_FLAG_LABEL_ENABLED;
60045967
menu_entry_get(&entry, 0, (unsigned)i, selection_buf, true);
60055968

60065969
if (entry.enum_idx == MENU_ENUM_LABEL_CHEEVOS_PASSWORD)

0 commit comments

Comments
 (0)