Rename "tool menu" to "tools menu"

This commit is contained in:
David Rowe 2017-08-23 09:41:46 +12:00
parent d6a23abb7c
commit 7051ff8f1f
2 changed files with 23 additions and 23 deletions

View file

@ -1,5 +1,5 @@
//
// toolMenu.js
// toolsMenu.js
//
// Created by David Rowe on 22 Jul 2017.
// Copyright 2017 High Fidelity, Inc.
@ -8,9 +8,9 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
/* global App, ToolMenu */
/* global App, ToolsMenu */
ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
// Tool menu displayed on top of forearm.
"use strict";
@ -1015,8 +1015,8 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
doCommand;
if (!this instanceof ToolMenu) {
return new ToolMenu();
if (!this instanceof ToolsMenu) {
return new ToolsMenu();
}
controlHand = side === LEFT_HAND ? rightInputs.hand() : leftInputs.hand();
@ -1674,7 +1674,7 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
break;
default:
App.log(side, "ERROR: ToolMenu: Unexpected command! " + command);
App.log(side, "ERROR: ToolsMenu: Unexpected command! " + command);
}
};
@ -1692,7 +1692,7 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
}
break;
default:
App.log(side, "ERROR: ToolMenu: Unexpected command! " + command);
App.log(side, "ERROR: ToolsMenu: Unexpected command! " + command);
}
}
@ -2009,7 +2009,7 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
if (handJointIndex === NONE) {
// Don't display if joint isn't available (yet) to attach to.
// User can clear this condition by toggling the app off and back on once avatar finishes loading.
App.log(side, "ERROR: ToolMenu: Hand joint index isn't available!");
App.log(side, "ERROR: ToolsMenu: Hand joint index isn't available!");
return;
}
@ -2125,4 +2125,4 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
};
};
ToolMenu.prototype = {};
ToolsMenu.prototype = {};

View file

@ -58,7 +58,7 @@
Laser,
Selection,
ToolIcon,
ToolMenu,
ToolsMenu,
// Miscellaneous
UPDATE_LOOP_TIMEOUT = 16,
@ -80,7 +80,7 @@
Script.include("./modules/laser.js");
Script.include("./modules/selection.js");
Script.include("./modules/toolIcon.js");
Script.include("./modules/toolMenu.js");
Script.include("./modules/toolsMenu.js");
Script.include("./modules/uit.js");
@ -196,7 +196,7 @@
// Tool menu and Create palette.
var // Primary objects.
toolMenu,
toolsMenu,
toolIcon,
createPalette,
@ -210,7 +210,7 @@
}
toolIcon = new ToolIcon(otherHand(side));
toolMenu = new ToolMenu(side, leftInputs, rightInputs, uiCommandCallback);
toolsMenu = new ToolsMenu(side, leftInputs, rightInputs, uiCommandCallback);
createPalette = new CreatePalette(side, leftInputs, rightInputs, uiCommandCallback);
getIntersection = side === LEFT_HAND ? rightInputs.intersection : leftInputs.intersection;
@ -218,7 +218,7 @@
function setHand(side) {
toolIcon.setHand(otherHand(side));
toolMenu.setHand(side);
toolsMenu.setHand(side);
createPalette.setHand(side);
getIntersection = side === LEFT_HAND ? rightInputs.intersection : leftInputs.intersection;
}
@ -233,17 +233,17 @@
function clearTool() {
toolIcon.clear();
toolMenu.clearTool();
toolsMenu.clearTool();
}
function setUIEntities() {
var uiEntityIDs = [].concat(toolMenu.entityIDs(), createPalette.entityIDs());
var uiEntityIDs = [].concat(toolsMenu.entityIDs(), createPalette.entityIDs());
leftInputs.setUIEntities(side === RIGHT_HAND ? uiEntityIDs : []);
rightInputs.setUIEntities(side === LEFT_HAND ? uiEntityIDs : []);
}
function display() {
toolMenu.display();
toolsMenu.display();
createPalette.display();
setUIEntities();
isDisplaying = true;
@ -254,21 +254,21 @@
if (isDisplaying) {
intersection = getIntersection();
toolMenu.update(intersection, grouping.groupsCount(), grouping.entitiesCount());
toolsMenu.update(intersection, grouping.groupsCount(), grouping.entitiesCount());
createPalette.update(intersection.overlayID);
toolIcon.update();
}
}
function doPickColor(color) {
toolMenu.doCommand("setColorFromPick", color);
toolsMenu.doCommand("setColorFromPick", color);
}
function clear() {
leftInputs.setUIEntities([]);
rightInputs.setUIEntities([]);
toolIcon.clear();
toolMenu.clear();
toolsMenu.clear();
createPalette.clear();
isDisplaying = false;
@ -279,9 +279,9 @@
createPalette.destroy();
createPalette = null;
}
if (toolMenu) {
toolMenu.destroy();
toolMenu = null;
if (toolsMenu) {
toolsMenu.destroy();
toolsMenu = null;
}
if (toolIcon) {
toolIcon.destroy();