forked from Clones/Controlify
🐛 fix rumble reported as unsupported if it's off
This commit is contained in:
@ -46,7 +46,7 @@ public interface Controller<S extends ControllerState, C extends ControllerConfi
|
||||
default void close() {}
|
||||
|
||||
RumbleManager rumbleManager();
|
||||
boolean canRumble();
|
||||
boolean supportsRumble();
|
||||
|
||||
Optional<ControllerHIDService.ControllerHIDInfo> hidInfo();
|
||||
|
||||
@ -104,7 +104,7 @@ public interface Controller<S extends ControllerState, C extends ControllerConfi
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRumble() {
|
||||
public boolean supportsRumble() {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@ -196,7 +196,7 @@ public interface Controller<S extends ControllerState, C extends ControllerConfi
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRumble() {
|
||||
public boolean supportsRumble() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
@ -1,7 +1,5 @@
|
||||
package dev.isxander.controlify.controller.gamepad;
|
||||
|
||||
import dev.isxander.controlify.InputMode;
|
||||
import dev.isxander.controlify.api.ControlifyApi;
|
||||
import dev.isxander.controlify.bindings.ControllerBindings;
|
||||
import dev.isxander.controlify.controller.AbstractController;
|
||||
import dev.isxander.controlify.controller.hid.ControllerHIDService;
|
||||
@ -83,7 +81,7 @@ public class GamepadController extends AbstractController<GamepadState, GamepadC
|
||||
|
||||
@Override
|
||||
public boolean setRumble(float strongMagnitude, float weakMagnitude, RumbleSource source) {
|
||||
if (!canRumble()) return false;
|
||||
if (!supportsRumble() || !config().allowVibrations) return false;
|
||||
|
||||
var strengthMod = config().getRumbleStrength(source);
|
||||
if (source != RumbleSource.MASTER)
|
||||
@ -96,9 +94,8 @@ public class GamepadController extends AbstractController<GamepadState, GamepadC
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRumble() {
|
||||
return drivers.rumbleDriver().isRumbleSupported()
|
||||
&& config().allowVibrations;
|
||||
public boolean supportsRumble() {
|
||||
return drivers.rumbleDriver().isRumbleSupported();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -148,7 +148,7 @@ public class CompoundJoystickController implements JoystickController<JoystickCo
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRumble() {
|
||||
public boolean supportsRumble() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ public class SingleJoystickController extends AbstractController<JoystickState,
|
||||
|
||||
@Override
|
||||
public boolean setRumble(float strongMagnitude, float weakMagnitude, RumbleSource source) {
|
||||
if (!canRumble()) return false;
|
||||
if (!supportsRumble()) return false;
|
||||
|
||||
var strengthMod = config().getRumbleStrength(source);
|
||||
if (source != RumbleSource.MASTER)
|
||||
@ -113,10 +113,8 @@ public class SingleJoystickController extends AbstractController<JoystickState,
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRumble() {
|
||||
return rumbleSupported
|
||||
&& config().allowVibrations
|
||||
&& ControlifyApi.get().currentInputMode() == InputMode.CONTROLLER;
|
||||
public boolean supportsRumble() {
|
||||
return rumbleSupported;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user