From 9013eee352c01047d4e7c4a06ea9faf6b42d3ece Mon Sep 17 00:00:00 2001 From: David Back Date: Fri, 4 Jan 2019 18:31:23 -0800 Subject: [PATCH 1/5] add grid entities to create - icons pending --- .../resources/qml/hifi/tablet/EditTabView.qml | 12 +++++ .../qml/hifi/tablet/EditToolsTabView.qml | 12 +++++ scripts/system/edit.js | 6 +++ scripts/system/html/entityList.html | 1 + scripts/system/html/entityProperties.html | 1 + scripts/system/html/js/entityList.js | 17 +----- scripts/system/html/js/entityProperties.js | 52 ++++++++++++------- scripts/system/html/js/includes.js | 27 ++++++++++ 8 files changed, 95 insertions(+), 33 deletions(-) create mode 100644 scripts/system/html/js/includes.js diff --git a/interface/resources/qml/hifi/tablet/EditTabView.qml b/interface/resources/qml/hifi/tablet/EditTabView.qml index 5959725a6a..21c8756d9a 100644 --- a/interface/resources/qml/hifi/tablet/EditTabView.qml +++ b/interface/resources/qml/hifi/tablet/EditTabView.qml @@ -189,6 +189,18 @@ TabBar { }); editTabView.currentIndex = 2 } + } + + NewEntityButton { + icon: "icons/create-icons/21-cube-01.svg" + text: "GRID" + onClicked: { + editRoot.sendToScript({ + method: "newEntityButtonClicked", + params: { buttonName: "newGridButton" } + }); + editTabView.currentIndex = 2 + } } } diff --git a/interface/resources/qml/hifi/tablet/EditToolsTabView.qml b/interface/resources/qml/hifi/tablet/EditToolsTabView.qml index 6b64520feb..dc062910ca 100644 --- a/interface/resources/qml/hifi/tablet/EditToolsTabView.qml +++ b/interface/resources/qml/hifi/tablet/EditToolsTabView.qml @@ -195,6 +195,18 @@ TabBar { }); editTabView.currentIndex = tabIndex.properties } + } + + NewEntityButton { + icon: "icons/create-icons/21-cube-01.svg" + text: "GRID" + onClicked: { + editRoot.sendToScript({ + method: "newEntityButtonClicked", + params: { buttonName: "newGridButton" } + }); + editTabView.currentIndex = tabIndex.properties + } } } diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 36f9af0ea7..94fca20a9d 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -892,6 +892,12 @@ var toolBar = (function () { }); addButton("newMaterialButton", createNewEntityDialogButtonCallback("Material")); + + addButton("newGridButton", function () { + createNewEntity({ + type: "Grid", + }); + }); var deactivateCreateIfDesktopWindowsHidden = function() { if (!shouldUseEditTabletApp() && !entityListTool.isVisible() && !createToolsWindow.isVisible()) { diff --git a/scripts/system/html/entityList.html b/scripts/system/html/entityList.html index f9948bc8b0..f525c84cbc 100644 --- a/scripts/system/html/entityList.html +++ b/scripts/system/html/entityList.html @@ -19,6 +19,7 @@ + diff --git a/scripts/system/html/entityProperties.html b/scripts/system/html/entityProperties.html index a8bcabbfea..67f03a33a2 100644 --- a/scripts/system/html/entityProperties.html +++ b/scripts/system/html/entityProperties.html @@ -24,6 +24,7 @@ + diff --git a/scripts/system/html/js/entityList.js b/scripts/system/html/js/entityList.js index 156006619d..12ea6c91d0 100644 --- a/scripts/system/html/js/entityList.js +++ b/scripts/system/html/js/entityList.js @@ -153,22 +153,9 @@ const FILTER_TYPES = [ "PolyLine", "PolyVox", "Text", + "Grid", ]; -const ICON_FOR_TYPE = { - Shape: "n", - Model: "", - Image: "", - Light: "p", - Zone: "o", - Web: "q", - Material: "", - ParticleEffect: "", - PolyLine: "", - PolyVox: "", - Text: "l", -}; - const DOUBLE_CLICK_TIMEOUT = 300; // ms const RENAME_COOLDOWN = 400; // ms @@ -325,7 +312,7 @@ function loaded() { let elSpan = document.createElement('span'); elSpan.setAttribute("class", "typeIcon"); - elSpan.innerHTML = ICON_FOR_TYPE[type]; + elSpan.innerHTML = ENTITY_TYPE_ICON[type]; elLabel.insertBefore(elSpan, elLabel.childNodes[0]); diff --git a/scripts/system/html/js/entityProperties.js b/scripts/system/html/js/entityProperties.js index 3ccc5359ff..863a179d17 100644 --- a/scripts/system/html/js/entityProperties.js +++ b/scripts/system/html/js/entityProperties.js @@ -9,23 +9,6 @@ /* global alert, augmentSpinButtons, clearTimeout, console, document, Element, EventBridge, JSONEditor, openEventBridge, setTimeout, window, _ $ */ - -const ICON_FOR_TYPE = { - Box: "V", - Sphere: "n", - Shape: "n", - ParticleEffect: "", - Model: "", - Web: "q", - Image: "", - Text: "l", - Light: "p", - Zone: "o", - PolyVox: "", - Multiple: "", - PolyLine: "", - Material: "" -}; const DEGREES_TO_RADIANS = Math.PI / 180.0; @@ -44,7 +27,7 @@ const GROUPS = [ { label: NO_SELECTION, type: "icon", - icons: ICON_FOR_TYPE, + icons: ENTITY_TYPE_ICON, propertyID: "type", replaceID: "placeholder-property-type", }, @@ -662,6 +645,38 @@ const GROUPS = [ propertyID: "materialRepeat", }, ] + }, + { + id: "grid", + addToGroup: "base", + properties: [ + { + label: "Color", + type: "color", + propertyID: "color", + }, + { + label: "Follow Camera", + type: "bool", + propertyID: "followCamera", + }, + { + label: "Major Grid Every", + type: "number-draggable", + min: 0, + step: 1, + decimals: 0, + propertyID: "majorGridEvery", + }, + { + label: "Minor Grid Every", + type: "number-draggable", + min: 0, + step: 0.01, + decimals: 2, + propertyID: "minorGridEvery", + }, + ] }, { id: "particles", @@ -1427,6 +1442,7 @@ const GROUPS_PER_TYPE = { 'particles_acceleration', 'particles_spin', 'particles_constraints', 'spatial', 'behavior', 'physics' ], PolyLine: [ 'base', 'spatial', 'behavior', 'collision', 'physics' ], PolyVox: [ 'base', 'spatial', 'behavior', 'collision', 'physics' ], + Grid: [ 'base', 'grid', 'spatial', 'behavior', 'physics' ], Multiple: [ 'base', 'spatial', 'behavior', 'collision', 'physics' ], }; diff --git a/scripts/system/html/js/includes.js b/scripts/system/html/js/includes.js new file mode 100644 index 0000000000..02af65b691 --- /dev/null +++ b/scripts/system/html/js/includes.js @@ -0,0 +1,27 @@ +// +// includes.js +// +// Created by David Back on 3 Jan 2019 +// Copyright 2016 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +const ENTITY_TYPE_ICON = { + Box: "m", + Grid: "V", + Image: "", + Light: "p", + Material: "", + Model: "", + ParticleEffect: "", + PolyVox: "", + PolyLine: "", + Shape: "n", + Sphere: "n", + Text: "l", + Web: "q", + Zone: "o", + Multiple: "", +}; From e0e9a7de15abb7e91e0e96e638d81a4097199b18 Mon Sep 17 00:00:00 2001 From: David Back Date: Fri, 4 Jan 2019 18:35:00 -0800 Subject: [PATCH 2/5] tabs --- .../resources/qml/hifi/tablet/EditTabView.qml | 4 ++-- .../qml/hifi/tablet/EditToolsTabView.qml | 4 ++-- scripts/system/edit.js | 4 ++-- scripts/system/html/js/entityList.js | 2 +- scripts/system/html/js/entityProperties.js | 16 +++++++-------- scripts/system/html/js/includes.js | 20 +++++++++---------- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/EditTabView.qml b/interface/resources/qml/hifi/tablet/EditTabView.qml index 21c8756d9a..c6b66ae24d 100644 --- a/interface/resources/qml/hifi/tablet/EditTabView.qml +++ b/interface/resources/qml/hifi/tablet/EditTabView.qml @@ -190,8 +190,8 @@ TabBar { editTabView.currentIndex = 2 } } - - NewEntityButton { + + NewEntityButton { icon: "icons/create-icons/21-cube-01.svg" text: "GRID" onClicked: { diff --git a/interface/resources/qml/hifi/tablet/EditToolsTabView.qml b/interface/resources/qml/hifi/tablet/EditToolsTabView.qml index dc062910ca..9db09cd229 100644 --- a/interface/resources/qml/hifi/tablet/EditToolsTabView.qml +++ b/interface/resources/qml/hifi/tablet/EditToolsTabView.qml @@ -196,8 +196,8 @@ TabBar { editTabView.currentIndex = tabIndex.properties } } - - NewEntityButton { + + NewEntityButton { icon: "icons/create-icons/21-cube-01.svg" text: "GRID" onClicked: { diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 94fca20a9d..2bbbd60c23 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -892,8 +892,8 @@ var toolBar = (function () { }); addButton("newMaterialButton", createNewEntityDialogButtonCallback("Material")); - - addButton("newGridButton", function () { + + addButton("newGridButton", function () { createNewEntity({ type: "Grid", }); diff --git a/scripts/system/html/js/entityList.js b/scripts/system/html/js/entityList.js index 12ea6c91d0..fdf0993235 100644 --- a/scripts/system/html/js/entityList.js +++ b/scripts/system/html/js/entityList.js @@ -153,7 +153,7 @@ const FILTER_TYPES = [ "PolyLine", "PolyVox", "Text", - "Grid", + "Grid", ]; const DOUBLE_CLICK_TIMEOUT = 300; // ms diff --git a/scripts/system/html/js/entityProperties.js b/scripts/system/html/js/entityProperties.js index 863a179d17..662d883bd2 100644 --- a/scripts/system/html/js/entityProperties.js +++ b/scripts/system/html/js/entityProperties.js @@ -646,7 +646,7 @@ const GROUPS = [ }, ] }, - { + { id: "grid", addToGroup: "base", properties: [ @@ -663,17 +663,17 @@ const GROUPS = [ { label: "Major Grid Every", type: "number-draggable", - min: 0, - step: 1, - decimals: 0, + min: 0, + step: 1, + decimals: 0, propertyID: "majorGridEvery", }, - { + { label: "Minor Grid Every", type: "number-draggable", - min: 0, - step: 0.01, - decimals: 2, + min: 0, + step: 0.01, + decimals: 2, propertyID: "minorGridEvery", }, ] diff --git a/scripts/system/html/js/includes.js b/scripts/system/html/js/includes.js index 02af65b691..4d2c7f2e15 100644 --- a/scripts/system/html/js/includes.js +++ b/scripts/system/html/js/includes.js @@ -10,17 +10,17 @@ const ENTITY_TYPE_ICON = { Box: "m", - Grid: "V", - Image: "", - Light: "p", - Material: "", - Model: "", - ParticleEffect: "", - PolyVox: "", - PolyLine: "", - Shape: "n", + Grid: "V", + Image: "", + Light: "p", + Material: "", + Model: "", + ParticleEffect: "", + PolyVox: "", + PolyLine: "", + Shape: "n", Sphere: "n", - Text: "l", + Text: "l", Web: "q", Zone: "o", Multiple: "", From 7581c77be877bf56f4e1c8bde76b2f170bf90513 Mon Sep 17 00:00:00 2001 From: David Back Date: Mon, 7 Jan 2019 12:17:40 -0800 Subject: [PATCH 3/5] update tooltips, use Cube icon for now --- scripts/system/assets/data/createAppTooltips.json | 12 +++++++++--- scripts/system/html/js/includes.js | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/system/assets/data/createAppTooltips.json b/scripts/system/assets/data/createAppTooltips.json index 56341acc90..98e9088e1d 100644 --- a/scripts/system/assets/data/createAppTooltips.json +++ b/scripts/system/assets/data/createAppTooltips.json @@ -17,9 +17,6 @@ "lineHeight": { "tooltip": "The height of each line of text. This determines the size of the text." }, - "faceCamera": { - "tooltip": "If enabled, the entity follows the camera of each user, creating a billboard effect." - }, "textBillboardMode": { "tooltip": "If enabled, determines how the entity will face the camera.", "jsPropertyName": "billboardMode" @@ -356,6 +353,15 @@ "materialMappingRot": { "tooltip": "How much to rotate the material within the parent's UV-space, in degrees." }, + "followCamera": { + "tooltip": "If enabled, the grid is always visible even as the camera moves to another position." + }, + "majorGridEvery": { + "tooltip": "The number of \"Minor Grid Every\" intervals at which to draw a thick grid line." + }, + "minorGridEvery": { + "tooltip": "The real number of meters at which to draw thin grid lines." + }, "id": { "tooltip": "The unique identifier of this entity." }, diff --git a/scripts/system/html/js/includes.js b/scripts/system/html/js/includes.js index 4d2c7f2e15..01fce937bf 100644 --- a/scripts/system/html/js/includes.js +++ b/scripts/system/html/js/includes.js @@ -10,7 +10,7 @@ const ENTITY_TYPE_ICON = { Box: "m", - Grid: "V", + Grid: "m", Image: "", Light: "p", Material: "", From 90e2feb9772829cb5631fcb5e6d7ec16ce6be938 Mon Sep 17 00:00:00 2001 From: David Back Date: Mon, 7 Jan 2019 14:04:11 -0800 Subject: [PATCH 4/5] replace placeholder icon with real icon from Alan --- interface/resources/fonts/hifi-glyphs.ttf | Bin 33952 -> 34396 bytes .../icons/create-icons/142-grid-01.svg | 12 ++++++++++++ .../resources/qml/hifi/tablet/EditTabView.qml | 2 +- .../qml/hifi/tablet/EditToolsTabView.qml | 2 +- scripts/system/html/js/includes.js | 2 +- 5 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 interface/resources/icons/create-icons/142-grid-01.svg diff --git a/interface/resources/fonts/hifi-glyphs.ttf b/interface/resources/fonts/hifi-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g35|Xu4iK9>eJ0NbH0YFo`1JX-G5z-3ZIDaA%v{}UJd3_?LHPknt7XTE&z+<|dRYpHTD-QCev9Q=&d;Tp9?Ez?ad^v&d zk7vFXcb)i6M8O+_17>fyDrWDIOi0%`DOV-yK9MO&;~DrB^8=8ZgnWvj%4N@t5r#?D zX4Z{`CdI9)#}&7)tu8sA+eeefSRGzPCBk~ZVIuqrSR*21&LJz2EHLiHtJ_hD@;cx! zQ3e5PMEUEyv-Ub|tGLHNCx!0M1{rj6&QB{IG4zzKr;LoABRIR$8Mn_mwtZN-Zr{#` g`(-5^_S~F(cMm4l5L5_6yl=qzME}$O?_>7<0Uo1uSpWb4 diff --git a/interface/resources/icons/create-icons/142-grid-01.svg b/interface/resources/icons/create-icons/142-grid-01.svg new file mode 100644 index 0000000000..b4353c1caa --- /dev/null +++ b/interface/resources/icons/create-icons/142-grid-01.svg @@ -0,0 +1,12 @@ + + + + + diff --git a/interface/resources/qml/hifi/tablet/EditTabView.qml b/interface/resources/qml/hifi/tablet/EditTabView.qml index c6b66ae24d..122d87250c 100644 --- a/interface/resources/qml/hifi/tablet/EditTabView.qml +++ b/interface/resources/qml/hifi/tablet/EditTabView.qml @@ -192,7 +192,7 @@ TabBar { } NewEntityButton { - icon: "icons/create-icons/21-cube-01.svg" + icon: "icons/create-icons/142-grid-01.svg" text: "GRID" onClicked: { editRoot.sendToScript({ diff --git a/interface/resources/qml/hifi/tablet/EditToolsTabView.qml b/interface/resources/qml/hifi/tablet/EditToolsTabView.qml index 9db09cd229..8da2e839ce 100644 --- a/interface/resources/qml/hifi/tablet/EditToolsTabView.qml +++ b/interface/resources/qml/hifi/tablet/EditToolsTabView.qml @@ -198,7 +198,7 @@ TabBar { } NewEntityButton { - icon: "icons/create-icons/21-cube-01.svg" + icon: "icons/create-icons/142-grid-01.svg" text: "GRID" onClicked: { editRoot.sendToScript({ diff --git a/scripts/system/html/js/includes.js b/scripts/system/html/js/includes.js index 01fce937bf..c604115f91 100644 --- a/scripts/system/html/js/includes.js +++ b/scripts/system/html/js/includes.js @@ -10,7 +10,7 @@ const ENTITY_TYPE_ICON = { Box: "m", - Grid: "m", + Grid: "", Image: "", Light: "p", Material: "", From d9e229d38e72a253fc82bee0932869ed48632fd0 Mon Sep 17 00:00:00 2001 From: David Back Date: Mon, 7 Jan 2019 17:07:28 -0800 Subject: [PATCH 5/5] remove add Grid entity button, fix color --- .../resources/icons/create-icons/142-grid-01.svg | 12 ------------ interface/resources/qml/hifi/tablet/EditTabView.qml | 12 ------------ .../resources/qml/hifi/tablet/EditToolsTabView.qml | 12 ------------ scripts/system/edit.js | 6 ------ scripts/system/html/js/entityProperties.js | 3 ++- 5 files changed, 2 insertions(+), 43 deletions(-) delete mode 100644 interface/resources/icons/create-icons/142-grid-01.svg diff --git a/interface/resources/icons/create-icons/142-grid-01.svg b/interface/resources/icons/create-icons/142-grid-01.svg deleted file mode 100644 index b4353c1caa..0000000000 --- a/interface/resources/icons/create-icons/142-grid-01.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - diff --git a/interface/resources/qml/hifi/tablet/EditTabView.qml b/interface/resources/qml/hifi/tablet/EditTabView.qml index 122d87250c..5959725a6a 100644 --- a/interface/resources/qml/hifi/tablet/EditTabView.qml +++ b/interface/resources/qml/hifi/tablet/EditTabView.qml @@ -190,18 +190,6 @@ TabBar { editTabView.currentIndex = 2 } } - - NewEntityButton { - icon: "icons/create-icons/142-grid-01.svg" - text: "GRID" - onClicked: { - editRoot.sendToScript({ - method: "newEntityButtonClicked", - params: { buttonName: "newGridButton" } - }); - editTabView.currentIndex = 2 - } - } } HifiControls.Button { diff --git a/interface/resources/qml/hifi/tablet/EditToolsTabView.qml b/interface/resources/qml/hifi/tablet/EditToolsTabView.qml index 8da2e839ce..6b64520feb 100644 --- a/interface/resources/qml/hifi/tablet/EditToolsTabView.qml +++ b/interface/resources/qml/hifi/tablet/EditToolsTabView.qml @@ -196,18 +196,6 @@ TabBar { editTabView.currentIndex = tabIndex.properties } } - - NewEntityButton { - icon: "icons/create-icons/142-grid-01.svg" - text: "GRID" - onClicked: { - editRoot.sendToScript({ - method: "newEntityButtonClicked", - params: { buttonName: "newGridButton" } - }); - editTabView.currentIndex = tabIndex.properties - } - } } HifiControls.Button { diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 2bbbd60c23..36f9af0ea7 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -892,12 +892,6 @@ var toolBar = (function () { }); addButton("newMaterialButton", createNewEntityDialogButtonCallback("Material")); - - addButton("newGridButton", function () { - createNewEntity({ - type: "Grid", - }); - }); var deactivateCreateIfDesktopWindowsHidden = function() { if (!shouldUseEditTabletApp() && !entityListTool.isVisible() && !createToolsWindow.isVisible()) { diff --git a/scripts/system/html/js/entityProperties.js b/scripts/system/html/js/entityProperties.js index 662d883bd2..b7d64e4009 100644 --- a/scripts/system/html/js/entityProperties.js +++ b/scripts/system/html/js/entityProperties.js @@ -653,7 +653,8 @@ const GROUPS = [ { label: "Color", type: "color", - propertyID: "color", + propertyID: "gridColor", + propertyName: "color", // actual entity property name }, { label: "Follow Camera",