Add "group" bool button and icon

This commit is contained in:
David Rowe 2017-08-02 08:41:53 +12:00
parent f2cf2cab6e
commit 12d911f290
3 changed files with 18 additions and 1 deletions

View file

@ -17,10 +17,12 @@ ToolIcon = function (side) {
var SCALE_TOOL = 0, var SCALE_TOOL = 0,
CLONE_TOOL = 1, CLONE_TOOL = 1,
GROUP_TOOL = 2,
ICON_COLORS = [ ICON_COLORS = [
{ red: 0, green: 240, blue: 240 }, { red: 0, green: 240, blue: 240 },
{ red: 240, green: 0, blue: 240 } { red: 240, green: 0, blue: 240 },
{ red: 240, green: 240, blue: 0 }
], ],
LEFT_HAND = 0, LEFT_HAND = 0,
@ -100,6 +102,7 @@ ToolIcon = function (side) {
return { return {
SCALE_TOOL: SCALE_TOOL, SCALE_TOOL: SCALE_TOOL,
CLONE_TOOL: CLONE_TOOL, CLONE_TOOL: CLONE_TOOL,
GROUP_TOOL: GROUP_TOOL,
setHand: setHand, setHand: setHand,
update: update, update: update,
display: display, display: display,

View file

@ -86,6 +86,11 @@ ToolMenu = function (side, leftInputs, rightInputs, setToolCallback) {
position: { x: 0.06, y: 0.02, z: 0.0 }, position: { x: 0.06, y: 0.02, z: 0.0 },
color: { red: 240, green: 0, blue: 240 }, color: { red: 240, green: 0, blue: 240 },
callback: "clone" callback: "clone"
},
{ // Group
position: { x: 0.10, y: 0.02, z: 0.0 },
color: { red: 240, green: 240, blue: 0 },
callback: "group"
} }
], ],

View file

@ -25,6 +25,7 @@
TOOL_NONE = 0, TOOL_NONE = 0,
TOOL_SCALE = 1, TOOL_SCALE = 1,
TOOL_CLONE = 2, TOOL_CLONE = 2,
TOOL_GROUP = 3,
toolSelected = TOOL_NONE, toolSelected = TOOL_NONE,
// Primary objects // Primary objects
@ -261,6 +262,7 @@
clearToolIcon: clearToolIcon, clearToolIcon: clearToolIcon,
SCALE_TOOL: toolIcon.SCALE_TOOL, SCALE_TOOL: toolIcon.SCALE_TOOL,
CLONE_TOOL: toolIcon.CLONE_TOOL, CLONE_TOOL: toolIcon.CLONE_TOOL,
GROUP_TOOL: toolIcon.GROUP_TOOL,
display: display, display: display,
update: update, update: update,
clear: clear, clear: clear,
@ -1062,6 +1064,10 @@
toolSelected = TOOL_CLONE; toolSelected = TOOL_CLONE;
ui.setToolIcon(ui.CLONE_TOOL); ui.setToolIcon(ui.CLONE_TOOL);
break; break;
case "group":
toolSelected = TOOL_GROUP;
ui.setToolIcon(ui.GROUP_TOOL);
break;
default: default:
debug("ERROR: Unexpected condition in setTool()!"); debug("ERROR: Unexpected condition in setTool()!");
} }
@ -1110,6 +1116,9 @@
case TOOL_CLONE: case TOOL_CLONE:
ui.setToolIcon(ui.CLONE_TOOL); ui.setToolIcon(ui.CLONE_TOOL);
break; break;
case TOOL_GROUP:
ui.setToolIcon(ui.GROUP_TOOL);
break;
} }
if (isAppActive) { if (isAppActive) {