coding standard fix

This commit is contained in:
Dante Ruiz 2017-01-07 00:38:39 +00:00
parent 07079ad78d
commit 7205215baa
2 changed files with 12 additions and 9 deletions

View file

@ -469,7 +469,8 @@ clickMapping.from(Controller.Standard.LeftSecondaryThumb).peek().to(function (cl
clickMapping.from(Controller.Standard.Start).peek().to(function (clicked) { clickMapping.from(Controller.Standard.Start).peek().to(function (clicked) {
if (clicked) { if (clicked) {
activeHudPoint2dGamePad(); activeHudPoint2dGamePad();
Messages.sendLocalMessage("toggleHand", -1); var noHands = -1;
Messages.sendLocalMessage("toggleHand", noHands);
} }
wantsMenu = clicked; wantsMenu = clicked;
@ -481,7 +482,8 @@ clickMapping.from(Controller.Hardware.Keyboard.RightMouseClicked).peek().to(func
// We don't want the system code to always do this for us, because, e.g., we do not want to get a mouseMove // We don't want the system code to always do this for us, because, e.g., we do not want to get a mouseMove
// after the Left/RightSecondaryThumb gives us a context menu. Only from the mouse. // after the Left/RightSecondaryThumb gives us a context menu. Only from the mouse.
Script.setTimeout(function () { Script.setTimeout(function () {
Messages.sendLocalMessage("toggleHand", -1); var noHands = -1;
Messages.sendLocalMessage("toggleHand", noHands);
Reticle.setPosition(Reticle.position); Reticle.setPosition(Reticle.position);
}, 0); }, 0);
}); });

View file

@ -22,7 +22,8 @@ var TABLET_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/Tablet-Model-v1-
// * position - position in front of the user // * position - position in front of the user
// * rotation - rotation of entity so it faces the user. // * rotation - rotation of entity so it faces the user.
function calcSpawnInfo(hand) { function calcSpawnInfo(hand) {
if (HMD.active && hand > 0) { var noHands = -1;
if (HMD.active && hand != noHands) {
var handController = getControllerWorldLocation(hand, false); var handController = getControllerWorldLocation(hand, false);
var front = Quat.getFront(handController.orientation); var front = Quat.getFront(handController.orientation);
var up = Quat.getUp(handController.orientation); var up = Quat.getUp(handController.orientation);
@ -34,7 +35,7 @@ function calcSpawnInfo(hand) {
}; };
} else { } else {
var front = Quat.getFront(MyAvatar.orientation); var front = Quat.getFront(MyAvatar.orientation);
var finalPosition = Vec3.sum(Vec3.sum(MyAvatar.position, Vec3.multiply(0.6, front)), {x: 0, y: 0.6, z: 0}) var finalPosition = Vec3.sum(Vec3.sum(MyAvatar.position, Vec3.multiply(0.6, front)), {x: 0, y: 0.6, z: 0});
return { return {
position: finalPosition, position: finalPosition,
rotation: Quat.lookAt(finalPosition, MyAvatar.getHeadPosition(), Y_AXIS) rotation: Quat.lookAt(finalPosition, MyAvatar.getHeadPosition(), Y_AXIS)
@ -118,13 +119,13 @@ WebTablet = function (url, width, dpi, hand, clientOnly) {
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
tablet.gotoHomeScreen(); tablet.gotoHomeScreen();
} }
} };
this.state = "idle"; this.state = "idle";
this.getRoot = function() { this.getRoot = function() {
return Entities.getWebViewRoot(_this.webEntityID); return Entities.getWebViewRoot(_this.webEntityID);
} };
this.getLocation = function() { this.getLocation = function() {
return Entities.getEntityProperties(_this.tabletEntityID, ["localPosition", "localRotation"]); return Entities.getEntityProperties(_this.tabletEntityID, ["localPosition", "localRotation"]);
@ -157,12 +158,12 @@ WebTablet.prototype.pickle = function () {
WebTablet.prototype.register = function() { WebTablet.prototype.register = function() {
Messages.subscribe("home"); Messages.subscribe("home");
Messages.messageReceived.connect(this.receive); Messages.messageReceived.connect(this.receive);
} };
WebTablet.prototype.unregister = function() { WebTablet.prototype.unregister = function() {
Messages.unsubscribe("home"); Messages.unsubscribe("home");
Messages.messageReceived.disconnect(this.receive); Messages.messageReceived.disconnect(this.receive);
} };
WebTablet.unpickle = function (string) { WebTablet.unpickle = function (string) {
if (!string) { if (!string) {
@ -175,4 +176,4 @@ WebTablet.unpickle = function (string) {
WebTablet.prototype.getPosition = function () { WebTablet.prototype.getPosition = function () {
return Overlays.getProperty(this.webOverlayID, "position"); return Overlays.getProperty(this.webOverlayID, "position");
} };