mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-17 16:47:14 -04:00
Fix[controls]: joystick sprint on lock
This commit is contained in:
parent
7b02277186
commit
f0e9f842ad
@ -39,7 +39,7 @@ public class ControlJoystick extends JoystickView implements ControlInterface {
|
||||
private int mCurrentDirectionInt = GamepadJoystick.DIRECTION_NONE;
|
||||
|
||||
// Directions keycode
|
||||
private final int[] mDirectionForwardLock = new int[]{LwjglGlfwKeycode.GLFW_KEY_W, LwjglGlfwKeycode.GLFW_KEY_LEFT_CONTROL};
|
||||
private final int[] mDirectionForwardLock = new int[]{LwjglGlfwKeycode.GLFW_KEY_LEFT_CONTROL};
|
||||
private final int[] mDirectionForward = new int[]{LwjglGlfwKeycode.GLFW_KEY_W};
|
||||
private final int[] mDirectionRight = new int[]{LwjglGlfwKeycode.GLFW_KEY_D};
|
||||
private final int[] mDirectionBackward = new int[]{LwjglGlfwKeycode.GLFW_KEY_S};
|
||||
@ -69,13 +69,7 @@ public class ControlJoystick extends JoystickView implements ControlInterface {
|
||||
|
||||
@Override
|
||||
public void onForwardLock(boolean isLocked) {
|
||||
mLastDirectionInt = mCurrentDirectionInt;
|
||||
mCurrentDirectionInt = DIRECTION_FORWARD_LOCK;
|
||||
|
||||
if(mLastDirectionInt != mCurrentDirectionInt){
|
||||
sendDirectionalKeycode(mLastDirectionInt, false);
|
||||
sendDirectionalKeycode(mCurrentDirectionInt, true);
|
||||
}
|
||||
sendInput(mDirectionForwardLock, isLocked);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user