Merge pull request #274 from AleziaKurdis/feature/renderWithZones-Create-UI

Feature: property "renderWithZones" in Create UI
This commit is contained in:
kasenvr 2020-05-13 16:07:57 -04:00 committed by GitHub
commit 200289841b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 53 additions and 3 deletions

View file

@ -3,6 +3,7 @@
// Created by Brad Hefta-Gaub on 10/2/14.
// Persist toolbar by HRS 6/11/15.
// Copyright 2014 High Fidelity, Inc.
// Copyright 2020 Vircadia contributors.
//
// This script allows you to edit entities with a new UI/UX for mouse and trackpad based editing
//
@ -41,6 +42,7 @@ var CreateWindow = Script.require('./modules/createWindow.js');
var TITLE_OFFSET = 60;
var CREATE_TOOLS_WIDTH = 490;
var MAX_DEFAULT_ENTITY_LIST_HEIGHT = 942;
var ENTIRE_DOMAIN_SCAN_RADIUS = 27713;
var DEFAULT_IMAGE = "https://hifi-content.s3.amazonaws.com/DomainContent/production/no-image.jpg";
@ -562,7 +564,7 @@ var toolBar = (function () {
if (!properties.grab) {
properties.grab = {};
if (Menu.isOptionChecked(MENU_CREATE_ENTITIES_GRABBABLE) &&
!(properties.type === "Zone" || properties.type === "Light"
!(properties.type === "Zone" || properties.type === "Light"
|| properties.type === "ParticleEffect" || properties.type === "Web")) {
properties.grab.grabbable = true;
} else {
@ -2587,6 +2589,11 @@ var PropertiesTool = function (opts) {
entityID: data.entityID,
materialTargetData: parentModelData,
});
} else if (data.type === "zoneListRequest") {
emitScriptEvent({
type: 'zoneListRequest',
zones: getExistingZoneList()
});
}
};
@ -2884,4 +2891,21 @@ selectionDisplay.onSpaceModeChange = function(spaceMode) {
propertiesTool.setSpaceMode(spaceMode);
};
function getExistingZoneList() {
var center = { "x": 0, "y": 0, "z": 0 };
var existingZoneIDs = Entities.findEntitiesByType("Zone", center, ENTIRE_DOMAIN_SCAN_RADIUS);
var listExistingZones = [];
var thisZone = {};
var properties;
for (var k = 0; k < existingZoneIDs.length; k++) {
properties = Entities.getEntityProperties(existingZoneIDs[k], ["name"]);
thisZone = {
"id": existingZoneIDs[k],
"name": properties.name
};
listExistingZones.push(thisZone);
}
return listExistingZones;
}
}()); // END LOCAL_SCOPE

View file

@ -115,12 +115,12 @@ const GROUPS = [
lines: "Wireframe",
},
propertyID: "primitiveMode",
}/*,
},
{
label: "Render With Zones",
type: "multipleZonesSelection",
propertyID: "renderWithZones",
}*/
}
]
},
{

View file

@ -3,6 +3,7 @@
//
// Created by Ryan Huffman on 13 Nov 2014
// Copyright 2014 High Fidelity, Inc.
// Copyright 2020 Vircadia contributors.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@ -1794,3 +1795,28 @@ input[type=number].hide-spinner::-webkit-inner-spin-button {
div.jsoneditor-menu a.jsoneditor-poweredBy {
display: none;
}
td.zoneItem {
width: 100%;
}
select.zoneSelect {
clear: both;
cursor: pointer;
font-family: FiraSans-SemiBold;
font-size: 15px;
width: 90%;
height: 28px;
padding: 0 28px 0 12px;
color: #afafaf;
background: #575757;
position: relative;
display: inline;
border: 0px;
align-items: center;
outline: none;
}
div.multiZoneSelToolbar {
padding: 0px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B