mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
accelerator key fixes and fix camera on unpause
This commit is contained in:
parent
d974d14d1e
commit
5b766c8dc0
3 changed files with 8 additions and 1 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;
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ class EnterNameDlg extends GuiControl {
|
|||
var okbutton = new GuiButton(loadButtonImages("data/ui/common/ok"));
|
||||
okbutton.position = new Vector(163, 182);
|
||||
okbutton.extent = new Vector(78, 59);
|
||||
okbutton.accelerator = hxd.Key.ENTER;
|
||||
okbutton.pressedAction = (sender) -> {
|
||||
MarbleGame.canvas.popDialog(this);
|
||||
Settings.highscoreName = enterNameEdit.text.text;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ class ExitGameDlg extends GuiControl {
|
|||
noButton.extent = new Vector(83, 55);
|
||||
noButton.vertSizing = Bottom;
|
||||
noButton.horizSizing = Right;
|
||||
noButton.accelerator = hxd.Key.ESCAPE;
|
||||
noButton.pressedAction = noFunc;
|
||||
|
||||
var restartButton = new GuiButton(loadButtonImages("data/ui/common/restart"));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue