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: "", +};