diff --git a/scripts/vr-edit/modules/toolMenu.js b/scripts/vr-edit/modules/toolMenu.js index 1dd0eb486c..ea8106c769 100644 --- a/scripts/vr-edit/modules/toolMenu.js +++ b/scripts/vr-edit/modules/toolMenu.js @@ -295,14 +295,12 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) { type: "swatch", properties: { dimensions: { x: 0.02, y: 0.02, z: 0.01 }, - localPosition: { x: -0.035, y: -0.03, z: -0.005 }, - color: { red: 0, green: 255, blue: 255 }, - solid: true + localPosition: { x: -0.035, y: -0.03, z: -0.005 } }, setting: { key: "VREdit.colorTool.swatch1Color", - property: "color" - // Default value is set in properties, above. + property: "color", + defaultValue: { red: 0, green: 255, blue: 255 } }, command: { method: "setColorPerSwatch", @@ -318,14 +316,12 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) { type: "swatch", properties: { dimensions: { x: 0.02, y: 0.02, z: 0.01 }, - localPosition: { x: -0.01, y: -0.03, z: -0.005 }, - color: { red: 255, green: 0, blue: 255 }, - solid: true + localPosition: { x: -0.01, y: -0.03, z: -0.005 } }, setting: { key: "VREdit.colorTool.swatch2Color", - property: "color" - // Default value is set in properties, above. + property: "color", + defaultValue: { red: 255, green: 0, blue: 255 } }, command: { method: "setColorPerSwatch", @@ -341,14 +337,12 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) { type: "swatch", properties: { dimensions: { x: 0.02, y: 0.02, z: 0.01 }, - localPosition: { x: -0.035, y: -0.005, z: -0.005 }, - color: { red: 255, green: 255, blue: 0 }, - solid: true + localPosition: { x: -0.035, y: -0.005, z: -0.005 } }, setting: { key: "VREdit.colorTool.swatch3Color", - property: "color" - // Default value is set in properties, above. + property: "color", + defaultValue: { red: 255, green: 255, blue: 0 } }, command: { method: "setColorPerSwatch", @@ -364,14 +358,12 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) { type: "swatch", properties: { dimensions: { x: 0.02, y: 0.02, z: 0.01 }, - localPosition: { x: -0.01, y: -0.005, z: -0.005 }, - color: { red: 255, green: 0, blue: 0 }, - solid: true + localPosition: { x: -0.01, y: -0.005, z: -0.005 } }, setting: { key: "VREdit.colorTool.swatch4Color", - property: "color" - // Default value is set in properties, above. + property: "color", + defaultValue: { red: 255, green: 0, blue: 0 } }, command: { method: "setColorPerSwatch", @@ -387,14 +379,12 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) { type: "swatch", properties: { dimensions: { x: 0.02, y: 0.02, z: 0.01 }, - localPosition: { x: -0.035, y: 0.02, z: -0.005 }, - color: { red: 0, green: 255, blue: 0 }, - solid: true + localPosition: { x: -0.035, y: 0.02, z: -0.005 } }, setting: { key: "VREdit.colorTool.swatch5Color", - property: "color" - // Default value is set in properties, above. + property: "color", + defaultValue: { red: 0, green: 255, blue: 0 } }, command: { method: "setColorPerSwatch", @@ -410,14 +400,12 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) { type: "swatch", properties: { dimensions: { x: 0.02, y: 0.02, z: 0.01 }, - localPosition: { x: -0.01, y: 0.02, z: -0.005 }, - color: { red: 0, green: 0, blue: 255 }, - solid: true + localPosition: { x: -0.01, y: 0.02, z: -0.005 } }, setting: { key: "VREdit.colorTool.swatch6Color", - property: "color" - // Default value is set in properties, above. + property: "color", + defaultValue: { red: 0, green: 0, blue: 255 } }, command: { method: "setColorPerSwatch", @@ -434,12 +422,11 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) { properties: { dimensions: { x: 0.02, y: 0.02, z: 0.01 }, localPosition: { x: -0.035, y: 0.045, z: -0.005 } - // Default to empty swatch. }, setting: { key: "VREdit.colorTool.swatch7Color", property: "color" - // Default value is set in properties, above. + // Default to empty swatch. }, command: { method: "setColorPerSwatch", @@ -456,12 +443,11 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) { properties: { dimensions: { x: 0.02, y: 0.02, z: 0.01 }, localPosition: { x: -0.01, y: 0.045, z: -0.005 } - // Default to empty swatch. }, setting: { key: "VREdit.colorTool.swatch8Color", property: "color" - // Default value is set in properties, above. + // Default to empty swatch. }, command: { method: "setColorPerSwatch", @@ -807,7 +793,7 @@ ToolMenu = function (side, leftInputs, rightInputs, uiCommandCallback) { if (optionsItems[i].setting) { optionsSettings[optionsItems[i].id] = { key: optionsItems[i].setting.key }; value = Settings.getValue(optionsItems[i].setting.key); - if (value === "") { + if (value === "" && optionsItems[i].setting.defaultValue) { value = optionsItems[i].setting.defaultValue; } if (value !== "") {