v2.3.1: added a setting for vibration & improved vibration support logic

This commit is contained in:
Evan Debenham
2024-01-25 13:09:00 -05:00
parent b849ca58f0
commit f36dda3064
9 changed files with 147 additions and 72 deletions
@@ -84,8 +84,12 @@ public class ControllerHandler implements ControllerListener {
}
}
public static boolean vibrationSupported(){
return isControllerConnected() && Controllers.getCurrent().canVibrate();
}
public static void vibrate( int millis ){
if (Controllers.getCurrent().canVibrate()) {
if (vibrationSupported()) {
Controllers.getCurrent().startVibration(millis, 1f);
}
}