Check if setting is enabled.

Signed-off-by: Armored Dragon <publicmail@armoreddragon.com>
This commit is contained in:
Armored Dragon 2024-07-12 16:01:45 -05:00
parent a651b6b978
commit e901cea8ef
No known key found for this signature in database
GPG key ID: C7207ACC3382AD8B

View file

@ -31,6 +31,7 @@
// Program ----
function onMouseLookChanged(newMouseLook) {
disableMouseLook();
mouseLookEnabled = newMouseLook;
}
@ -38,8 +39,6 @@
// Toggle using the m key
if (event.text.toLowerCase() === "m") {
if (Camera.captureMouse) {
mouseLookActive = false;
Settings.setValue("mouselook-active", false);
disableMouseLook();
} else {
mouseLookActive = true;
@ -82,12 +81,16 @@
if (hmdActive) return;
if (tablet.tabletShown) return;
if (overlayActive) return;
if (!mouseLookEnabled) return; // Mouse look disabled via setting
if (!mouseLookActive) return; // Mouse look disabled via the hotkey
Camera.captureMouse = true;
}
function disableMouseLook() {
mouseLookActive = false;
Settings.setValue("mouselook-active", false);
Camera.captureMouse = false;
}