mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 07:53:52 +02:00
Use "Prefer Stylus Over Laser" setting
This commit is contained in:
parent
901af8896f
commit
efa6f1f02f
3 changed files with 17 additions and 4 deletions
scripts/system/controllers
|
@ -142,7 +142,10 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
};
|
||||
|
||||
this.isReady = function (controllerData) {
|
||||
if (this.processStylus(controllerData)) {
|
||||
var PREFER_STYLUS_OVER_LASER = "preferStylusOverLaser";
|
||||
var isUsingStylus = Settings.getValue(PREFER_STYLUS_OVER_LASER, false);
|
||||
|
||||
if (isUsingStylus && this.processStylus(controllerData)) {
|
||||
Pointers.enablePointer(this.pointer);
|
||||
return makeRunningValues(true, [], []);
|
||||
} else {
|
||||
|
|
|
@ -76,18 +76,28 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
}
|
||||
};
|
||||
|
||||
this.updateAllwaysOn = function () {
|
||||
var PREFER_STYLUS_OVER_LASER = "preferStylusOverLaser";
|
||||
this.parameters.handLaser.allwaysOn = !Settings.getValue(PREFER_STYLUS_OVER_LASER, false);
|
||||
};
|
||||
|
||||
this.isReady = function (controllerData) {
|
||||
var otherModuleRunning = this.getOtherModule().running;
|
||||
if ((this.isPointingAtOverlay(controllerData) || this.isPointingAtWebEntity(controllerData)) &&
|
||||
!otherModuleRunning) {
|
||||
return makeRunningValues(true, [], []);
|
||||
this.updateAllwaysOn();
|
||||
if (this.parameters.handLaser.allwaysOn || controllerData.triggerValues[this.hand] > TRIGGER_OFF_VALUE) {
|
||||
return makeRunningValues(true, [], []);
|
||||
}
|
||||
}
|
||||
return makeRunningValues(false, [], []);
|
||||
};
|
||||
|
||||
this.run = function (controllerData, deltaTime) {
|
||||
var grabModuleNeedsToRun = this.grabModuleWantsNearbyOverlay(controllerData);
|
||||
if ((controllerData.triggerValues[this.hand] > TRIGGER_OFF_VALUE || (this.isPointingAtOverlay(controllerData) || this.isPointingAtWebEntity(controllerData))) && !grabModuleNeedsToRun) {
|
||||
if (!grabModuleNeedsToRun && (controllerData.triggerValues[this.hand] > TRIGGER_OFF_VALUE
|
||||
|| this.parameters.handLaser.allwaysOn
|
||||
&& (this.isPointingAtOverlay(controllerData) || this.isPointingAtWebEntity(controllerData)))) {
|
||||
this.running = true;
|
||||
return makeRunningValues(true, [], []);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ var CONTOLLER_SCRIPTS = [
|
|||
"controllerModules/nearParentGrabOverlay.js",
|
||||
"controllerModules/nearActionGrabEntity.js",
|
||||
"controllerModules/farActionGrabEntity.js",
|
||||
//"controllerModules/stylusInput.js",
|
||||
"controllerModules/stylusInput.js",
|
||||
"controllerModules/equipEntity.js",
|
||||
"controllerModules/nearTrigger.js",
|
||||
"controllerModules/webSurfaceLaserInput.js",
|
||||
|
|
Loading…
Reference in a new issue