diff --git a/scripts/system/controllers/controllerDispatcher.js b/scripts/system/controllers/controllerDispatcher.js index 915d683724..933ca1e2b1 100644 --- a/scripts/system/controllers/controllerDispatcher.js +++ b/scripts/system/controllers/controllerDispatcher.js @@ -10,7 +10,8 @@ /* global Script, Entities, Overlays, Controller, Vec3, Quat, getControllerWorldLocation, RayPick, controllerDispatcherPlugins:true, controllerDispatcherPluginsNeedSort:true, LEFT_HAND, RIGHT_HAND, NEAR_GRAB_PICK_RADIUS, DEFAULT_SEARCH_SPHERE_DISTANCE, DISPATCHER_PROPERTIES, - getGrabPointSphereOffset, HMD, MyAvatar, Messages, findHandChildEntities + getGrabPointSphereOffset, HMD, MyAvatar, Messages, findHandChildEntities, Pointers, PickType, COLORS_GRAB_SEARCHING_HALF_SQUEEZE + COLORS_GRAB_SEARCHING_FULL_SQUEEZE, COLORS_GRAB_DISTANCE_HOLD, Picks */ controllerDispatcherPlugins = {}; @@ -157,7 +158,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js"); var handLaser = plugin.parameters.handLaser; if (handLaser !== undefined) { _this.laserVisibleStatus[handLaser] = false; - _this.laserLockStatus[handLaser] = false; + _this.laserLockStatus[handLaser] = false; } }; @@ -258,16 +259,16 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js"); // update left hand laser var HUD_LASER_OFFSET = 2; + var laserLocked; if (_this.laserVisibleStatus[LEFT_HAND]) { - var laserLocked = _this.laserLockStatus[LEFT_HAND]; + laserLocked = _this.laserLockStatus[LEFT_HAND]; _this.updateLaserRenderState(_this.leftControllerPointer,_this.leftTriggerClicked, laserLocked); } else { Pointers.setRenderState(_this.leftControllerPointer, ""); } - //update right hand laser if (_this.laserVisibleStatus[RIGHT_HAND]) { - var laserLocked = _this.laserLockStatus[RIGHT_HAND]; + laserLocked = _this.laserLockStatus[RIGHT_HAND]; _this.updateLaserRenderState(_this.rightControllerPointer, _this.rightTriggerClicked, laserLocked); } else { Pointers.setRenderState(_this.rightControllerPointer, ""); @@ -636,8 +637,6 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js"); } function mouseReleaseOnOverlay(overlayID, event) { if (overlayID === HMD.homeButtonID) { - print(JSON.stringify(event)); - print("---------> go home <--------"); Messages.sendLocalMessage("home", overlayID); } } diff --git a/scripts/system/controllers/controllerModules/disableOtherModule.js b/scripts/system/controllers/controllerModules/disableOtherModule.js index e873579ba7..0928b29d5d 100644 --- a/scripts/system/controllers/controllerModules/disableOtherModule.js +++ b/scripts/system/controllers/controllerModules/disableOtherModule.js @@ -73,13 +73,13 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js"); } } } - }; + } Messages.subscribe('Hifi-Hand-Disabler'); function cleanup() { disableDispatcherModule("LeftDisableModules"); disableDispatcherModule("RightDisableModules"); - }; + } Messages.messageReceived.connect(handleMessage); Script.scriptEnding.connect(cleanup); }()); diff --git a/scripts/system/controllers/controllerModules/equipEntity.js b/scripts/system/controllers/controllerModules/equipEntity.js index 7843f3a18a..b8c20d5bd6 100644 --- a/scripts/system/controllers/controllerModules/equipEntity.js +++ b/scripts/system/controllers/controllerModules/equipEntity.js @@ -773,6 +773,6 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa disableDispatcherModule("LeftEquipEntity"); disableDispatcherModule("RightEquipEntity"); clearAttachPoints(); - }; + } Script.scriptEnding.connect(cleanup); }()); diff --git a/scripts/system/controllers/controllerModules/farActionGrabEntity.js b/scripts/system/controllers/controllerModules/farActionGrabEntity.js index e0f8834e38..5403b4742f 100644 --- a/scripts/system/controllers/controllerModules/farActionGrabEntity.js +++ b/scripts/system/controllers/controllerModules/farActionGrabEntity.js @@ -14,14 +14,13 @@ PICK_MAX_DISTANCE, COLORS_GRAB_SEARCHING_HALF_SQUEEZE, COLORS_GRAB_SEARCHING_FULL_SQUEEZE, COLORS_GRAB_DISTANCE_HOLD, DEFAULT_SEARCH_SPHERE_DISTANCE, TRIGGER_OFF_VALUE, TRIGGER_ON_VALUE, ZERO_VEC, ensureDynamic, getControllerWorldLocation, projectOntoEntityXYPlane, ContextOverlay, HMD, Reticle, Overlays, isPointingAtUI - + Picks, makeLaserLockInfo */ Script.include("/~/system/libraries/controllerDispatcherUtils.js"); Script.include("/~/system/libraries/controllers.js"); (function() { - var PICK_WITH_HAND_RAY = true; var GRABBABLE_PROPERTIES = [ "position", "registrationPoint", @@ -249,7 +248,7 @@ Script.include("/~/system/libraries/controllers.js"); this.grabbedThingID = null; }; - this.updateRecommendedArea = function() { + this.updateRecommendedArea = function() { var dims = Controller.getViewportDimensions(); this.reticleMaxX = dims.x - MARGIN; this.reticleMaxY = dims.y - MARGIN; @@ -480,6 +479,6 @@ Script.include("/~/system/libraries/controllers.js"); rightFarActionGrabEntity.cleanup(); disableDispatcherModule("LeftFarActionGrabEntity"); disableDispatcherModule("RightFarActionGrabEntity"); - }; + } Script.scriptEnding.connect(cleanup); }()); diff --git a/scripts/system/controllers/controllerModules/farTrigger.js b/scripts/system/controllers/controllerModules/farTrigger.js index 4a4c83a9d2..24f336d581 100644 --- a/scripts/system/controllers/controllerModules/farTrigger.js +++ b/scripts/system/controllers/controllerModules/farTrigger.js @@ -99,6 +99,6 @@ Script.include("/~/system/libraries/controllers.js"); function cleanup() { disableDispatcherModule("LeftFarTriggerEntity"); disableDispatcherModule("RightFarTriggerEntity"); - }; + } Script.scriptEnding.connect(cleanup); }()); diff --git a/scripts/system/controllers/controllerModules/inEditMode.js b/scripts/system/controllers/controllerModules/inEditMode.js index cfa1f0a9e3..c4c53b4d97 100644 --- a/scripts/system/controllers/controllerModules/inEditMode.js +++ b/scripts/system/controllers/controllerModules/inEditMode.js @@ -10,7 +10,7 @@ /* global Script, Controller, RIGHT_HAND, LEFT_HAND, enableDispatcherModule, disableDispatcherModule, makeRunningValues, Messages, makeDispatcherModuleParameters, HMD, getGrabPointSphereOffset, COLORS_GRAB_SEARCHING_HALF_SQUEEZE, COLORS_GRAB_SEARCHING_FULL_SQUEEZE, COLORS_GRAB_DISTANCE_HOLD, DEFAULT_SEARCH_SPHERE_DISTANCE, TRIGGER_ON_VALUE, - getEnabledModuleByName, PICK_MAX_DISTANCE, isInEditMode, LaserPointers, RayPick + getEnabledModuleByName, PICK_MAX_DISTANCE, isInEditMode, LaserPointers, RayPick, Picks */ Script.include("/~/system/libraries/controllerDispatcherUtils.js"); @@ -128,7 +128,7 @@ Script.include("/~/system/libraries/utils.js"); rightHandInEditMode.cleanup(); disableDispatcherModule("LeftHandInEditMode"); disableDispatcherModule("RightHandInEditMode"); - }; + } Script.scriptEnding.connect(cleanup); }()); diff --git a/scripts/system/controllers/controllerModules/nearActionGrabEntity.js b/scripts/system/controllers/controllerModules/nearActionGrabEntity.js index 4fc192cc6b..147d6b807f 100644 --- a/scripts/system/controllers/controllerModules/nearActionGrabEntity.js +++ b/scripts/system/controllers/controllerModules/nearActionGrabEntity.js @@ -261,6 +261,6 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); rightNearActionGrabEntity.cleanup(); disableDispatcherModule("LeftNearActionGrabEntity"); disableDispatcherModule("RightNearActionGrabEntity"); - }; + } Script.scriptEnding.connect(cleanup); }()); diff --git a/scripts/system/controllers/controllerModules/nearParentGrabEntity.js b/scripts/system/controllers/controllerModules/nearParentGrabEntity.js index 1a5e82599d..ff20d0bbde 100644 --- a/scripts/system/controllers/controllerModules/nearParentGrabEntity.js +++ b/scripts/system/controllers/controllerModules/nearParentGrabEntity.js @@ -343,6 +343,6 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); rightNearParentingGrabEntity.cleanup(); disableDispatcherModule("LeftNearParentingGrabEntity"); disableDispatcherModule("RightNearParentingGrabEntity"); - }; + } Script.scriptEnding.connect(cleanup); }()); diff --git a/scripts/system/controllers/controllerModules/nearParentGrabOverlay.js b/scripts/system/controllers/controllerModules/nearParentGrabOverlay.js index 5333196bd0..fa0fe31de2 100644 --- a/scripts/system/controllers/controllerModules/nearParentGrabOverlay.js +++ b/scripts/system/controllers/controllerModules/nearParentGrabOverlay.js @@ -229,6 +229,6 @@ Script.include("/~/system/libraries/utils.js"); rightNearParentingGrabOverlay.cleanup(); disableDispatcherModule("LeftNearParentingGrabOverlay"); disableDispatcherModule("RightNearParentingGrabOverlay"); - }; + } Script.scriptEnding.connect(cleanup); }()); diff --git a/scripts/system/controllers/controllerModules/nearTrigger.js b/scripts/system/controllers/controllerModules/nearTrigger.js index a8aa72f1aa..42db3d6f61 100644 --- a/scripts/system/controllers/controllerModules/nearTrigger.js +++ b/scripts/system/controllers/controllerModules/nearTrigger.js @@ -115,6 +115,6 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js"); rightNearTriggerEntity.cleanup(); disableDispatcherModule("LeftNearTriggerEntity"); disableDispatcherModule("RightNearTriggerEntity"); - }; + } Script.scriptEnding.connect(cleanup); }()); diff --git a/scripts/system/controllers/controllerModules/overlayLaserInput.js b/scripts/system/controllers/controllerModules/overlayLaserInput.js index 6c9258ead7..3997dcaab1 100644 --- a/scripts/system/controllers/controllerModules/overlayLaserInput.js +++ b/scripts/system/controllers/controllerModules/overlayLaserInput.js @@ -95,6 +95,6 @@ Script.include("/~/system/libraries/controllers.js"); function cleanup() { disableDispatcherModule("LeftOverlayLaserInput"); disableDispatcherModule("RightOverlayLaserInput"); - }; + } Script.scriptEnding.connect(cleanup); }()); diff --git a/scripts/system/controllers/controllerModules/scaleAvatar.js b/scripts/system/controllers/controllerModules/scaleAvatar.js index de0434258c..8dbdb90824 100644 --- a/scripts/system/controllers/controllerModules/scaleAvatar.js +++ b/scripts/system/controllers/controllerModules/scaleAvatar.js @@ -8,7 +8,6 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html /* global Script, Vec3, MyAvatar, RIGHT_HAND */ -/* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */ (function () { var dispatcherUtils = Script.require("/~/system/libraries/controllerDispatcherUtils.js"); @@ -59,7 +58,7 @@ if (this.hand === dispatcherUtils.RIGHT_HAND) { var scalingCurrentDistance = Vec3.length(Vec3.subtract(controllerData.controllerLocations[this.hand].position, - controllerData.controllerLocations[this.otherHand()].position)); + controllerData.controllerLocations[this.otherHand()].position)); var newAvatarScale = (scalingCurrentDistance / this.scalingStartDistance) * this.scalingStartAvatarScale; MyAvatar.scale = newAvatarScale; @@ -79,6 +78,6 @@ function cleanup() { dispatcherUtils.disableDispatcherModule("LeftScaleAvatar"); dispatcherUtils.disableDispatcherModule("RightScaleAvatar"); - }; + } Script.scriptEnding.connect(cleanup); })(); diff --git a/scripts/system/controllers/controllerModules/scaleEntity.js b/scripts/system/controllers/controllerModules/scaleEntity.js index d45a4a5071..9d54eef98e 100644 --- a/scripts/system/controllers/controllerModules/scaleEntity.js +++ b/scripts/system/controllers/controllerModules/scaleEntity.js @@ -8,11 +8,9 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html /* global Script, Vec3, MyAvatar, RIGHT_HAND */ -/* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */ (function() { var dispatcherUtils = Script.require("/~/system/libraries/controllerDispatcherUtils.js"); - function ScaleEntity(hand) { this.hand = hand; this.grabbedThingID = false; @@ -81,7 +79,7 @@ if (this.hand === dispatcherUtils.RIGHT_HAND) { var scalingCurrentDistance = Vec3.length(Vec3.subtract(controllerData.controllerLocations[this.hand].position, - controllerData.controllerLocations[this.otherHand()].position)); + controllerData.controllerLocations[this.otherHand()].position)); var currentRescale = scalingCurrentDistance / this.scalingStartDistance; var newDimensions = Vec3.multiply(currentRescale, this.scalingStartDimensions); Entities.editEntity(this.grabbedThingID, { dimensions: newDimensions }); @@ -101,6 +99,6 @@ function cleanup() { dispatcherUtils.disableDispatcherModule("LeftScaleEntity"); dispatcherUtils.disableDispatcherModule("RightScaleEntity"); - }; + } Script.scriptEnding.connect(cleanup); })(); diff --git a/scripts/system/controllers/controllerModules/teleport.js b/scripts/system/controllers/controllerModules/teleport.js index c207ba56ae..6d6d93d640 100644 --- a/scripts/system/controllers/controllerModules/teleport.js +++ b/scripts/system/controllers/controllerModules/teleport.js @@ -12,7 +12,7 @@ /* global Script, Entities, MyAvatar, Controller, RIGHT_HAND, LEFT_HAND, getControllerJointIndex, enableDispatcherModule, disableDispatcherModule, Messages, makeDispatcherModuleParameters, makeRunningValues, Vec3, - LaserPointers, RayPick, HMD, Uuid, AvatarList + LaserPointers, RayPick, HMD, Uuid, AvatarList, Picks */ Script.include("/~/system/libraries/Xform.js"); @@ -109,8 +109,8 @@ Script.include("/~/system/libraries/controllers.js"); var teleportRenderStates = [{name: "cancel", path: cancelPath, end: cancelEnd}, - {name: "teleport", path: teleportPath, end: teleportEnd}, - {name: "seat", path: seatPath, end: seatEnd}]; + {name: "teleport", path: teleportPath, end: teleportEnd}, + {name: "seat", path: seatPath, end: seatEnd}]; var DEFAULT_DISTANCE = 50; var teleportDefaultRenderStates = [{name: "cancel", distance: DEFAULT_DISTANCE, path: cancelPath}]; @@ -127,18 +127,18 @@ Script.include("/~/system/libraries/controllers.js"); }; var TARGET = { - NONE: 'none', // Not currently targetting anything - INVISIBLE: 'invisible', // The current target is an invvsible surface - INVALID: 'invalid', // The current target is invalid (wall, ceiling, etc.) - SURFACE: 'surface', // The current target is a valid surface - SEAT: 'seat' // The current target is a seat + NONE: 'none', // Not currently targetting anything + INVISIBLE: 'invisible', // The current target is an invvsible surface + INVALID: 'invalid', // The current target is invalid (wall, ceiling, etc.) + SURFACE: 'surface', // The current target is a valid surface + SEAT: 'seat' // The current target is a seat }; function Teleporter(hand) { var _this = this; this.hand = hand; this.buttonValue = 0; - this.disabled = false; // used by the 'Hifi-Teleport-Disabler' message handler + this.disabled = false; // used by the 'Hifi-Teleport-Disabler' message handler this.active = false; this.state = TELEPORTER_STATES.IDLE; this.currentTarget = TARGET.INVALID; @@ -218,8 +218,8 @@ Script.include("/~/system/libraries/controllers.js"); seatEnd.dimensions = AVATAR_PROPORTIONAL_TARGET_MODEL_DIMENSIONS; teleportRenderStates = [{name: "cancel", path: cancelPath, end: cancelEnd}, - {name: "teleport", path: teleportPath, end: teleportEnd}, - {name: "seat", path: seatPath, end: seatEnd}]; + {name: "teleport", path: teleportPath, end: teleportEnd}, + {name: "seat", path: seatPath, end: seatEnd}]; LaserPointers.editRenderState(this.teleportRayHandVisible, "cancel", teleportRenderStates[0]); LaserPointers.editRenderState(this.teleportRayHandInvisible, "cancel", teleportRenderStates[0]); diff --git a/scripts/system/controllers/controllerModules/webEntityLaserInput.js b/scripts/system/controllers/controllerModules/webEntityLaserInput.js index 20bd272542..9b6e0cc4f7 100644 --- a/scripts/system/controllers/controllerModules/webEntityLaserInput.js +++ b/scripts/system/controllers/controllerModules/webEntityLaserInput.js @@ -60,7 +60,7 @@ Script.include("/~/system/libraries/controllers.js"); function cleanup() { disableDispatcherModule("LeftWebEntityLaserInput"); disableDispatcherModule("RightWebEntityLaserInput"); - }; + } Script.scriptEnding.connect(cleanup); }());