Better names for overlay methods

This commit is contained in:
David Rowe 2017-09-02 19:24:37 +12:00
parent 9f9a0b0c58
commit d3819cfee3
4 changed files with 31 additions and 31 deletions

View file

@ -295,7 +295,7 @@ CreatePalette = function (side, leftInputs, rightInputs, uiCommandCallback) {
return (side + 1) % 2;
}
function getEntityIDs() {
function getOverlayIDs() {
return [palettePanelOverlay, paletteHeaderHeadingOverlay, paletteHeaderBarOverlay].concat(paletteItemOverlays);
}
@ -478,7 +478,7 @@ CreatePalette = function (side, leftInputs, rightInputs, uiCommandCallback) {
return {
setHand: setHand,
entityIDs: getEntityIDs, // TODO: Rename to overlayIDs.
overlayIDs: getOverlayIDs,
setVisible: setVisible,
update: update,
display: display,

View file

@ -47,7 +47,7 @@ Laser = function (side) {
LEFT_HAND = 0,
uiEntityIDs = [],
uiOverlayIDs = [],
intersection;
@ -140,8 +140,8 @@ Laser = function (side) {
Overlays.editOverlay(laserSphere, { visible: false });
}
function setUIEntities(entityIDs) {
uiEntityIDs = entityIDs;
function setUIOverlays(overlayIDs) {
uiOverlayIDs = overlayIDs;
}
function update(hand) {
@ -182,10 +182,10 @@ Laser = function (side) {
isLaserOn = true;
display(pickRay.origin, pickRay.direction, laserLength, true, hand.triggerClicked());
} else if (uiEntityIDs.length > 0) {
} else if (uiOverlayIDs.length > 0) {
// Special UI cursor.
intersection = Overlays.findRayIntersection(pickRay, PRECISION_PICKING, uiEntityIDs, NO_EXCLUDE_IDS,
intersection = Overlays.findRayIntersection(pickRay, PRECISION_PICKING, uiOverlayIDs, NO_EXCLUDE_IDS,
VISIBLE_ONLY);
if (intersection.intersects) {
intersection.laserIntersected = true;
@ -256,7 +256,7 @@ Laser = function (side) {
}
return {
setUIEntities: setUIEntities,
setUIOverlays: setUIOverlays,
update: update,
intersection: getIntersection,
setLength: setLength,

View file

@ -1907,7 +1907,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
setHand(side);
function getEntityIDs() {
function getOverlayIDs() {
return [menuPanelOverlay, menuHeaderOverlay].concat(menuOverlays).concat(optionsOverlays);
}
@ -3349,7 +3349,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
DELETE_TOOL: DELETE_TOOL,
iconInfo: getIconInfo,
setHand: setHand,
entityIDs: getEntityIDs, // TODO: Rename to overlayIDs.
overlayIDs: getOverlayIDs,
clearTool: clearTool,
doCommand: doCommand,
setVisible: setVisible,

View file

@ -134,8 +134,8 @@
laser = new Laser(side);
function setUIEntities(entityIDs) {
laser.setUIEntities(entityIDs);
function setUIOverlays(overlayIDs) {
laser.setUIOverlays(overlayIDs);
}
function getHand() {
@ -198,7 +198,7 @@
}
return {
setUIEntities: setUIEntities,
setUIOverlays: setUIOverlays,
hand: getHand,
laser: getLaser,
intersection: getIntersection,
@ -249,16 +249,16 @@
toolsMenu.clearTool();
}
function setUIEntities() {
var uiEntityIDs = [].concat(toolsMenu.entityIDs(), createPalette.entityIDs());
leftInputs.setUIEntities(side === RIGHT_HAND ? uiEntityIDs : []);
rightInputs.setUIEntities(side === LEFT_HAND ? uiEntityIDs : []);
function setUIOverlays() {
var uiOverlayIDs = [].concat(toolsMenu.overlayIDs(), createPalette.overlayIDs());
leftInputs.setUIOverlays(side === RIGHT_HAND ? uiOverlayIDs : []);
rightInputs.setUIOverlays(side === LEFT_HAND ? uiOverlayIDs : []);
}
function display() {
toolsMenu.display();
createPalette.display();
setUIEntities();
setUIOverlays();
isDisplaying = true;
}
@ -278,8 +278,8 @@
}
function clear() {
leftInputs.setUIEntities([]);
rightInputs.setUIEntities([]);
leftInputs.setUIOverlays([]);
rightInputs.setUIOverlays([]);
toolIcon.clear();
toolsMenu.clear();
createPalette.clear();
@ -318,7 +318,7 @@
DELETE_TOOL: toolsMenu.DELETE_TOOL,
display: display,
setVisible: setVisible,
updateUIEntities: setUIEntities,
updateUIOverlays: setUIOverlays,
doPickColor: doPickColor,
update: update,
clear: clear,
@ -900,7 +900,7 @@
toolSelected = TOOL_NONE;
grouping.clear();
ui.clearTool();
ui.updateUIEntities();
ui.updateUIOverlays();
}
}
@ -1419,20 +1419,20 @@
grouping.clear();
toolSelected = TOOL_SCALE;
ui.setToolIcon(ui.SCALE_TOOL);
ui.updateUIEntities();
ui.updateUIOverlays();
break;
case "cloneTool":
Feedback.play(dominantHand, Feedback.EQUIP_TOOL);
grouping.clear();
toolSelected = TOOL_CLONE;
ui.setToolIcon(ui.CLONE_TOOL);
ui.updateUIEntities();
ui.updateUIOverlays();
break;
case "groupTool":
Feedback.play(dominantHand, Feedback.EQUIP_TOOL);
toolSelected = TOOL_GROUP;
ui.setToolIcon(ui.GROUP_TOOL);
ui.updateUIEntities();
ui.updateUIOverlays();
break;
case "colorTool":
Feedback.play(dominantHand, Feedback.EQUIP_TOOL);
@ -1440,18 +1440,18 @@
toolSelected = TOOL_COLOR;
ui.setToolIcon(ui.COLOR_TOOL);
colorToolColor = parameter;
ui.updateUIEntities();
ui.updateUIOverlays();
break;
case "pickColorTool":
if (parameter) {
grouping.clear();
toolSelected = TOOL_PICK_COLOR;
ui.updateUIEntities();
ui.updateUIOverlays();
} else {
Feedback.play(dominantHand, Feedback.EQUIP_TOOL);
grouping.clear();
toolSelected = TOOL_COLOR;
ui.updateUIEntities();
ui.updateUIOverlays();
}
break;
case "physicsTool":
@ -1459,21 +1459,21 @@
grouping.clear();
toolSelected = TOOL_PHYSICS;
ui.setToolIcon(ui.PHYSICS_TOOL);
ui.updateUIEntities();
ui.updateUIOverlays();
break;
case "deleteTool":
Feedback.play(dominantHand, Feedback.EQUIP_TOOL);
grouping.clear();
toolSelected = TOOL_DELETE;
ui.setToolIcon(ui.DELETE_TOOL);
ui.updateUIEntities();
ui.updateUIOverlays();
break;
case "clearTool":
Feedback.play(dominantHand, Feedback.DROP_TOOL);
grouping.clear();
toolSelected = TOOL_NONE;
ui.clearTool();
ui.updateUIEntities();
ui.updateUIOverlays();
break;
case "groupButton":