mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-16 17:00:13 +02:00
Change group tool's "Cancel" button to "Clear"
This commit is contained in:
parent
f58b2a3bed
commit
959d497079
4 changed files with 45 additions and 50 deletions
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="380px" height="82px" viewBox="0 0 380 82" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 45.2 (43514) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>CANCEL</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Group-Tool" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Group---Default---Locked-Buttons" transform="translate(-1573.000000, -2040.000000)" fill="#FFFFFF">
|
||||
<path d="M1607.78,2040.704 C1588.404,2040.704 1573.508,2055.04 1573.508,2081.136 C1573.508,2107.568 1587.62,2121.792 1608.228,2121.792 C1618.98,2121.792 1627.156,2117.088 1632.084,2112.048 L1624.468,2102.304 C1619.988,2105.776 1615.508,2108.8 1609.012,2108.8 C1598.372,2108.8 1590.868,2100.624 1590.868,2081.136 C1590.868,2060.976 1598.484,2053.136 1608.788,2053.136 C1614.164,2053.136 1618.644,2055.04 1622.9,2058.736 L1631.188,2049.104 C1624.804,2043.728 1618.084,2040.704 1607.78,2040.704 Z M1678.004,2102.64 L1653.7,2102.64 L1649.332,2120 L1632.196,2120 L1656.052,2042.496 L1676.1,2042.496 L1699.844,2120 L1682.372,2120 L1678.004,2102.64 Z M1674.868,2090.432 L1665.796,2054.704 L1656.836,2090.432 L1674.868,2090.432 Z M1765.476,2120 L1765.476,2042.496 L1750.58,2042.496 L1750.58,2076.544 C1750.58,2088.08 1752.036,2098.832 1752.82,2104.096 L1727.732,2042.496 L1707.012,2042.496 L1707.012,2120 L1721.908,2120 L1721.908,2089.872 C1721.908,2075.536 1720.564,2065.456 1719.668,2058.512 L1744.308,2120 L1765.476,2120 Z M1812.18,2040.704 C1792.804,2040.704 1777.908,2055.04 1777.908,2081.136 C1777.908,2107.568 1792.02,2121.792 1812.628,2121.792 C1823.38,2121.792 1831.556,2117.088 1836.484,2112.048 L1828.868,2102.304 C1824.388,2105.776 1819.908,2108.8 1813.412,2108.8 C1802.772,2108.8 1795.268,2100.624 1795.268,2081.136 C1795.268,2060.976 1802.884,2053.136 1813.188,2053.136 C1818.564,2053.136 1823.044,2055.04 1827.3,2058.736 L1835.588,2049.104 C1829.204,2043.728 1822.484,2040.704 1812.18,2040.704 Z M1890.244,2054.48 L1892.036,2042.496 L1845.78,2042.496 L1845.78,2120 L1892.26,2120 L1892.26,2107.904 L1862.244,2107.904 L1862.244,2086.512 L1886.66,2086.512 L1886.66,2074.64 L1862.244,2074.64 L1862.244,2054.48 L1890.244,2054.48 Z M1921.38,2106.784 L1921.38,2042.496 L1904.916,2042.496 L1904.916,2120 L1950.276,2120 L1952.068,2106.784 L1921.38,2106.784 Z" id="CANCEL"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 2.4 KiB |
11
scripts/vr-edit/assets/tools/group/clear-label.svg
Normal file
11
scripts/vr-edit/assets/tools/group/clear-label.svg
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="314" height="82" viewBox="0 0 314.00 82.00" enable-background="new 0 0 314.00 82.00" xml:space="preserve">
|
||||
<g>
|
||||
<path fill="#FFFFFF" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 36.1731,0.487495C 41.0867,0.487495 45.3687,1.1525 49.019,2.4825C 52.6693,3.8125 56.1712,5.8425 59.5246,8.5725L 51.2633,18.775C 46.9319,14.5517 42.2336,12.44 37.1686,12.44C 31.6611,12.44 27.3035,14.7121 24.0956,19.2562C 20.8878,23.8004 19.2838,30.92 19.2838,40.615C 19.2838,49.995 20.9052,56.9775 24.148,61.5625C 27.3908,66.1475 31.8067,68.44 37.3957,68.44C 40.3066,68.44 42.9148,67.8858 45.2202,66.7775C 47.5257,65.6692 50.0582,64.0767 52.8178,62L 60.4153,71.9575C 57.6674,74.8508 54.2616,77.2279 50.1979,79.0887C 46.1343,80.9496 41.6049,81.88 36.6097,81.88C 29.6817,81.88 23.6095,80.305 18.3931,77.155C 13.1767,74.005 9.13343,69.3762 6.26325,63.2687C 3.39307,57.1612 1.95798,49.7617 1.95798,41.07C 1.95798,32.6 3.44838,25.3112 6.42917,19.2037C 9.40997,13.0962 13.4707,8.45 18.6114,5.265C 23.7521,2.07999 29.606,0.487495 36.1731,0.487495 Z "/>
|
||||
<path fill="#FFFFFF" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 86.0198,66.2L 116.654,66.2L 114.856,79.64L 69.5847,79.64L 69.5847,1.8L 86.0198,1.8L 86.0198,66.2 Z "/>
|
||||
<path fill="#FFFFFF" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 170.972,13.56L 143.028,13.56L 143.028,34.0875L 167.392,34.0875L 167.392,46.04L 143.028,46.04L 143.028,67.6875L 172.981,67.6875L 172.981,79.64L 126.592,79.64L 126.592,1.6075L 172.754,1.6075L 170.972,13.56 Z "/>
|
||||
<path fill="#FFFFFF" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 222.391,61.72L 198.131,61.72L 193.783,79.0625L 176.666,79.0625L 200.489,1.24L 220.487,1.24L 244.188,79.0625L 226.758,79.0625L 222.391,61.72 Z M 219.265,49.7675L 210.2,13.7875L 201.153,49.7675L 219.265,49.7675 Z "/>
|
||||
<path fill="#FFFFFF" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 276.604,49.4L 268.221,49.4L 268.221,80.1825L 251.786,80.1825L 251.786,1.6075L 275.941,1.6075C 286.292,1.6075 294.076,3.55291 299.292,7.44375C 304.509,11.3346 307.117,17.2117 307.117,25.075C 307.117,30.29 305.888,34.5629 303.431,37.8937C 300.975,41.2246 297.138,44.0217 291.922,46.285L 311.815,80.1825L 293.144,80.1825L 276.604,49.4 Z M 268.221,37.4475L 276.831,37.4475C 281.221,37.4475 284.534,36.4529 286.769,34.4637C 289.005,32.4746 290.123,29.3392 290.123,25.0575C 290.123,21.0675 288.95,18.1537 286.603,16.3162C 284.257,14.4787 280.586,13.56 275.591,13.56L 268.221,13.56L 268.221,37.4475 Z "/>
|
||||
</g>
|
||||
</svg>
|
|
@ -1071,7 +1071,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
}
|
||||
},
|
||||
{
|
||||
id: "groupsSelectionBoxCancelButton",
|
||||
id: "clearGroupingButton",
|
||||
type: "button",
|
||||
properties: {
|
||||
dimensions: { x: 0.1042, y: 0.0400, z: UIT.dimensions.buttonDimensions.z },
|
||||
|
@ -1085,14 +1085,14 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
enabledColor: UIT.colors.greenHighlight,
|
||||
highlightColor: UIT.colors.greenShadow,
|
||||
label: {
|
||||
url: "../assets/tools/group/cancel-label.svg",
|
||||
scale: 0.0380,
|
||||
url: "../assets/tools/group/clear-label.svg",
|
||||
scale: 0.0314,
|
||||
color: UIT.colors.baseGray
|
||||
},
|
||||
labelEnabledColor: UIT.colors.white,
|
||||
enabled: false,
|
||||
command: {
|
||||
method: "cancelGroupSelectionBox"
|
||||
method: "clearGroupSelection"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -1999,8 +1999,10 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
|
||||
isGroupButtonEnabled,
|
||||
isUngroupButtonEnabled,
|
||||
isClearGroupingButtonEnabled,
|
||||
groupButtonIndex,
|
||||
ungroupButtonIndex,
|
||||
clearGroupingButtonIndex,
|
||||
|
||||
hsvControl = {
|
||||
hsv: { h: 0, s: 0, v: 0 },
|
||||
|
@ -2431,6 +2433,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
if (menuItem.toolOptions === "groupOptions") {
|
||||
optionsEnabled[groupButtonIndex] = false;
|
||||
optionsEnabled[ungroupButtonIndex] = false;
|
||||
optionsEnabled[clearGroupingButtonIndex] = false;
|
||||
}
|
||||
|
||||
isOptionsOpen = true;
|
||||
|
@ -2706,41 +2709,18 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
|
||||
case "toggleGroupSelectionBox":
|
||||
optionsToggles.groupSelectionBoxButton = !optionsToggles.groupSelectionBoxButton;
|
||||
|
||||
index = optionsOverlaysIDs.indexOf("groupSelectionBoxButton");
|
||||
Overlays.editOverlay(optionsOverlays[index], {
|
||||
color: optionsToggles.groupSelectionBoxButton
|
||||
? UI_ELEMENTS[optionsItems[index].type].onHoverColor
|
||||
: UI_ELEMENTS[optionsItems[index].type].offHoverColor
|
||||
});
|
||||
|
||||
index = optionsOverlaysIDs.indexOf("groupsSelectionBoxCancelButton");
|
||||
Overlays.editOverlay(optionsOverlays[index], {
|
||||
color: optionsToggles.groupSelectionBoxButton
|
||||
? optionsItems[index].enabledColor
|
||||
: optionsItems[index].properties.color
|
||||
});
|
||||
Overlays.editOverlay(optionsOverlaysLabels[index], {
|
||||
color: optionsToggles.groupSelectionBoxButton
|
||||
? optionsItems[index].labelEnabledColor
|
||||
: optionsItems[index].label.color
|
||||
});
|
||||
optionsEnabled[index] = optionsToggles.groupSelectionBoxButton;
|
||||
|
||||
uiCommandCallback("toggleGroupSelectionBoxTool", optionsToggles.groupSelectionBoxButton);
|
||||
break;
|
||||
|
||||
case "cancelGroupSelectionBox":
|
||||
case "clearGroupSelection":
|
||||
optionsToggles.groupSelectionBoxButton = false;
|
||||
|
||||
index = optionsOverlaysIDs.indexOf("groupSelectionBoxButton");
|
||||
Overlays.editOverlay(optionsOverlays[index], {
|
||||
color : optionsToggles.groupSelectionBoxButton
|
||||
? UI_ELEMENTS[optionsItems[index].type].onHoverColor
|
||||
: UI_ELEMENTS[optionsItems[index].type].offHoverColor
|
||||
});
|
||||
|
||||
index = optionsOverlaysIDs.indexOf("groupsSelectionBoxCancelButton");
|
||||
index = clearGroupingButtonIndex;
|
||||
Overlays.editOverlay(optionsOverlays[index], {
|
||||
color: optionsItems[index].properties.color
|
||||
});
|
||||
|
@ -2748,8 +2728,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
color: optionsItems[index].label.color
|
||||
});
|
||||
optionsEnabled[index] = false;
|
||||
|
||||
uiCommandCallback("cancelGroupSelectionBoxTool");
|
||||
uiCommandCallback("clearGroupSelectionTool");
|
||||
break;
|
||||
|
||||
case "setGravityOn":
|
||||
|
@ -2974,6 +2953,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
parameterValue,
|
||||
enableGroupButton,
|
||||
enableUngroupButton,
|
||||
enableClearGroupingButton,
|
||||
sliderProperties,
|
||||
overlayDimensions,
|
||||
basePoint,
|
||||
|
@ -3412,7 +3392,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
? OPTONS_PANELS.groupOptions[groupButtonIndex].labelEnabledColor
|
||||
: OPTONS_PANELS.groupOptions[groupButtonIndex].label.color
|
||||
});
|
||||
optionsEnabled[groupButtonIndex] = enableGroupButton;
|
||||
optionsEnabled[groupButtonIndex] = isGroupButtonEnabled;
|
||||
}
|
||||
|
||||
enableUngroupButton = groupsCount === 1 && entitiesCount > 1;
|
||||
|
@ -3430,7 +3410,23 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
? OPTONS_PANELS.groupOptions[ungroupButtonIndex].labelEnabledColor
|
||||
: OPTONS_PANELS.groupOptions[ungroupButtonIndex].label.color
|
||||
});
|
||||
optionsEnabled[ungroupButtonIndex] = enableUngroupButton;
|
||||
optionsEnabled[ungroupButtonIndex] = isUngroupButtonEnabled;
|
||||
}
|
||||
|
||||
enableClearGroupingButton = groupsCount > 0;
|
||||
if (enableClearGroupingButton !== isClearGroupingButtonEnabled) {
|
||||
isClearGroupingButtonEnabled = enableClearGroupingButton;
|
||||
Overlays.editOverlay(optionsOverlays[clearGroupingButtonIndex], {
|
||||
color: isClearGroupingButtonEnabled
|
||||
? optionsItems[clearGroupingButtonIndex].enabledColor
|
||||
: optionsItems[clearGroupingButtonIndex].properties.color
|
||||
});
|
||||
Overlays.editOverlay(optionsOverlaysLabels[clearGroupingButtonIndex], {
|
||||
color: isClearGroupingButtonEnabled
|
||||
? optionsItems[clearGroupingButtonIndex].labelEnabledColor
|
||||
: optionsItems[clearGroupingButtonIndex].label.color
|
||||
});
|
||||
optionsEnabled[clearGroupingButtonIndex] = isClearGroupingButtonEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3522,6 +3518,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
// Special handling for Group options.
|
||||
isGroupButtonEnabled = false;
|
||||
isUngroupButtonEnabled = false;
|
||||
isClearGroupingButtonEnabled = false;
|
||||
for (i = 0, length = OPTONS_PANELS.groupOptions.length; i < length; i += 1) {
|
||||
id = OPTONS_PANELS.groupOptions[i].id;
|
||||
if (id === "groupButton") {
|
||||
|
@ -3530,6 +3527,9 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
|
|||
if (id === "ungroupButton") {
|
||||
ungroupButtonIndex = i;
|
||||
}
|
||||
if (id === "clearGroupingButton") {
|
||||
clearGroupingButtonIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
isDisplaying = true;
|
||||
|
|
|
@ -1532,15 +1532,11 @@
|
|||
grouping.stopSelectInBox();
|
||||
}
|
||||
break;
|
||||
case "cancelGroupSelectionBoxTool":
|
||||
case "clearGroupSelectionTool":
|
||||
if (grouping.groupsCount() > 0) {
|
||||
Feedback.play(dominantHand, Feedback.SELECT_ENTITY);
|
||||
}
|
||||
if (toolSelected === TOOL_GROUP_BOX) {
|
||||
grouping.stopSelectInBox();
|
||||
}
|
||||
grouping.clear();
|
||||
toolSelected = TOOL_GROUP;
|
||||
break;
|
||||
|
||||
case "setColor":
|
||||
|
|
Loading…
Reference in a new issue