mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-02-15 10:45:58 +00:00
accelerator key fixes and fix camera on unpause
This commit is contained in:
parent
57175a413c
commit
edf93f8edd
4 changed files with 8 additions and 3 deletions
|
|
@ -68,6 +68,8 @@ class CameraController extends Object {
|
|||
public var oob:Bool = false;
|
||||
public var finish:Bool = false;
|
||||
|
||||
var _ignoreCursor:Bool = false;
|
||||
|
||||
public function new(marble:Marble) {
|
||||
super();
|
||||
this.marble = marble;
|
||||
|
|
@ -88,6 +90,7 @@ class CameraController extends Object {
|
|||
var pointercontainer = js.Browser.document.querySelector("#pointercontainer");
|
||||
pointercontainer.hidden = true;
|
||||
#end
|
||||
_ignoreCursor = true;
|
||||
Window.getInstance().lockPointer((x, y) -> orbit(x, y));
|
||||
#if hl
|
||||
Cursor.show(false);
|
||||
|
|
@ -108,6 +111,10 @@ class CameraController extends Object {
|
|||
}
|
||||
|
||||
public function orbit(mouseX:Float, mouseY:Float, isTouch:Bool = false) {
|
||||
if (_ignoreCursor) {
|
||||
_ignoreCursor = false;
|
||||
return;
|
||||
}
|
||||
var scaleFactor = 1.0;
|
||||
#if js
|
||||
scaleFactor = 1 / js.Browser.window.devicePixelRatio;
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ class EnterNameDlg extends GuiControl {
|
|||
var okbutton = new GuiButton(loadButtonImages("data/ui/endgame/ok"));
|
||||
okbutton.position = new Vector(151, 184);
|
||||
okbutton.extent = new Vector(110, 55);
|
||||
okbutton.accelerator = hxd.Key.ENTER;
|
||||
okbutton.pressedAction = (sender) -> {
|
||||
MarbleGame.canvas.popDialog(this);
|
||||
Settings.highscoreName = enterNameEdit.text.text;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ class ExitGameDlg extends GuiControl {
|
|||
noButton.extent = new Vector(86, 40);
|
||||
noButton.vertSizing = Top;
|
||||
noButton.horizSizing = Right;
|
||||
noButton.accelerator = hxd.Key.ESCAPE;
|
||||
noButton.pressedAction = (sender) -> noFunc(noButton);
|
||||
|
||||
var restartButton = new GuiButton(loadButtonImages("data/ui/common/restart"));
|
||||
|
|
|
|||
|
|
@ -200,7 +200,6 @@ class PlayMissionGui extends GuiImage {
|
|||
var pmPrev = new GuiButton(loadButtonImages("data/ui/play/prev"));
|
||||
pmPrev.position = new Vector(436, 325);
|
||||
pmPrev.extent = new Vector(72, 43);
|
||||
pmPrev.accelerator = hxd.Key.LEFT;
|
||||
pmPrev.pressedAction = (sender) -> {
|
||||
setSelectedFunc(currentSelection - 1);
|
||||
}
|
||||
|
|
@ -222,7 +221,6 @@ class PlayMissionGui extends GuiImage {
|
|||
var pmNext = new GuiButton(loadButtonImages("data/ui/play/next"));
|
||||
pmNext.position = new Vector(604, 325);
|
||||
pmNext.extent = new Vector(72, 43);
|
||||
pmNext.accelerator = hxd.Key.RIGHT;
|
||||
pmNext.pressedAction = (sender) -> {
|
||||
setSelectedFunc(currentSelection + 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue