mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-18 09:07:48 -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;
|
private int mCurrentDirectionInt = GamepadJoystick.DIRECTION_NONE;
|
||||||
|
|
||||||
// Directions keycode
|
// 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[] mDirectionForward = new int[]{LwjglGlfwKeycode.GLFW_KEY_W};
|
||||||
private final int[] mDirectionRight = new int[]{LwjglGlfwKeycode.GLFW_KEY_D};
|
private final int[] mDirectionRight = new int[]{LwjglGlfwKeycode.GLFW_KEY_D};
|
||||||
private final int[] mDirectionBackward = new int[]{LwjglGlfwKeycode.GLFW_KEY_S};
|
private final int[] mDirectionBackward = new int[]{LwjglGlfwKeycode.GLFW_KEY_S};
|
||||||
@ -69,13 +69,7 @@ public class ControlJoystick extends JoystickView implements ControlInterface {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onForwardLock(boolean isLocked) {
|
public void onForwardLock(boolean isLocked) {
|
||||||
mLastDirectionInt = mCurrentDirectionInt;
|
sendInput(mDirectionForwardLock, isLocked);
|
||||||
mCurrentDirectionInt = DIRECTION_FORWARD_LOCK;
|
|
||||||
|
|
||||||
if(mLastDirectionInt != mCurrentDirectionInt){
|
|
||||||
sendDirectionalKeycode(mLastDirectionInt, false);
|
|
||||||
sendDirectionalKeycode(mCurrentDirectionInt, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user