mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:58:51 +02:00
Fixed variable names.
Signed-off-by: Armored Dragon <publicmail@armoreddragon.com>
This commit is contained in:
parent
b27f24e4a9
commit
8dce22792b
1 changed files with 14 additions and 14 deletions
|
@ -11,10 +11,10 @@
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
// States ----
|
// States ----
|
||||||
let mouse_look_active = Settings.getValue("mouselook-active", false);
|
let mouseLookActive = Settings.getValue("mouselook-active", false);
|
||||||
let mouse_look_enabled = Camera.getMouseLook();
|
let mouseLookEnabled = Camera.getMouseLook();
|
||||||
let hmd_active = HMD.active;
|
let hmdActive = HMD.active;
|
||||||
let overlay_active = Desktop.isOverlayWindowFocused();
|
let overlayActive = Desktop.isOverlayWindowFocused();
|
||||||
|
|
||||||
// Resources ----
|
// Resources ----
|
||||||
let tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
let tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
|
@ -31,18 +31,18 @@
|
||||||
|
|
||||||
// Program ----
|
// Program ----
|
||||||
function onMouseLookChanged(newMouseLook) {
|
function onMouseLookChanged(newMouseLook) {
|
||||||
mouse_look_enabled = newMouseLook;
|
mouseLookEnabled = newMouseLook;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onKeyPressEvent(event) {
|
function onKeyPressEvent(event) {
|
||||||
// Toggle using the m key
|
// Toggle using the m key
|
||||||
if (event.text.toLowerCase() === "m") {
|
if (event.text.toLowerCase() === "m") {
|
||||||
if (Camera.captureMouse) {
|
if (Camera.captureMouse) {
|
||||||
mouse_look_active = false;
|
mouseLookActive = false;
|
||||||
Settings.setValue("mouselook-active", false);
|
Settings.setValue("mouselook-active", false);
|
||||||
disableMouseLook();
|
disableMouseLook();
|
||||||
} else {
|
} else {
|
||||||
mouse_look_active = true;
|
mouseLookActive = true;
|
||||||
Settings.setValue("mouselook-active", true);
|
Settings.setValue("mouselook-active", true);
|
||||||
enableMouseLook();
|
enableMouseLook();
|
||||||
}
|
}
|
||||||
|
@ -63,26 +63,26 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDisplayModeChanged() {
|
function onDisplayModeChanged() {
|
||||||
hmd_active = HMD.active;
|
hmdActive = HMD.active;
|
||||||
if (hmd_active) disableMouseLook();
|
if (hmdActive) disableMouseLook();
|
||||||
else enableMouseLook();
|
else enableMouseLook();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onUiFocusChanged(keyFocus) {
|
function onUiFocusChanged(keyFocus) {
|
||||||
if (keyFocus) {
|
if (keyFocus) {
|
||||||
overlay_active = true;
|
overlayActive = true;
|
||||||
disableMouseLook();
|
disableMouseLook();
|
||||||
} else {
|
} else {
|
||||||
overlay_active = false;
|
overlayActive = false;
|
||||||
enableMouseLook();
|
enableMouseLook();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function enableMouseLook() {
|
function enableMouseLook() {
|
||||||
if (hmd_active) return;
|
if (hmdActive) return;
|
||||||
if (tablet.tabletShown) return;
|
if (tablet.tabletShown) return;
|
||||||
if (overlay_active) return;
|
if (overlayActive) return;
|
||||||
if (!mouse_look_active) return; // Mouse look disabled via the hotkey
|
if (!mouseLookActive) return; // Mouse look disabled via the hotkey
|
||||||
|
|
||||||
Camera.captureMouse = true;
|
Camera.captureMouse = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue