@@ -2144,12 +2144,36 @@ static const char *current_hotkey(unsigned index)
21442144 }) [configuration .hotkey_actions [index - 2 ]];
21452145}
21462146
2147+ static void increase_rumble_strength (unsigned index )
2148+ {
2149+ if (configuration .rumble_strength < 8 ) {
2150+ configuration .rumble_strength ++ ;
2151+ }
2152+ }
2153+
2154+ static void decrease_rumble_strength (unsigned index )
2155+ {
2156+ if (configuration .rumble_strength > 1 ) {
2157+ configuration .rumble_strength -- ;
2158+ }
2159+ }
2160+
2161+ const char * current_rumble_strength (unsigned index )
2162+ {
2163+ static char ret [22 ];
2164+ strcpy (ret , TICKLESS_SLIDER_STRING );
2165+ unsigned pos = ((configuration .rumble_strength - 1 ) * (strlen (TICKLESS_SLIDER_STRING ) - 1 ) + 3 ) / 7 ;
2166+ ret [pos ] = SELECTED_SLIDER_STRING [pos ];
2167+ return ret ;
2168+ }
2169+
21472170static const struct menu_item joypad_menu [] = {
21482171 {"Joypad:" , cycle_joypads , current_joypad_name , cycle_joypads_backwards },
21492172 {"Configure layout" , detect_joypad_layout },
21502173 {"Hotkey 1 Action:" , cycle_hotkey , current_hotkey , cycle_hotkey_backwards },
21512174 {"Hotkey 2 Action:" , cycle_hotkey , current_hotkey , cycle_hotkey_backwards },
21522175 {"Rumble Mode:" , cycle_rumble_mode , current_rumble_mode , cycle_rumble_mode_backwards },
2176+ {"Rumble Strength:" , increase_rumble_strength , current_rumble_strength , decrease_rumble_strength },
21532177 {"Analog Stick Behavior:" , toggle_use_faux_analog_inputs , current_faux_analog_inputs , toggle_use_faux_analog_inputs },
21542178 {"Enable Control:" , toggle_allow_background_controllers , current_background_control_mode , toggle_allow_background_controllers },
21552179 {"Back" , enter_controls_menu },
0 commit comments