mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
more gamepad fixes
This commit is contained in:
parent
d880cdd0ee
commit
3a06cee202
3 changed files with 13 additions and 2 deletions
|
|
@ -64,6 +64,8 @@ class CameraController extends Object {
|
||||||
|
|
||||||
var _ignoreCursor:Bool = false;
|
var _ignoreCursor:Bool = false;
|
||||||
|
|
||||||
|
var wasLastGamepadInput:Bool = false;
|
||||||
|
|
||||||
public function new(marble:Marble) {
|
public function new(marble:Marble) {
|
||||||
super();
|
super();
|
||||||
this.marble = marble;
|
this.marble = marble;
|
||||||
|
|
@ -141,6 +143,11 @@ class CameraController extends Object {
|
||||||
// CameraPitch += deltaposY * factor;
|
// CameraPitch += deltaposY * factor;
|
||||||
// CameraYaw += deltaposX * factor;
|
// CameraYaw += deltaposX * factor;
|
||||||
|
|
||||||
|
if (!isTouch)
|
||||||
|
wasLastGamepadInput = false;
|
||||||
|
else
|
||||||
|
wasLastGamepadInput = true;
|
||||||
|
|
||||||
nextCameraPitch = CameraPitch + deltaposY * factor;
|
nextCameraPitch = CameraPitch + deltaposY * factor;
|
||||||
nextCameraYaw = CameraYaw + deltaposX * factor;
|
nextCameraYaw = CameraYaw + deltaposX * factor;
|
||||||
|
|
||||||
|
|
@ -209,6 +216,10 @@ class CameraController extends Object {
|
||||||
var gamepadX = applyNonlinearScale(rescaleDeadZone(Gamepad.getAxis(Settings.gamepadSettings.cameraXAxis), Settings.gamepadSettings.axisDeadzone));
|
var gamepadX = applyNonlinearScale(rescaleDeadZone(Gamepad.getAxis(Settings.gamepadSettings.cameraXAxis), Settings.gamepadSettings.axisDeadzone));
|
||||||
var gamepadY = rescaleDeadZone(Gamepad.getAxis(Settings.gamepadSettings.cameraYAxis), Settings.gamepadSettings.axisDeadzone);
|
var gamepadY = rescaleDeadZone(Gamepad.getAxis(Settings.gamepadSettings.cameraYAxis), Settings.gamepadSettings.axisDeadzone);
|
||||||
|
|
||||||
|
if (gamepadX != 0.0 || gamepadY != 0.0) {
|
||||||
|
wasLastGamepadInput = true;
|
||||||
|
}
|
||||||
|
|
||||||
var cameraPitchDelta = (Key.isDown(Settings.controlsSettings.camBackward) ? 1 : 0)
|
var cameraPitchDelta = (Key.isDown(Settings.controlsSettings.camBackward) ? 1 : 0)
|
||||||
- (Key.isDown(Settings.controlsSettings.camForward) ? 1 : 0)
|
- (Key.isDown(Settings.controlsSettings.camForward) ? 1 : 0)
|
||||||
+ gamepadY;
|
+ gamepadY;
|
||||||
|
|
|
||||||
|
|
@ -315,7 +315,7 @@ class GuiMLTextListCtrl extends GuiControl {
|
||||||
onSelectedFunc(_prevSelected);
|
onSelectedFunc(_prevSelected);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hittestrect = this.getHitTestRect(false);
|
var hittestrect = this.getHitTestRect();
|
||||||
|
|
||||||
if (y < 0) {
|
if (y < 0) {
|
||||||
// Scroll up
|
// Scroll up
|
||||||
|
|
|
||||||
|
|
@ -303,7 +303,7 @@ class GuiTextListCtrl extends GuiControl {
|
||||||
onSelectedFunc(_prevSelected);
|
onSelectedFunc(_prevSelected);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hittestrect = this.getHitTestRect(false);
|
var hittestrect = this.getHitTestRect();
|
||||||
|
|
||||||
if (y < 0) {
|
if (y < 0) {
|
||||||
// Scroll up
|
// Scroll up
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue