mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
confirmation popups and fix sensitivity when zoom
This commit is contained in:
parent
2383e72115
commit
fa8848cbae
2 changed files with 17 additions and 2 deletions
|
|
@ -107,8 +107,13 @@ class CameraController extends Object {
|
|||
}
|
||||
|
||||
function orbit(mouseX:Float, mouseY:Float) {
|
||||
var deltaposX = mouseX;
|
||||
var deltaposY = mouseY * (Settings.controlsSettings.invertYAxis ? -1 : 1);
|
||||
var scaleFactor = 1.0;
|
||||
#if js
|
||||
scaleFactor = 1 / js.Browser.window.devicePixelRatio;
|
||||
#end
|
||||
|
||||
var deltaposX = mouseX * scaleFactor;
|
||||
var deltaposY = mouseY * (Settings.controlsSettings.invertYAxis ? -1 : 1) * scaleFactor;
|
||||
if (!Settings.controlsSettings.alwaysFreeLook && !Key.isDown(Settings.controlsSettings.freelook)) {
|
||||
deltaposY = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,6 +81,16 @@ class MarbleGame {
|
|||
var buttonCode = (e.keyCode);
|
||||
@:privateAccess Key.keyPressed[buttonCode] = -Key.getFrame();
|
||||
});
|
||||
|
||||
js.Browser.window.addEventListener('contextmenu', (e) -> e.preventDefault()); // Disable right click context menu for good
|
||||
|
||||
js.Browser.window.addEventListener('beforeunload', (e) -> {
|
||||
// Ask the user if they're sure about closing the tab if they're currently in game
|
||||
if (world != null) {
|
||||
e.preventDefault();
|
||||
e.returnValue = '';
|
||||
}
|
||||
});
|
||||
#end
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue