Style Physics options toggle buttons

This commit is contained in:
David Rowe 2017-08-30 20:47:33 +12:00
parent 42d2045bae
commit 5cf40fd208
7 changed files with 197 additions and 27 deletions

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="338px" height="48px" viewBox="0 0 338 48" 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>COLLISIONS</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Physics-Tool" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Physics---Default" transform="translate(-283.000000, -1323.000000)" fill="#FFFFFF">
<path d="M303.232,1323.688 C292.16,1323.688 283.648,1331.88 283.648,1346.792 C283.648,1361.896 291.712,1370.024 303.488,1370.024 C309.632,1370.024 314.304,1367.336 317.12,1364.456 L312.768,1358.888 C310.208,1360.872 307.648,1362.6 303.936,1362.6 C297.856,1362.6 293.568,1357.928 293.568,1346.792 C293.568,1335.272 297.92,1330.792 303.808,1330.792 C306.88,1330.792 309.44,1331.88 311.872,1333.992 L316.608,1328.488 C312.96,1325.416 309.12,1323.688 303.232,1323.688 Z M338.624,1323.688 C350.784,1323.688 358.272,1332.008 358.272,1346.856 C358.272,1361.384 350.784,1370.024 338.624,1370.024 C326.464,1370.024 318.912,1361.64 318.912,1346.856 C318.912,1332.392 326.464,1323.688 338.624,1323.688 Z M338.624,1330.728 C332.352,1330.728 328.832,1335.272 328.832,1346.856 C328.832,1358.44 332.48,1362.984 338.624,1362.984 C344.96,1362.984 348.352,1358.44 348.352,1346.856 C348.352,1335.272 344.96,1330.728 338.624,1330.728 Z M374.784,1361.448 L374.784,1324.712 L365.376,1324.712 L365.376,1369 L391.296,1369 L392.32,1361.448 L374.784,1361.448 Z M407.36,1361.448 L407.36,1324.712 L397.952,1324.712 L397.952,1369 L423.872,1369 L424.896,1361.448 L407.36,1361.448 Z M440,1369 L440,1324.712 L430.528,1324.712 L430.528,1369 L440,1369 Z M462.848,1323.688 C453.888,1323.688 447.36,1328.616 447.36,1336.168 C447.36,1342.888 451.2,1346.728 460.8,1349.736 C467.52,1351.784 469.248,1353.32 469.248,1356.84 C469.248,1360.744 466.176,1362.92 461.632,1362.92 C457.088,1362.92 453.504,1361.256 450.432,1358.44 L445.504,1363.816 C449.152,1367.4 454.528,1370.024 461.888,1370.024 C472.64,1370.024 479.04,1364.328 479.04,1356.2 C479.04,1348.008 473.92,1344.68 465.92,1342.12 C458.688,1339.88 457.024,1338.6 457.024,1335.528 C457.024,1332.392 459.648,1330.728 463.488,1330.728 C467.072,1330.728 470.144,1331.88 473.216,1334.504 L477.76,1329.256 C473.92,1325.672 469.44,1323.688 462.848,1323.688 Z M494.976,1369 L494.976,1324.712 L485.504,1324.712 L485.504,1369 L494.976,1369 Z M521.792,1323.688 C533.952,1323.688 541.44,1332.008 541.44,1346.856 C541.44,1361.384 533.952,1370.024 521.792,1370.024 C509.632,1370.024 502.08,1361.64 502.08,1346.856 C502.08,1332.392 509.632,1323.688 521.792,1323.688 Z M521.792,1330.728 C515.52,1330.728 512,1335.272 512,1346.856 C512,1358.44 515.648,1362.984 521.792,1362.984 C528.128,1362.984 531.52,1358.44 531.52,1346.856 C531.52,1335.272 528.128,1330.728 521.792,1330.728 Z M581.952,1369 L581.952,1324.712 L573.44,1324.712 L573.44,1344.168 C573.44,1350.76 574.272,1356.904 574.72,1359.912 L560.384,1324.712 L548.544,1324.712 L548.544,1369 L557.056,1369 L557.056,1351.784 C557.056,1343.592 556.288,1337.832 555.776,1333.864 L569.856,1369 L581.952,1369 Z M604.8,1323.688 C595.84,1323.688 589.312,1328.616 589.312,1336.168 C589.312,1342.888 593.152,1346.728 602.752,1349.736 C609.472,1351.784 611.2,1353.32 611.2,1356.84 C611.2,1360.744 608.128,1362.92 603.584,1362.92 C599.04,1362.92 595.456,1361.256 592.384,1358.44 L587.456,1363.816 C591.104,1367.4 596.48,1370.024 603.84,1370.024 C614.592,1370.024 620.992,1364.328 620.992,1356.2 C620.992,1348.008 615.872,1344.68 607.872,1342.12 C600.64,1339.88 598.976,1338.6 598.976,1335.528 C598.976,1332.392 601.6,1330.728 605.44,1330.728 C609.024,1330.728 612.096,1331.88 615.168,1334.504 L619.712,1329.256 C615.872,1325.672 611.392,1323.688 604.8,1323.688 Z" id="COLLISIONS"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="334px" height="48px" viewBox="0 0 334 48" 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>GRABBABLE</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Physics-Tool" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Physics---Default" transform="translate(-285.000000, -1683.000000)" fill="#FFFFFF">
<path d="M305.856,1683.688 C294.528,1683.688 285.184,1691.816 285.184,1706.792 C285.184,1722.024 292.032,1730.024 304.832,1730.024 C310.784,1730.024 316.224,1728.296 320.64,1725.544 L320.64,1703.72 L304.32,1703.72 L305.28,1710.568 L311.488,1710.568 L311.488,1721.384 C309.504,1722.472 307.264,1722.984 304.896,1722.984 C298.368,1722.984 295.04,1718.696 295.04,1706.856 C295.04,1695.336 300.032,1690.664 306.304,1690.664 C309.952,1690.664 312.448,1691.816 315.328,1694.184 L320.384,1689 C316.672,1685.8 312.192,1683.688 305.856,1683.688 Z M342.656,1711.656 L337.856,1711.656 L337.856,1729 L328.448,1729 L328.448,1684.712 L342.272,1684.712 C354.112,1684.712 360.128,1689 360.128,1697.96 C360.128,1703.848 357.248,1707.368 351.36,1709.928 L362.816,1729 L352.128,1729 L342.656,1711.656 Z M337.856,1705 L342.784,1705 C347.712,1705 350.4,1702.952 350.4,1697.96 C350.4,1693.416 347.776,1691.432 342.08,1691.432 L337.856,1691.432 L337.856,1705 Z M388.672,1719.08 L374.784,1719.08 L372.288,1729 L362.496,1729 L376.128,1684.712 L387.584,1684.712 L401.152,1729 L391.168,1729 L388.672,1719.08 Z M386.88,1712.104 L381.696,1691.688 L376.576,1712.104 L386.88,1712.104 Z M427.904,1705.576 C432.896,1706.536 437.952,1708.904 437.952,1716.136 C437.952,1726.056 429.952,1729 419.072,1729 L405.248,1729 L405.248,1684.712 L417.344,1684.712 C428.928,1684.712 436.032,1687.848 436.032,1696.04 C436.032,1701.608 432,1704.616 427.904,1705.576 Z M414.656,1691.496 L414.656,1702.696 L419.264,1702.696 C423.744,1702.696 426.432,1700.84 426.432,1696.872 C426.432,1692.776 423.68,1691.496 418.24,1691.496 L414.656,1691.496 Z M419.136,1722.024 C424.384,1722.024 428.16,1721 428.16,1715.752 C428.16,1710.824 424.704,1709.096 419.968,1709.096 L414.656,1709.096 L414.656,1722.024 L419.136,1722.024 Z M467.264,1705.576 C472.256,1706.536 477.312,1708.904 477.312,1716.136 C477.312,1726.056 469.312,1729 458.432,1729 L444.608,1729 L444.608,1684.712 L456.704,1684.712 C468.288,1684.712 475.392,1687.848 475.392,1696.04 C475.392,1701.608 471.36,1704.616 467.264,1705.576 Z M454.016,1691.496 L454.016,1702.696 L458.624,1702.696 C463.104,1702.696 465.792,1700.84 465.792,1696.872 C465.792,1692.776 463.04,1691.496 457.6,1691.496 L454.016,1691.496 Z M458.496,1722.024 C463.744,1722.024 467.52,1721 467.52,1715.752 C467.52,1710.824 464.064,1709.096 459.328,1709.096 L454.016,1709.096 L454.016,1722.024 L458.496,1722.024 Z M503.616,1719.08 L489.728,1719.08 L487.232,1729 L477.44,1729 L491.072,1684.712 L502.528,1684.712 L516.096,1729 L506.112,1729 L503.616,1719.08 Z M501.824,1712.104 L496.64,1691.688 L491.52,1712.104 L501.824,1712.104 Z M542.848,1705.576 C547.84,1706.536 552.896,1708.904 552.896,1716.136 C552.896,1726.056 544.896,1729 534.016,1729 L520.192,1729 L520.192,1684.712 L532.288,1684.712 C543.872,1684.712 550.976,1687.848 550.976,1696.04 C550.976,1701.608 546.944,1704.616 542.848,1705.576 Z M529.6,1691.496 L529.6,1702.696 L534.208,1702.696 C538.688,1702.696 541.376,1700.84 541.376,1696.872 C541.376,1692.776 538.624,1691.496 533.184,1691.496 L529.6,1691.496 Z M534.08,1722.024 C539.328,1722.024 543.104,1721 543.104,1715.752 C543.104,1710.824 539.648,1709.096 534.912,1709.096 L529.6,1709.096 L529.6,1722.024 L534.08,1722.024 Z M568.96,1721.448 L568.96,1684.712 L559.552,1684.712 L559.552,1729 L585.472,1729 L586.496,1721.448 L568.96,1721.448 Z M617.536,1691.56 L618.56,1684.712 L592.128,1684.712 L592.128,1729 L618.688,1729 L618.688,1722.088 L601.536,1722.088 L601.536,1709.864 L615.488,1709.864 L615.488,1703.08 L601.536,1703.08 L601.536,1691.56 L617.536,1691.56 Z" id="GRABBABLE"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="240px" height="48px" viewBox="0 0 240 48" 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>GRAVITY Copy</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Physics-Tool" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Physics---Default" transform="translate(-333.000000, -963.000000)" fill="#FFFFFF">
<path d="M354.336,963.688 C343.008,963.688 333.664,971.816 333.664,986.792 C333.664,1002.024 340.512,1010.024 353.312,1010.024 C359.264,1010.024 364.704,1008.296 369.12,1005.544 L369.12,983.72 L352.8,983.72 L353.76,990.568 L359.968,990.568 L359.968,1001.384 C357.984,1002.472 355.744,1002.984 353.376,1002.984 C346.848,1002.984 343.52,998.696 343.52,986.856 C343.52,975.336 348.512,970.664 354.784,970.664 C358.432,970.664 360.928,971.816 363.808,974.184 L368.864,969 C365.152,965.8 360.672,963.688 354.336,963.688 Z M391.136,991.656 L386.336,991.656 L386.336,1009 L376.928,1009 L376.928,964.712 L390.752,964.712 C402.592,964.712 408.608,969 408.608,977.96 C408.608,983.848 405.728,987.368 399.84,989.928 L411.296,1009 L400.608,1009 L391.136,991.656 Z M386.336,985 L391.264,985 C396.192,985 398.88,982.952 398.88,977.96 C398.88,973.416 396.256,971.432 390.56,971.432 L386.336,971.432 L386.336,985 Z M437.152,999.08 L423.264,999.08 L420.768,1009 L410.976,1009 L424.608,964.712 L436.064,964.712 L449.632,1009 L439.648,1009 L437.152,999.08 Z M435.36,992.104 L430.176,971.688 L425.056,992.104 L435.36,992.104 Z M470.24,1009 L458.784,1009 L445.6,964.712 L455.648,964.712 L464.672,1001.192 L473.376,964.712 L482.976,964.712 L470.24,1009 Z M496.608,1009 L496.608,964.712 L487.136,964.712 L487.136,1009 L496.608,1009 Z M534.304,972.072 L523.104,972.072 L523.104,1009 L513.696,1009 L513.696,972.072 L501.92,972.072 L501.92,964.712 L535.328,964.712 L534.304,972.072 Z M558.816,992.296 L558.816,1009 L549.408,1009 L549.408,992.36 L535.2,964.712 L545.504,964.712 L554.336,984.808 L563.104,964.712 L573.024,964.712 L558.816,992.296 Z" id="GRAVITY-Copy"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="104px" height="48px" viewBox="0 0 104 48" 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>OFF</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Physics-Tool" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Physics---Default" transform="translate(-401.000000, -1031.000000)" fill="#575757">
<path d="M421.3,1031.688 C433.46,1031.688 440.948,1040.008 440.948,1054.856 C440.948,1069.384 433.46,1078.024 421.3,1078.024 C409.14,1078.024 401.588,1069.64 401.588,1054.856 C401.588,1040.392 409.14,1031.688 421.3,1031.688 Z M421.3,1038.728 C415.028,1038.728 411.508,1043.272 411.508,1054.856 C411.508,1066.44 415.156,1070.984 421.3,1070.984 C427.636,1070.984 431.028,1066.44 431.028,1054.856 C431.028,1043.272 427.636,1038.728 421.3,1038.728 Z M472.756,1039.56 L473.78,1032.712 L448.052,1032.712 L448.052,1077 L457.46,1077 L457.46,1058.952 L470.772,1058.952 L470.772,1052.104 L457.46,1052.104 L457.46,1039.56 L472.756,1039.56 Z M503.988,1039.56 L505.012,1032.712 L479.284,1032.712 L479.284,1077 L488.692,1077 L488.692,1058.952 L502.004,1058.952 L502.004,1052.104 L488.692,1052.104 L488.692,1039.56 L503.988,1039.56 Z" id="OFF"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="81px" height="48px" viewBox="0 0 81 48" 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>ON</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Physics-Tool" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Physics---Default" transform="translate(-411.000000, -1391.000000)" fill="#575757">
<path d="M431.156,1391.688 C443.316,1391.688 450.804,1400.008 450.804,1414.856 C450.804,1429.384 443.316,1438.024 431.156,1438.024 C418.996,1438.024 411.444,1429.64 411.444,1414.856 C411.444,1400.392 418.996,1391.688 431.156,1391.688 Z M431.156,1398.728 C424.884,1398.728 421.364,1403.272 421.364,1414.856 C421.364,1426.44 425.012,1430.984 431.156,1430.984 C437.492,1430.984 440.884,1426.44 440.884,1414.856 C440.884,1403.272 437.492,1398.728 431.156,1398.728 Z M491.316,1437 L491.316,1392.712 L482.804,1392.712 L482.804,1412.168 C482.804,1418.76 483.636,1424.904 484.084,1427.912 L469.748,1392.712 L457.908,1392.712 L457.908,1437 L466.42,1437 L466.42,1419.784 C466.42,1411.592 465.652,1405.832 465.14,1401.864 L479.22,1437 L491.316,1437 Z" id="ON"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -48,7 +48,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
// For reliable access, use the values from optionsSettings rather than doing Settings.getValue() - Settings values
// are not necessarily updated instantaneously.
},
optionsToggles = {}, // For toggle buttons without a setting.
optionsToggles = {}, // Cater for toggle buttons without a setting.
highlightOverlay,
swatchHighlightOverlay = null,
@ -326,7 +326,20 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
z: UIT.dimensions.buttonDimensions.z / 2 + UIT.dimensions.imageOverlayOffset
},
color: UIT.colors.white
},
sublabel: {
// Relative to newToggleButton.
localPosition: {
x: 0,
y: 0,
z: UIT.dimensions.buttonDimensions.z / 2 + UIT.dimensions.imageOverlayOffset
},
color: UIT.colors.lightGray
}
/*
onSublabel: { } // Optional properties to update sublabel with.
offSublabel: { } // Optional properties to update sublabel with.
*/
},
"swatch": {
overlay: "shape",
@ -1047,12 +1060,39 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
},
{
id: "gravityToggle",
type: "toggleButton",
type: "newToggleButton",
properties: {
dimensions: { x: 0.0668, y: 0.0280, z: UIT.dimensions.buttonDimensions.z },
localPosition: { x: -0.0748, y: 0.0480, z: UIT.dimensions.panel.z / 2 + UIT.dimensions.buttonDimensions.z / 2 }
},
label: "GRAVITY",
newLabel: {
localPosition: {
x: 0,
y: 0.0034,
z: UIT.dimensions.buttonDimensions.z / 2 + UIT.dimensions.imageOverlayOffset
},
url: "../assets/tools/physics/buttons/gravity-label.svg",
scale: 0.0240,
color: UIT.colors.white
},
sublabel: {
localPosition: {
x: 0,
y: -0.0034,
z: UIT.dimensions.buttonDimensions.z / 2 + UIT.dimensions.imageOverlayOffset
},
url: "../assets/tools/physics/buttons/off-label.svg",
scale: 0.0104,
color: UIT.colors.white // SVG has gray color.
},
onSublabel: {
url: "../assets/tools/physics/buttons/on-label.svg",
scale: 0.0081
},
offSublabel: {
url: "../assets/tools/physics/buttons/off-label.svg",
scale: 0.0104
},
setting: {
key: "VREdit.physicsTool.gravityOn",
defaultValue: false,
@ -1063,30 +1103,40 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
}
},
{
id: "grabToggle",
type: "toggleButton",
id: "collideToggle",
type: "newToggleButton",
properties: {
dimensions: { x: 0.0668, y: 0.0280, z: UIT.dimensions.buttonDimensions.z },
localPosition: { x: -0.0748, y: 0.0120, z: UIT.dimensions.panel.z / 2 + UIT.dimensions.buttonDimensions.z / 2 }
},
label: " GRAB",
setting: {
key: "VREdit.physicsTool.grabOn",
defaultValue: false,
callback: "setGrabOn"
newLabel: {
localPosition: {
x: 0,
y: 0.0034,
z: UIT.dimensions.buttonDimensions.z / 2 + UIT.dimensions.imageOverlayOffset
},
url: "../assets/tools/physics/buttons/collisions-label.svg",
scale: 0.0338,
color: UIT.colors.white
},
command: {
method: "setGrabOn"
}
},
{
id: "collideToggle",
type: "toggleButton",
properties: {
dimensions: { x: 0.0668, y: 0.0280, z: UIT.dimensions.buttonDimensions.z },
localPosition: { x: -0.0748, y: -0.0240, z: UIT.dimensions.panel.z / 2 + UIT.dimensions.buttonDimensions.z / 2 }
sublabel: {
localPosition: {
x: 0,
y: -0.0034,
z: UIT.dimensions.buttonDimensions.z / 2 + UIT.dimensions.imageOverlayOffset
},
url: "../assets/tools/physics/buttons/off-label.svg",
scale: 0.0104,
color: UIT.colors.white // SVG has gray color.
},
onSublabel: {
url: "../assets/tools/physics/buttons/on-label.svg",
scale: 0.0081
},
offSublabel: {
url: "../assets/tools/physics/buttons/off-label.svg",
scale: 0.0104
},
label: "COLLIDE",
setting: {
key: "VREdit.physicsTool.collideOn",
defaultValue: false,
@ -1096,6 +1146,50 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
method: "setCollideOn"
}
},
{
id: "grabToggle",
type: "newToggleButton",
properties: {
dimensions: { x: 0.0668, y: 0.0280, z: UIT.dimensions.buttonDimensions.z },
localPosition: { x: -0.0748, y: -0.0240, z: UIT.dimensions.panel.z / 2 + UIT.dimensions.buttonDimensions.z / 2 }
},
newLabel: {
localPosition: {
x: 0,
y: 0.0034,
z: UIT.dimensions.buttonDimensions.z / 2 + UIT.dimensions.imageOverlayOffset
},
url: "../assets/tools/physics/buttons/grabbable-label.svg",
scale: 0.0334,
color: UIT.colors.white
},
sublabel: {
localPosition: {
x: 0,
y: -0.0034,
z: UIT.dimensions.buttonDimensions.z / 2 + UIT.dimensions.imageOverlayOffset
},
url: "../assets/tools/physics/buttons/off-label.svg",
scale: 0.0104,
color: UIT.colors.white // SVG has gray color.
},
onSublabel: {
url: "../assets/tools/physics/buttons/on-label.svg",
scale: 0.0081
},
offSublabel: {
url: "../assets/tools/physics/buttons/off-label.svg",
scale: 0.0104
},
setting: {
key: "VREdit.physicsTool.grabOn",
defaultValue: false,
callback: "setGrabOn"
},
command: {
method: "setGrabOn"
}
},
{
id: "physicsPresetsLabel",
@ -1891,6 +1985,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
childProperties,
auxiliaryProperties,
parentID,
sublabelModifier,
value,
imageOffset,
IMAGE_OFFSET = 0.0005,
@ -1929,6 +2024,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
if (properties.url) {
properties.url = Script.resolvePath(properties.url);
}
sublabelModifier = null;
if (optionsItems[i].setting) {
optionsSettings[optionsItems[i].id] = { key: optionsItems[i].setting.key };
value = Settings.getValue(optionsItems[i].setting.key);
@ -1948,6 +2044,17 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
? UI_ELEMENTS[optionsItems[i].type].onColor
: UI_ELEMENTS[optionsItems[i].type].offColor;
}
if (optionsItems[i].type === "newToggleButton") {
// Store value in optionsSettings rather than using overlay property.
optionsSettings[optionsItems[i].id].value = value;
optionsToggles[optionsItems[i].id] = value;
properties.color = value
? UI_ELEMENTS[optionsItems[i].type].onColor
: UI_ELEMENTS[optionsItems[i].type].offColor;
if (optionsItems[i].hasOwnProperty("onSublabel")) {
sublabelModifier = value ? optionsItems[i].onSublabel : optionsItems[i].offSublabel;
}
}
if (optionsItems[i].type === "barSlider") {
// Store value in optionsSettings rather than using overlay property.
optionsSettings[optionsItems[i].id].value = value;
@ -1994,6 +2101,9 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
childProperties = Object.clone(UI_ELEMENTS.image.properties);
childProperties = Object.merge(childProperties, UI_ELEMENTS[optionsItems[i].type].newLabel);
childProperties = Object.merge(childProperties, optionsItems[i].sublabel);
if (sublabelModifier) {
childProperties = Object.merge(childProperties, sublabelModifier);
}
childProperties.url = Script.resolvePath(childProperties.url);
childProperties.parentID = optionsOverlays[optionsOverlays.length - 1];
id = Overlays.addOverlay(UI_ELEMENTS.image.overlay, childProperties);
@ -2351,6 +2461,7 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
doCommand = function (command, parameter) {
var index,
value,
properties,
items,
parentID,
label,
@ -2426,11 +2537,15 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
case "setCollideOn":
value = !optionsSettings[parameter].value;
optionsSettings[parameter].value = value;
optionsToggles[parameter] = value;
Settings.setValue(optionsSettings[parameter].key, value);
index = optionsOverlaysIDs.indexOf(parameter);
Overlays.editOverlay(optionsOverlays[index], {
color: value ? UI_ELEMENTS[optionsItems[index].type].onColor : UI_ELEMENTS[optionsItems[index].type].offColor
});
properties = Object.clone(value ? optionsItems[index].onSublabel : optionsItems[index].offSublabel);
properties.url = Script.resolvePath(properties.url);
Overlays.editOverlay(optionsOverlaysSublabels[index], properties);
uiCommandCallback(command, value);
break;
@ -3173,12 +3288,6 @@ ToolsMenu = function (side, leftInputs, rightInputs, uiCommandCallback) {
isHighlightingColorCircle = false;
isHighlightingPicklist = false;
isHighlightingPicklistItem = false;
for (id in optionsToggles) {
if (optionsToggles.hasOwnProperty(id)) {
optionsToggles[id] = false;
}
}
isPicklistOpen = false;
pressedItem = null;
pressedSource = null;

View file

@ -18,6 +18,7 @@ UIT = (function () {
white: { red: 0xff, green: 0xff, blue: 0xff },
faintGray: { red: 0xe3, green: 0xe3, blue: 0xe3 },
lightGrayText: { red: 0xaf, green: 0xaf, blue: 0xaf },
lightGray: { red: 0x6a, green: 0x6a, blue: 0x6a },
baseGray: { red: 0x40, green: 0x40, blue: 0x40 },
baseGrayShadow: { red: 0x25, green: 0x25, blue: 0x25 },
darkGray: { red: 0x12, green: 0x12, blue: 0x12 },