eslint controller modules

This commit is contained in:
Dante Ruiz 2017-11-01 11:36:36 -07:00
parent abb6f786fa
commit 66f07cb21b
15 changed files with 36 additions and 41 deletions

View file

@ -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 = {};
@ -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);
}
}

View file

@ -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);
}());

View file

@ -773,6 +773,6 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
disableDispatcherModule("LeftEquipEntity");
disableDispatcherModule("RightEquipEntity");
clearAttachPoints();
};
}
Script.scriptEnding.connect(cleanup);
}());

View file

@ -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",
@ -480,6 +479,6 @@ Script.include("/~/system/libraries/controllers.js");
rightFarActionGrabEntity.cleanup();
disableDispatcherModule("LeftFarActionGrabEntity");
disableDispatcherModule("RightFarActionGrabEntity");
};
}
Script.scriptEnding.connect(cleanup);
}());

View file

@ -99,6 +99,6 @@ Script.include("/~/system/libraries/controllers.js");
function cleanup() {
disableDispatcherModule("LeftFarTriggerEntity");
disableDispatcherModule("RightFarTriggerEntity");
};
}
Script.scriptEnding.connect(cleanup);
}());

View file

@ -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);
}());

View file

@ -261,6 +261,6 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
rightNearActionGrabEntity.cleanup();
disableDispatcherModule("LeftNearActionGrabEntity");
disableDispatcherModule("RightNearActionGrabEntity");
};
}
Script.scriptEnding.connect(cleanup);
}());

View file

@ -343,6 +343,6 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
rightNearParentingGrabEntity.cleanup();
disableDispatcherModule("LeftNearParentingGrabEntity");
disableDispatcherModule("RightNearParentingGrabEntity");
};
}
Script.scriptEnding.connect(cleanup);
}());

View file

@ -229,6 +229,6 @@ Script.include("/~/system/libraries/utils.js");
rightNearParentingGrabOverlay.cleanup();
disableDispatcherModule("LeftNearParentingGrabOverlay");
disableDispatcherModule("RightNearParentingGrabOverlay");
};
}
Script.scriptEnding.connect(cleanup);
}());

View file

@ -115,6 +115,6 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
rightNearTriggerEntity.cleanup();
disableDispatcherModule("LeftNearTriggerEntity");
disableDispatcherModule("RightNearTriggerEntity");
};
}
Script.scriptEnding.connect(cleanup);
}());

View file

@ -95,6 +95,6 @@ Script.include("/~/system/libraries/controllers.js");
function cleanup() {
disableDispatcherModule("LeftOverlayLaserInput");
disableDispatcherModule("RightOverlayLaserInput");
};
}
Script.scriptEnding.connect(cleanup);
}());

View file

@ -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");
@ -79,6 +78,6 @@
function cleanup() {
dispatcherUtils.disableDispatcherModule("LeftScaleAvatar");
dispatcherUtils.disableDispatcherModule("RightScaleAvatar");
};
}
Script.scriptEnding.connect(cleanup);
})();

View file

@ -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;
@ -101,6 +99,6 @@
function cleanup() {
dispatcherUtils.disableDispatcherModule("LeftScaleEntity");
dispatcherUtils.disableDispatcherModule("RightScaleEntity");
};
}
Script.scriptEnding.connect(cleanup);
})();

View file

@ -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");

View file

@ -60,7 +60,7 @@ Script.include("/~/system/libraries/controllers.js");
function cleanup() {
disableDispatcherModule("LeftWebEntityLaserInput");
disableDispatcherModule("RightWebEntityLaserInput");
};
}
Script.scriptEnding.connect(cleanup);
}());