mirror of
https://github.com/overte-org/overte.git
synced 2025-08-12 03:39:01 +02:00
Merge branch 'tablet-ui-edit-js' into 21199
This commit is contained in:
commit
854292b193
13 changed files with 428 additions and 91 deletions
|
@ -2926,10 +2926,12 @@ void Application::keyPressEvent(QKeyEvent* event) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Qt::Key_P: {
|
case Qt::Key_P: {
|
||||||
bool isFirstPersonChecked = Menu::getInstance()->isOptionChecked(MenuOption::FirstPerson);
|
if (!(isShifted || isMeta || isOption)) {
|
||||||
Menu::getInstance()->setIsOptionChecked(MenuOption::FirstPerson, !isFirstPersonChecked);
|
bool isFirstPersonChecked = Menu::getInstance()->isOptionChecked(MenuOption::FirstPerson);
|
||||||
Menu::getInstance()->setIsOptionChecked(MenuOption::ThirdPerson, isFirstPersonChecked);
|
Menu::getInstance()->setIsOptionChecked(MenuOption::FirstPerson, !isFirstPersonChecked);
|
||||||
cameraMenuChanged();
|
Menu::getInstance()->setIsOptionChecked(MenuOption::ThirdPerson, isFirstPersonChecked);
|
||||||
|
cameraMenuChanged();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -577,7 +577,7 @@ Menu::Menu() {
|
||||||
nodeList.data(), SLOT(toggleSendNewerDSConnectVersion(bool)));
|
nodeList.data(), SLOT(toggleSendNewerDSConnectVersion(bool)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// Developer >> Tests >>>
|
// Developer >> Tests >>>
|
||||||
MenuWrapper* testMenu = developerMenu->addMenu("Tests");
|
MenuWrapper* testMenu = developerMenu->addMenu("Tests");
|
||||||
addActionToQMenuAndActionHash(testMenu, MenuOption::RunClientScriptTests, 0, dialogsManager.data(), SLOT(showTestingResults()));
|
addActionToQMenuAndActionHash(testMenu, MenuOption::RunClientScriptTests, 0, dialogsManager.data(), SLOT(showTestingResults()));
|
||||||
|
@ -628,9 +628,9 @@ Menu::Menu() {
|
||||||
|
|
||||||
auto scope = DependencyManager::get<AudioScope>();
|
auto scope = DependencyManager::get<AudioScope>();
|
||||||
MenuWrapper* audioScopeMenu = audioDebugMenu->addMenu("Audio Scope");
|
MenuWrapper* audioScopeMenu = audioDebugMenu->addMenu("Audio Scope");
|
||||||
addCheckableActionToQMenuAndActionHash(audioScopeMenu, MenuOption::AudioScope, Qt::CTRL | Qt::Key_P, false,
|
addCheckableActionToQMenuAndActionHash(audioScopeMenu, MenuOption::AudioScope, Qt::CTRL | Qt::Key_F2, false,
|
||||||
scope.data(), SLOT(toggle()));
|
scope.data(), SLOT(toggle()));
|
||||||
addCheckableActionToQMenuAndActionHash(audioScopeMenu, MenuOption::AudioScopePause, Qt::CTRL | Qt::SHIFT | Qt::Key_P, false,
|
addCheckableActionToQMenuAndActionHash(audioScopeMenu, MenuOption::AudioScopePause, Qt::CTRL | Qt::SHIFT | Qt::Key_F2, false,
|
||||||
scope.data(), SLOT(togglePause()));
|
scope.data(), SLOT(togglePause()));
|
||||||
|
|
||||||
addDisabledActionAndSeparator(audioScopeMenu, "Display Frames");
|
addDisabledActionAndSeparator(audioScopeMenu, "Display Frames");
|
||||||
|
|
|
@ -86,8 +86,13 @@ void Line3DOverlay::setEnd(const glm::vec3& end) {
|
||||||
qDebug() << "Line3DOverlay::setEnd failed";
|
qDebug() << "Line3DOverlay::setEnd failed";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_direction = glm::normalize(offset);
|
|
||||||
_length = glm::length(offset);
|
_length = glm::length(offset);
|
||||||
|
if (_length > 0.0f) {
|
||||||
|
_direction = glm::normalize(offset);
|
||||||
|
} else {
|
||||||
|
_direction = glm::vec3(0.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Line3DOverlay::setLocalEnd(const glm::vec3& localEnd) {
|
void Line3DOverlay::setLocalEnd(const glm::vec3& localEnd) {
|
||||||
|
@ -98,16 +103,18 @@ void Line3DOverlay::setLocalEnd(const glm::vec3& localEnd) {
|
||||||
glm::vec3 localStart = getLocalStart();
|
glm::vec3 localStart = getLocalStart();
|
||||||
offset = localEnd - localStart;
|
offset = localEnd - localStart;
|
||||||
}
|
}
|
||||||
_direction = glm::normalize(offset);
|
|
||||||
_length = glm::length(offset);
|
_length = glm::length(offset);
|
||||||
|
if (_length > 0.0f) {
|
||||||
|
_direction = glm::normalize(offset);
|
||||||
|
} else {
|
||||||
|
_direction = glm::vec3(0.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AABox Line3DOverlay::getBounds() const {
|
AABox Line3DOverlay::getBounds() const {
|
||||||
auto extents = Extents{};
|
auto extents = Extents{};
|
||||||
extents.addPoint(getStart());
|
extents.addPoint(getStart());
|
||||||
extents.addPoint(getEnd());
|
extents.addPoint(getEnd());
|
||||||
extents.transform(getTransform());
|
|
||||||
|
|
||||||
return AABox(extents);
|
return AABox(extents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,19 +129,20 @@ void Line3DOverlay::render(RenderArgs* args) {
|
||||||
glm::vec4 colorv4(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha);
|
glm::vec4 colorv4(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha);
|
||||||
auto batch = args->_batch;
|
auto batch = args->_batch;
|
||||||
if (batch) {
|
if (batch) {
|
||||||
// batch->setModelTransform(getTransform());
|
batch->setModelTransform(Transform());
|
||||||
|
glm::vec3 start = getStart();
|
||||||
|
glm::vec3 end = getEnd();
|
||||||
|
|
||||||
auto geometryCache = DependencyManager::get<GeometryCache>();
|
auto geometryCache = DependencyManager::get<GeometryCache>();
|
||||||
if (getIsDashedLine()) {
|
if (getIsDashedLine()) {
|
||||||
// TODO: add support for color to renderDashedLine()
|
// TODO: add support for color to renderDashedLine()
|
||||||
geometryCache->bindSimpleProgram(*batch, false, false, false, true, true);
|
geometryCache->bindSimpleProgram(*batch, false, false, false, true, true);
|
||||||
geometryCache->renderDashedLine(*batch, getStart(), getEnd(), colorv4, _geometryCacheID);
|
geometryCache->renderDashedLine(*batch, start, end, colorv4, _geometryCacheID);
|
||||||
} else if (_glow > 0.0f) {
|
} else if (_glow > 0.0f) {
|
||||||
geometryCache->renderGlowLine(*batch, getStart(), getEnd(),
|
geometryCache->renderGlowLine(*batch, start, end, colorv4, _glow, _glowWidth, _geometryCacheID);
|
||||||
colorv4, _glow, _glowWidth, _geometryCacheID);
|
|
||||||
} else {
|
} else {
|
||||||
geometryCache->bindSimpleProgram(*batch, false, false, false, true, true);
|
geometryCache->bindSimpleProgram(*batch, false, false, false, true, true);
|
||||||
geometryCache->renderLine(*batch, getStart(), getEnd(), colorv4, _geometryCacheID);
|
geometryCache->renderLine(*batch, start, end, colorv4, _geometryCacheID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,13 +160,14 @@ RenderDeferredTask::RenderDeferredTask(RenderFetchCullSortTask::Output items) {
|
||||||
addJob<DrawOverlay3D>("DrawOverlay3DOpaque", overlayOpaquesInputs, true);
|
addJob<DrawOverlay3D>("DrawOverlay3DOpaque", overlayOpaquesInputs, true);
|
||||||
addJob<DrawOverlay3D>("DrawOverlay3DTransparent", overlayTransparentsInputs, false);
|
addJob<DrawOverlay3D>("DrawOverlay3DTransparent", overlayTransparentsInputs, false);
|
||||||
|
|
||||||
|
|
||||||
// Debugging stages
|
// Debugging stages
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
// Bounds do not draw on stencil buffer, so they must come last
|
// Bounds do not draw on stencil buffer, so they must come last
|
||||||
addJob<DrawBounds>("DrawMetaBounds", metas);
|
addJob<DrawBounds>("DrawMetaBounds", metas);
|
||||||
|
addJob<DrawBounds>("DrawOverlayOpaqueBounds", overlayOpaques);
|
||||||
|
addJob<DrawBounds>("DrawOverlayTransparentBounds", overlayTransparents);
|
||||||
|
|
||||||
// Debugging Deferred buffer job
|
// Debugging Deferred buffer job
|
||||||
const auto debugFramebuffers = render::Varying(DebugDeferredBuffer::Inputs(deferredFramebuffer, linearDepthTarget, surfaceGeometryFramebuffer, ambientOcclusionFramebuffer));
|
const auto debugFramebuffers = render::Varying(DebugDeferredBuffer::Inputs(deferredFramebuffer, linearDepthTarget, surfaceGeometryFramebuffer, ambientOcclusionFramebuffer));
|
||||||
|
|
|
@ -266,6 +266,27 @@ CONTROLLER_STATE_MACHINE[STATE_OVERLAY_STYLUS_TOUCHING] = {
|
||||||
};
|
};
|
||||||
CONTROLLER_STATE_MACHINE[STATE_OVERLAY_LASER_TOUCHING] = CONTROLLER_STATE_MACHINE[STATE_OVERLAY_STYLUS_TOUCHING];
|
CONTROLLER_STATE_MACHINE[STATE_OVERLAY_LASER_TOUCHING] = CONTROLLER_STATE_MACHINE[STATE_OVERLAY_STYLUS_TOUCHING];
|
||||||
|
|
||||||
|
// Object assign polyfill
|
||||||
|
if (typeof Object.assign != 'function') {
|
||||||
|
Object.assign = function(target, varArgs) {
|
||||||
|
'use strict';
|
||||||
|
if (target == null) {
|
||||||
|
throw new TypeError('Cannot convert undefined or null to object');
|
||||||
|
}
|
||||||
|
var to = Object(target);
|
||||||
|
for (var index = 1; index < arguments.length; index++) {
|
||||||
|
var nextSource = arguments[index];
|
||||||
|
if (nextSource != null) {
|
||||||
|
for (var nextKey in nextSource) {
|
||||||
|
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
|
||||||
|
to[nextKey] = nextSource[nextKey];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
function distanceBetweenPointAndEntityBoundingBox(point, entityProps) {
|
function distanceBetweenPointAndEntityBoundingBox(point, entityProps) {
|
||||||
var entityXform = new Xform(entityProps.rotation, entityProps.position);
|
var entityXform = new Xform(entityProps.rotation, entityProps.position);
|
||||||
|
@ -1465,7 +1486,18 @@ function MyController(hand) {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
this.entityIsCloneable = function(entityID) {
|
||||||
|
var entityProps = entityPropertiesCache.getGrabbableProps(entityID);
|
||||||
|
var props = entityPropertiesCache.getProps(entityID);
|
||||||
|
if (!props) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entityProps.hasOwnProperty("cloneable")) {
|
||||||
|
return entityProps.cloneable;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
this.entityIsGrabbable = function(entityID) {
|
this.entityIsGrabbable = function(entityID) {
|
||||||
var grabbableProps = entityPropertiesCache.getGrabbableProps(entityID);
|
var grabbableProps = entityPropertiesCache.getGrabbableProps(entityID);
|
||||||
var props = entityPropertiesCache.getProps(entityID);
|
var props = entityPropertiesCache.getProps(entityID);
|
||||||
|
@ -1545,7 +1577,7 @@ function MyController(hand) {
|
||||||
|
|
||||||
this.entityIsNearGrabbable = function(entityID, handPosition, maxDistance) {
|
this.entityIsNearGrabbable = function(entityID, handPosition, maxDistance) {
|
||||||
|
|
||||||
if (!this.entityIsGrabbable(entityID)) {
|
if (!this.entityIsCloneable(entityID) && !this.entityIsGrabbable(entityID)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2411,6 +2443,9 @@ function MyController(hand) {
|
||||||
this.offsetPosition = Vec3.multiplyQbyV(Quat.inverse(Quat.multiply(handRotation, this.offsetRotation)), offset);
|
this.offsetPosition = Vec3.multiplyQbyV(Quat.inverse(Quat.multiply(handRotation, this.offsetRotation)), offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This boolean is used to check if the object that is grabbed has just been cloned
|
||||||
|
// It is only set true, if the object that is grabbed creates a new clone.
|
||||||
|
var isClone = false;
|
||||||
var isPhysical = propsArePhysical(grabbedProperties) ||
|
var isPhysical = propsArePhysical(grabbedProperties) ||
|
||||||
(!this.grabbedIsOverlay && entityHasActions(this.grabbedThingID));
|
(!this.grabbedIsOverlay && entityHasActions(this.grabbedThingID));
|
||||||
if (isPhysical && this.state == STATE_NEAR_GRABBING && grabbedProperties.parentID === NULL_UUID) {
|
if (isPhysical && this.state == STATE_NEAR_GRABBING && grabbedProperties.parentID === NULL_UUID) {
|
||||||
|
@ -2447,6 +2482,54 @@ function MyController(hand) {
|
||||||
if (this.grabbedIsOverlay) {
|
if (this.grabbedIsOverlay) {
|
||||||
Overlays.editOverlay(this.grabbedThingID, reparentProps);
|
Overlays.editOverlay(this.grabbedThingID, reparentProps);
|
||||||
} else {
|
} else {
|
||||||
|
if (grabbedProperties.userData.length > 0) {
|
||||||
|
try{
|
||||||
|
var userData = JSON.parse(grabbedProperties.userData);
|
||||||
|
var grabInfo = userData.grabbableKey;
|
||||||
|
if (grabInfo && grabInfo.cloneable) {
|
||||||
|
// Check if
|
||||||
|
var worldEntities = Entities.findEntitiesInBox(Vec3.subtract(MyAvatar.position, {x:25,y:25, z:25}), {x:50, y: 50, z: 50})
|
||||||
|
var count = 0;
|
||||||
|
worldEntities.forEach(function(item) {
|
||||||
|
var item = Entities.getEntityProperties(item, ["name"]);
|
||||||
|
if (item.name === grabbedProperties.name) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
var cloneableProps = Entities.getEntityProperties(grabbedProperties.id);
|
||||||
|
var lifetime = grabInfo.cloneLifetime ? grabInfo.cloneLifetime : 300;
|
||||||
|
var limit = grabInfo.cloneLimit ? grabInfo.cloneLimit : 10;
|
||||||
|
var dynamic = grabInfo.cloneDynamic ? grabInfo.cloneDynamic : false;
|
||||||
|
var cUserData = Object.assign({}, userData);
|
||||||
|
var cProperties = Object.assign({}, cloneableProps);
|
||||||
|
isClone = true;
|
||||||
|
|
||||||
|
if (count > limit) {
|
||||||
|
delete cloneableProps;
|
||||||
|
delete lifetime;
|
||||||
|
delete cUserData;
|
||||||
|
delete cProperties;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
delete cUserData.grabbableKey.cloneLifetime;
|
||||||
|
delete cUserData.grabbableKey.cloneable;
|
||||||
|
delete cUserData.grabbableKey.cloneDynamic;
|
||||||
|
delete cUserData.grabbableKey.cloneLimit;
|
||||||
|
delete cProperties.id
|
||||||
|
|
||||||
|
cProperties.dynamic = dynamic;
|
||||||
|
cProperties.locked = false;
|
||||||
|
cUserData.grabbableKey.triggerable = true;
|
||||||
|
cUserData.grabbableKey.grabbable = true;
|
||||||
|
cProperties.lifetime = lifetime;
|
||||||
|
cProperties.userData = JSON.stringify(cUserData);
|
||||||
|
var cloneID = Entities.addEntity(cProperties);
|
||||||
|
this.grabbedThingID = cloneID;
|
||||||
|
grabbedProperties = Entities.getEntityProperties(cloneID);
|
||||||
|
}
|
||||||
|
}catch(e) {}
|
||||||
|
}
|
||||||
Entities.editEntity(this.grabbedThingID, reparentProps);
|
Entities.editEntity(this.grabbedThingID, reparentProps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2458,7 +2541,6 @@ function MyController(hand) {
|
||||||
this.previousParentID[this.grabbedThingID] = grabbedProperties.parentID;
|
this.previousParentID[this.grabbedThingID] = grabbedProperties.parentID;
|
||||||
this.previousParentJointIndex[this.grabbedThingID] = grabbedProperties.parentJointIndex;
|
this.previousParentJointIndex[this.grabbedThingID] = grabbedProperties.parentJointIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
Messages.sendMessage('Hifi-Object-Manipulation', JSON.stringify({
|
Messages.sendMessage('Hifi-Object-Manipulation', JSON.stringify({
|
||||||
action: 'equip',
|
action: 'equip',
|
||||||
grabbedEntity: this.grabbedThingID,
|
grabbedEntity: this.grabbedThingID,
|
||||||
|
@ -2474,22 +2556,37 @@ function MyController(hand) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.state == STATE_NEAR_GRABBING) {
|
var _this = this;
|
||||||
this.callEntityMethodOnGrabbed("startNearGrab");
|
/*
|
||||||
} else { // this.state == STATE_HOLD
|
* Setting context for function that is either called via timer or directly, depending if
|
||||||
this.callEntityMethodOnGrabbed("startEquip");
|
* if the object in question is a clone. If it is a clone, we need to make sure that the intial equipment event
|
||||||
|
* is called correctly, as these just freshly created entity may not have completely initialized.
|
||||||
|
*/
|
||||||
|
var grabEquipCheck = function () {
|
||||||
|
if (_this.state == STATE_NEAR_GRABBING) {
|
||||||
|
_this.callEntityMethodOnGrabbed("startNearGrab");
|
||||||
|
} else { // this.state == STATE_HOLD
|
||||||
|
_this.callEntityMethodOnGrabbed("startEquip");
|
||||||
|
}
|
||||||
|
|
||||||
|
_this.currentHandControllerTipPosition =
|
||||||
|
(_this.hand === RIGHT_HAND) ? MyAvatar.rightHandTipPosition : MyAvatar.leftHandTipPosition;
|
||||||
|
_this.currentObjectTime = Date.now();
|
||||||
|
|
||||||
|
_this.currentObjectPosition = grabbedProperties.position;
|
||||||
|
_this.currentObjectRotation = grabbedProperties.rotation;
|
||||||
|
_this.currentVelocity = ZERO_VEC;
|
||||||
|
_this.currentAngularVelocity = ZERO_VEC;
|
||||||
|
|
||||||
|
_this.prevDropDetected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.currentHandControllerTipPosition =
|
if (isClone) {
|
||||||
(this.hand === RIGHT_HAND) ? MyAvatar.rightHandTipPosition : MyAvatar.leftHandTipPosition;
|
// 100 ms seems to be sufficient time to force the check even occur after the object has been initialized.
|
||||||
this.currentObjectTime = Date.now();
|
Script.setTimeout(grabEquipCheck, 100);
|
||||||
|
} else {
|
||||||
this.currentObjectPosition = grabbedProperties.position;
|
grabEquipCheck();
|
||||||
this.currentObjectRotation = grabbedProperties.rotation;
|
}
|
||||||
this.currentVelocity = ZERO_VEC;
|
|
||||||
this.currentAngularVelocity = ZERO_VEC;
|
|
||||||
|
|
||||||
this.prevDropDetected = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.nearGrabbing = function(deltaTime, timestamp) {
|
this.nearGrabbing = function(deltaTime, timestamp) {
|
||||||
|
|
|
@ -57,6 +57,7 @@ selectionManager.addEventListener(function () {
|
||||||
lightOverlayManager.updatePositions();
|
lightOverlayManager.updatePositions();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const KEY_P = 80; //Key code for letter p used for Parenting hotkey.
|
||||||
var DEGREES_TO_RADIANS = Math.PI / 180.0;
|
var DEGREES_TO_RADIANS = Math.PI / 180.0;
|
||||||
var RADIANS_TO_DEGREES = 180.0 / Math.PI;
|
var RADIANS_TO_DEGREES = 180.0 / Math.PI;
|
||||||
|
|
||||||
|
@ -170,8 +171,6 @@ var toolBar = (function () {
|
||||||
tablet = null;
|
tablet = null;
|
||||||
|
|
||||||
function createNewEntity(properties) {
|
function createNewEntity(properties) {
|
||||||
Settings.setValue(EDIT_SETTING, false);
|
|
||||||
|
|
||||||
var dimensions = properties.dimensions ? properties.dimensions : DEFAULT_DIMENSIONS;
|
var dimensions = properties.dimensions ? properties.dimensions : DEFAULT_DIMENSIONS;
|
||||||
var position = getPositionToCreateEntity();
|
var position = getPositionToCreateEntity();
|
||||||
var entityID = null;
|
var entityID = null;
|
||||||
|
@ -822,7 +821,6 @@ function setupModelMenus() {
|
||||||
});
|
});
|
||||||
modelMenuAddedDelete = true;
|
modelMenuAddedDelete = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
menuName: "Edit",
|
menuName: "Edit",
|
||||||
menuItemName: "Entity List...",
|
menuItemName: "Entity List...",
|
||||||
|
@ -830,11 +828,25 @@ function setupModelMenus() {
|
||||||
afterItem: "Entities",
|
afterItem: "Entities",
|
||||||
grouping: "Advanced"
|
grouping: "Advanced"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Menu.addMenuItem({
|
||||||
|
menuName: "Edit",
|
||||||
|
menuItemName: "Parent Entity to Last",
|
||||||
|
afterItem: "Entity List...",
|
||||||
|
grouping: "Advanced"
|
||||||
|
});
|
||||||
|
|
||||||
|
Menu.addMenuItem({
|
||||||
|
menuName: "Edit",
|
||||||
|
menuItemName: "Unparent Entity",
|
||||||
|
afterItem: "Parent Entity to Last",
|
||||||
|
grouping: "Advanced"
|
||||||
|
});
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
menuName: "Edit",
|
menuName: "Edit",
|
||||||
menuItemName: "Allow Selecting of Large Models",
|
menuItemName: "Allow Selecting of Large Models",
|
||||||
shortcutKey: "CTRL+META+L",
|
shortcutKey: "CTRL+META+L",
|
||||||
afterItem: "Entity List...",
|
afterItem: "Unparent Entity",
|
||||||
isCheckable: true,
|
isCheckable: true,
|
||||||
isChecked: true,
|
isChecked: true,
|
||||||
grouping: "Advanced"
|
grouping: "Advanced"
|
||||||
|
@ -937,6 +949,8 @@ function cleanupModelMenus() {
|
||||||
Menu.removeMenuItem("Edit", "Delete");
|
Menu.removeMenuItem("Edit", "Delete");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Menu.removeMenuItem("Edit", "Parent Entity to Last");
|
||||||
|
Menu.removeMenuItem("Edit", "Unparent Entity");
|
||||||
Menu.removeMenuItem("Edit", "Entity List...");
|
Menu.removeMenuItem("Edit", "Entity List...");
|
||||||
Menu.removeMenuItem("Edit", "Allow Selecting of Large Models");
|
Menu.removeMenuItem("Edit", "Allow Selecting of Large Models");
|
||||||
Menu.removeMenuItem("Edit", "Allow Selecting of Small Models");
|
Menu.removeMenuItem("Edit", "Allow Selecting of Small Models");
|
||||||
|
@ -969,6 +983,9 @@ Script.scriptEnding.connect(function () {
|
||||||
|
|
||||||
Overlays.deleteOverlay(importingSVOImageOverlay);
|
Overlays.deleteOverlay(importingSVOImageOverlay);
|
||||||
Overlays.deleteOverlay(importingSVOTextOverlay);
|
Overlays.deleteOverlay(importingSVOTextOverlay);
|
||||||
|
|
||||||
|
Controller.keyReleaseEvent.disconnect(keyReleaseEvent);
|
||||||
|
Controller.keyPressEvent.disconnect(keyPressEvent);
|
||||||
});
|
});
|
||||||
|
|
||||||
var lastOrientation = null;
|
var lastOrientation = null;
|
||||||
|
@ -1080,7 +1097,68 @@ function recursiveDelete(entities, childrenList) {
|
||||||
Entities.deleteEntity(entityID);
|
Entities.deleteEntity(entityID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function unparentSelectedEntities() {
|
||||||
|
if (SelectionManager.hasSelection()) {
|
||||||
|
var selectedEntities = selectionManager.selections;
|
||||||
|
var parentCheck = false;
|
||||||
|
|
||||||
|
if (selectedEntities.length < 1) {
|
||||||
|
Window.notifyEditError("You must have an entity selected inorder to unparent it.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
selectedEntities.forEach(function (id, index) {
|
||||||
|
var parentId = Entities.getEntityProperties(id, ["parentID"]).parentID;
|
||||||
|
if (parentId !== null && parentId.length > 0 && parentId !== "{00000000-0000-0000-0000-000000000000}") {
|
||||||
|
parentCheck = true;
|
||||||
|
}
|
||||||
|
Entities.editEntity(id, {parentID: null})
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
if (parentCheck) {
|
||||||
|
if (selectedEntities.length > 1) {
|
||||||
|
Window.notify("Entities unparented");
|
||||||
|
} else {
|
||||||
|
Window.notify("Entity unparented");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (selectedEntities.length > 1) {
|
||||||
|
Window.notify("Selected Entities have no parents");
|
||||||
|
} else {
|
||||||
|
Window.notify("Selected Entity does not have a parent");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Window.notifyEditError("You have nothing selected to unparent");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function parentSelectedEntities() {
|
||||||
|
if (SelectionManager.hasSelection()) {
|
||||||
|
var selectedEntities = selectionManager.selections;
|
||||||
|
if (selectedEntities.length <= 1) {
|
||||||
|
Window.notifyEditError("You must have multiple entities selected in order to parent them");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var parentCheck = false;
|
||||||
|
var lastEntityId = selectedEntities[selectedEntities.length-1];
|
||||||
|
selectedEntities.forEach(function (id, index) {
|
||||||
|
if (lastEntityId !== id) {
|
||||||
|
var parentId = Entities.getEntityProperties(id, ["parentID"]).parentID;
|
||||||
|
if (parentId !== lastEntityId) {
|
||||||
|
parentCheck = true;
|
||||||
|
}
|
||||||
|
Entities.editEntity(id, {parentID: lastEntityId})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(parentCheck) {
|
||||||
|
Window.notify("Entities parented");
|
||||||
|
}else {
|
||||||
|
Window.notify("Entities are already parented to last");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Window.notifyEditError("You have nothing selected to parent");
|
||||||
|
}
|
||||||
|
}
|
||||||
function deleteSelectedEntities() {
|
function deleteSelectedEntities() {
|
||||||
if (SelectionManager.hasSelection()) {
|
if (SelectionManager.hasSelection()) {
|
||||||
selectedParticleEntity = 0;
|
selectedParticleEntity = 0;
|
||||||
|
@ -1143,6 +1221,10 @@ function handeMenuEvent(menuItem) {
|
||||||
Entities.setLightsArePickable(Menu.isOptionChecked("Allow Selecting of Lights"));
|
Entities.setLightsArePickable(Menu.isOptionChecked("Allow Selecting of Lights"));
|
||||||
} else if (menuItem === "Delete") {
|
} else if (menuItem === "Delete") {
|
||||||
deleteSelectedEntities();
|
deleteSelectedEntities();
|
||||||
|
} else if (menuItem === "Parent Entity to Last") {
|
||||||
|
parentSelectedEntities();
|
||||||
|
} else if (menuItem === "Unparent Entity") {
|
||||||
|
unparentSelectedEntities();
|
||||||
} else if (menuItem === "Export Entities") {
|
} else if (menuItem === "Export Entities") {
|
||||||
if (!selectionManager.hasSelection()) {
|
if (!selectionManager.hasSelection()) {
|
||||||
Window.notifyEditError("No entities have been selected.");
|
Window.notifyEditError("No entities have been selected.");
|
||||||
|
@ -1268,13 +1350,12 @@ Window.svoImportRequested.connect(importSVO);
|
||||||
|
|
||||||
Menu.menuItemEvent.connect(handeMenuEvent);
|
Menu.menuItemEvent.connect(handeMenuEvent);
|
||||||
|
|
||||||
Controller.keyPressEvent.connect(function (event) {
|
var keyPressEvent = function (event) {
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
cameraManager.keyPressEvent(event);
|
cameraManager.keyPressEvent(event);
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
var keyReleaseEvent = function (event) {
|
||||||
Controller.keyReleaseEvent.connect(function (event) {
|
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
cameraManager.keyReleaseEvent(event);
|
cameraManager.keyReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
@ -1308,8 +1389,16 @@ Controller.keyReleaseEvent.connect(function (event) {
|
||||||
});
|
});
|
||||||
grid.setPosition(newPosition);
|
grid.setPosition(newPosition);
|
||||||
}
|
}
|
||||||
|
} else if (event.key === KEY_P && event.isControl && !event.isAutoRepeat ) {
|
||||||
|
if (event.isShifted) {
|
||||||
|
unparentSelectedEntities();
|
||||||
|
} else {
|
||||||
|
parentSelectedEntities();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
Controller.keyReleaseEvent.connect(keyReleaseEvent);
|
||||||
|
Controller.keyPressEvent.connect(keyPressEvent);
|
||||||
|
|
||||||
function recursiveAdd(newParentID, parentData) {
|
function recursiveAdd(newParentID, parentData) {
|
||||||
var children = parentData.children;
|
var children = parentData.children;
|
||||||
|
@ -1557,6 +1646,10 @@ var PropertiesTool = function (opts) {
|
||||||
}
|
}
|
||||||
pushCommandForSelections();
|
pushCommandForSelections();
|
||||||
selectionManager._update();
|
selectionManager._update();
|
||||||
|
} else if(data.type === 'parent') {
|
||||||
|
parentSelectedEntities();
|
||||||
|
} else if(data.type === 'unparent') {
|
||||||
|
unparentSelectedEntities();
|
||||||
} else if(data.type === 'saveUserData'){
|
} else if(data.type === 'saveUserData'){
|
||||||
//the event bridge and json parsing handle our avatar id string differently.
|
//the event bridge and json parsing handle our avatar id string differently.
|
||||||
var actualID = data.id.split('"')[1];
|
var actualID = data.id.split('"')[1];
|
||||||
|
@ -1814,6 +1907,9 @@ var PopupMenu = function () {
|
||||||
for (var i = 0; i < overlays.length; i++) {
|
for (var i = 0; i < overlays.length; i++) {
|
||||||
Overlays.deleteOverlay(overlays[i]);
|
Overlays.deleteOverlay(overlays[i]);
|
||||||
}
|
}
|
||||||
|
Controller.mousePressEvent.disconnect(self.mousePressEvent);
|
||||||
|
Controller.mouseMoveEvent.disconnect(self.mouseMoveEvent);
|
||||||
|
Controller.mouseReleaseEvent.disconnect(self.mouseReleaseEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
Controller.mousePressEvent.connect(self.mousePressEvent);
|
Controller.mousePressEvent.connect(self.mousePressEvent);
|
||||||
|
@ -1856,7 +1952,11 @@ function selectParticleEntity(entityID) {
|
||||||
|
|
||||||
entityListTool.webView.webEventReceived.connect(function (data) {
|
entityListTool.webView.webEventReceived.connect(function (data) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
if (data.type === "selectionUpdate") {
|
if(data.type === 'parent') {
|
||||||
|
parentSelectedEntities();
|
||||||
|
} else if(data.type === 'unparent') {
|
||||||
|
unparentSelectedEntities();
|
||||||
|
} else if (data.type === "selectionUpdate") {
|
||||||
var ids = data.entityIds;
|
var ids = data.entityIds;
|
||||||
if (ids.length === 1) {
|
if (ids.length === 1) {
|
||||||
if (Entities.getEntityProperties(ids[0], "type").type === "ParticleEffect") {
|
if (Entities.getEntityProperties(ids[0], "type").type === "ParticleEffect") {
|
||||||
|
|
|
@ -89,6 +89,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div id="no-entities">
|
<div id="no-entities">
|
||||||
No entities found <span id="no-entities-in-view">in view</span> within a <span id="no-entities-radius">100</span> meter radius. Try moving to a different location and refreshing.
|
No entities found <span id="no-entities-in-view">in view</span> within a <span id="no-entities-radius">100</span> meter radius. Try moving to a different location and refreshing.
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
<label for="property-description">Description</label>
|
<label for="property-description">Description</label>
|
||||||
<input type="text" id="property-description">
|
<input type="text" id="property-description">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="property textarea">
|
<div class="property textarea">
|
||||||
<label for="property-user-data">User data</label>
|
<label for="property-user-data">User data</label>
|
||||||
<br>
|
<br>
|
||||||
|
@ -295,12 +295,29 @@
|
||||||
<input type="checkbox" id="property-wants-trigger">
|
<input type="checkbox" id="property-wants-trigger">
|
||||||
<label for="property-wants-trigger">Triggerable</label>
|
<label for="property-wants-trigger">Triggerable</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="property checkbox">
|
||||||
|
<input type="checkbox" id="property-cloneable">
|
||||||
|
<label for="property-cloneable">Cloneable</label>
|
||||||
|
</div>
|
||||||
<div class="property checkbox">
|
<div class="property checkbox">
|
||||||
<input type="checkbox" id="property-ignore-ik">
|
<input type="checkbox" id="property-ignore-ik">
|
||||||
<label for="property-ignore-ik">Ignore inverse kinematics</label>
|
<label for="property-ignore-ik">Ignore inverse kinematics</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="column" id="group-cloneable-group" style="display:none;">
|
||||||
|
<div class="sub-section-header">
|
||||||
|
<span>Cloneable Settings</span>
|
||||||
|
</div>
|
||||||
|
<div class="cloneable-group property gen">
|
||||||
|
<div><label>Clone Lifetime</label><input type="number" data-user-data-type="cloneLifetime" id="property-cloneable-lifetime"></div>
|
||||||
|
<div><label>Clone Limit</label><input type="number" data-user-data-type="cloneLimit" id="property-cloneable-limit"></div>
|
||||||
|
<div class="property checkbox">
|
||||||
|
<input type="checkbox" id="property-cloneable-dynamic">
|
||||||
|
<label for="property-cloneable-dynamic">Clone Dynamic</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr class="behavior-group" />
|
<hr class="behavior-group" />
|
||||||
<div class="behavior-group property url ">
|
<div class="behavior-group property url ">
|
||||||
|
|
|
@ -19,6 +19,7 @@ const VISIBLE_GLYPH = "";
|
||||||
const TRANSPARENCY_GLYPH = "";
|
const TRANSPARENCY_GLYPH = "";
|
||||||
const SCRIPT_GLYPH = "k";
|
const SCRIPT_GLYPH = "k";
|
||||||
const DELETE = 46; // Key code for the delete key.
|
const DELETE = 46; // Key code for the delete key.
|
||||||
|
const KEY_P = 80; // Key code for letter p used for Parenting hotkey.
|
||||||
const MAX_ITEMS = Number.MAX_VALUE; // Used to set the max length of the list of discovered entities.
|
const MAX_ITEMS = Number.MAX_VALUE; // Used to set the max length of the list of discovered entities.
|
||||||
|
|
||||||
debugPrint = function (message) {
|
debugPrint = function (message) {
|
||||||
|
@ -26,7 +27,7 @@ debugPrint = function (message) {
|
||||||
};
|
};
|
||||||
|
|
||||||
function loaded() {
|
function loaded() {
|
||||||
openEventBridge(function() {
|
openEventBridge(function() {
|
||||||
entityList = new List('entity-list', { valueNames: ['name', 'type', 'url', 'locked', 'visible'], page: MAX_ITEMS});
|
entityList = new List('entity-list', { valueNames: ['name', 'type', 'url', 'locked', 'visible'], page: MAX_ITEMS});
|
||||||
entityList.clear();
|
entityList.clear();
|
||||||
elEntityTable = document.getElementById("entity-table");
|
elEntityTable = document.getElementById("entity-table");
|
||||||
|
@ -48,7 +49,7 @@ function loaded() {
|
||||||
elNoEntitiesInView = document.getElementById("no-entities-in-view");
|
elNoEntitiesInView = document.getElementById("no-entities-in-view");
|
||||||
elNoEntitiesRadius = document.getElementById("no-entities-radius");
|
elNoEntitiesRadius = document.getElementById("no-entities-radius");
|
||||||
elEntityTableScroll = document.getElementById("entity-table-scroll");
|
elEntityTableScroll = document.getElementById("entity-table-scroll");
|
||||||
|
|
||||||
document.getElementById("entity-name").onclick = function() {
|
document.getElementById("entity-name").onclick = function() {
|
||||||
setSortColumn('name');
|
setSortColumn('name');
|
||||||
};
|
};
|
||||||
|
@ -90,7 +91,7 @@ function loaded() {
|
||||||
selection = selection.concat(selectedEntities);
|
selection = selection.concat(selectedEntities);
|
||||||
} else if (clickEvent.shiftKey && selectedEntities.length > 0) {
|
} else if (clickEvent.shiftKey && selectedEntities.length > 0) {
|
||||||
var previousItemFound = -1;
|
var previousItemFound = -1;
|
||||||
var clickedItemFound = -1;
|
var clickedItemFound = -1;
|
||||||
for (var entity in entityList.visibleItems) {
|
for (var entity in entityList.visibleItems) {
|
||||||
if (clickedItemFound === -1 && this.dataset.entityId == entityList.visibleItems[entity].values().id) {
|
if (clickedItemFound === -1 && this.dataset.entityId == entityList.visibleItems[entity].values().id) {
|
||||||
clickedItemFound = entity;
|
clickedItemFound = entity;
|
||||||
|
@ -113,11 +114,11 @@ function loaded() {
|
||||||
selection = selection.concat(betweenItems, selectedEntities);
|
selection = selection.concat(betweenItems, selectedEntities);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
selectedEntities = selection;
|
selectedEntities = selection;
|
||||||
|
|
||||||
this.className = 'selected';
|
this.className = 'selected';
|
||||||
|
|
||||||
EventBridge.emitWebEvent(JSON.stringify({
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
type: "selectionUpdate",
|
type: "selectionUpdate",
|
||||||
focus: false,
|
focus: false,
|
||||||
|
@ -126,7 +127,7 @@ function loaded() {
|
||||||
|
|
||||||
refreshFooter();
|
refreshFooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onRowDoubleClicked() {
|
function onRowDoubleClicked() {
|
||||||
EventBridge.emitWebEvent(JSON.stringify({
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
type: "selectionUpdate",
|
type: "selectionUpdate",
|
||||||
|
@ -134,7 +135,7 @@ function loaded() {
|
||||||
entityIds: [this.dataset.entityId],
|
entityIds: [this.dataset.entityId],
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
const BYTES_PER_MEGABYTE = 1024 * 1024;
|
const BYTES_PER_MEGABYTE = 1024 * 1024;
|
||||||
|
|
||||||
function decimalMegabytes(number) {
|
function decimalMegabytes(number) {
|
||||||
|
@ -173,7 +174,7 @@ function loaded() {
|
||||||
currentElement.onclick = onRowClicked;
|
currentElement.onclick = onRowClicked;
|
||||||
currentElement.ondblclick = onRowDoubleClicked;
|
currentElement.ondblclick = onRowDoubleClicked;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (refreshEntityListTimer) {
|
if (refreshEntityListTimer) {
|
||||||
clearTimeout(refreshEntityListTimer);
|
clearTimeout(refreshEntityListTimer);
|
||||||
}
|
}
|
||||||
|
@ -183,13 +184,13 @@ function loaded() {
|
||||||
item.values({ name: name, url: filename, locked: locked, visible: visible });
|
item.values({ name: name, url: filename, locked: locked, visible: visible });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearEntities() {
|
function clearEntities() {
|
||||||
entities = {};
|
entities = {};
|
||||||
entityList.clear();
|
entityList.clear();
|
||||||
refreshFooter();
|
refreshFooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
var elSortOrder = {
|
var elSortOrder = {
|
||||||
name: document.querySelector('#entity-name .sort-order'),
|
name: document.querySelector('#entity-name .sort-order'),
|
||||||
type: document.querySelector('#entity-type .sort-order'),
|
type: document.querySelector('#entity-type .sort-order'),
|
||||||
|
@ -215,12 +216,12 @@ function loaded() {
|
||||||
entityList.sort(currentSortColumn, { order: currentSortOrder });
|
entityList.sort(currentSortColumn, { order: currentSortOrder });
|
||||||
}
|
}
|
||||||
setSortColumn('type');
|
setSortColumn('type');
|
||||||
|
|
||||||
function refreshEntities() {
|
function refreshEntities() {
|
||||||
clearEntities();
|
clearEntities();
|
||||||
EventBridge.emitWebEvent(JSON.stringify({ type: 'refresh' }));
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'refresh' }));
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshFooter() {
|
function refreshFooter() {
|
||||||
if (selectedEntities.length > 1) {
|
if (selectedEntities.length > 1) {
|
||||||
elFooter.firstChild.nodeValue = selectedEntities.length + " entities selected";
|
elFooter.firstChild.nodeValue = selectedEntities.length + " entities selected";
|
||||||
|
@ -239,7 +240,7 @@ function loaded() {
|
||||||
entityList.search(elFilter.value);
|
entityList.search(elFilter.value);
|
||||||
refreshFooter();
|
refreshFooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSelectedEntities(selectedIDs) {
|
function updateSelectedEntities(selectedIDs) {
|
||||||
var notFound = false;
|
var notFound = false;
|
||||||
for (var id in entities) {
|
for (var id in entities) {
|
||||||
|
@ -262,7 +263,7 @@ function loaded() {
|
||||||
|
|
||||||
return notFound;
|
return notFound;
|
||||||
}
|
}
|
||||||
|
|
||||||
elRefresh.onclick = function() {
|
elRefresh.onclick = function() {
|
||||||
refreshEntities();
|
refreshEntities();
|
||||||
}
|
}
|
||||||
|
@ -282,7 +283,7 @@ function loaded() {
|
||||||
EventBridge.emitWebEvent(JSON.stringify({ type: 'delete' }));
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'delete' }));
|
||||||
refreshEntities();
|
refreshEntities();
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener("keydown", function (keyDownEvent) {
|
document.addEventListener("keydown", function (keyDownEvent) {
|
||||||
if (keyDownEvent.target.nodeName === "INPUT") {
|
if (keyDownEvent.target.nodeName === "INPUT") {
|
||||||
return;
|
return;
|
||||||
|
@ -292,8 +293,15 @@ function loaded() {
|
||||||
EventBridge.emitWebEvent(JSON.stringify({ type: 'delete' }));
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'delete' }));
|
||||||
refreshEntities();
|
refreshEntities();
|
||||||
}
|
}
|
||||||
|
if (keyDownEvent.keyCode === KEY_P && keyDownEvent.ctrlKey) {
|
||||||
|
if (keyDownEvent.shiftKey) {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'unparent' }));
|
||||||
|
} else {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'parent' }));
|
||||||
|
}
|
||||||
|
}
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
var isFilterInView = false;
|
var isFilterInView = false;
|
||||||
var FILTER_IN_VIEW_ATTRIBUTE = "pressed";
|
var FILTER_IN_VIEW_ATTRIBUTE = "pressed";
|
||||||
elNoEntitiesInView.style.display = "none";
|
elNoEntitiesInView.style.display = "none";
|
||||||
|
@ -320,7 +328,7 @@ function loaded() {
|
||||||
if (window.EventBridge !== undefined) {
|
if (window.EventBridge !== undefined) {
|
||||||
EventBridge.scriptEventReceived.connect(function(data) {
|
EventBridge.scriptEventReceived.connect(function(data) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
|
|
||||||
if (data.type === "clearEntityList") {
|
if (data.type === "clearEntityList") {
|
||||||
clearEntities();
|
clearEntities();
|
||||||
} else if (data.type == "selectionUpdate") {
|
} else if (data.type == "selectionUpdate") {
|
||||||
|
@ -426,4 +434,3 @@ function loaded() {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}, false);
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,10 @@ var ICON_FOR_TYPE = {
|
||||||
}
|
}
|
||||||
|
|
||||||
var EDITOR_TIMEOUT_DURATION = 1500;
|
var EDITOR_TIMEOUT_DURATION = 1500;
|
||||||
|
const KEY_P = 80; //Key code for letter p used for Parenting hotkey.
|
||||||
var colorPickers = [];
|
var colorPickers = [];
|
||||||
var lastEntityID = null;
|
var lastEntityID = null;
|
||||||
|
|
||||||
debugPrint = function(message) {
|
debugPrint = function(message) {
|
||||||
EventBridge.emitWebEvent(
|
EventBridge.emitWebEvent(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
|
@ -273,7 +274,7 @@ function updateCheckedSubProperty(propertyName, propertyValue, subPropertyElemen
|
||||||
propertyValue += subPropertyString + ',';
|
propertyValue += subPropertyString + ',';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// We've unchecked, so remove
|
// We've unchecked, so remove
|
||||||
propertyValue = propertyValue.replace(subPropertyString + ",", "");
|
propertyValue = propertyValue.replace(subPropertyString + ",", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,13 +324,9 @@ function setUserDataFromEditor(noUpdate) {
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
function multiDataUpdater(groupName, updateKeyPair, userDataElement, defaults) {
|
||||||
function userDataChanger(groupName, keyName, checkBoxElement, userDataElement, defaultValue) {
|
|
||||||
var properties = {};
|
var properties = {};
|
||||||
var parsedData = {};
|
var parsedData = {};
|
||||||
try {
|
try {
|
||||||
|
@ -339,17 +336,31 @@ function userDataChanger(groupName, keyName, checkBoxElement, userDataElement, d
|
||||||
} else {
|
} else {
|
||||||
parsedData = JSON.parse(userDataElement.value);
|
parsedData = JSON.parse(userDataElement.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
if (!(groupName in parsedData)) {
|
if (!(groupName in parsedData)) {
|
||||||
parsedData[groupName] = {}
|
parsedData[groupName] = {}
|
||||||
}
|
}
|
||||||
delete parsedData[groupName][keyName];
|
var keys = Object.keys(updateKeyPair);
|
||||||
if (checkBoxElement.checked !== defaultValue) {
|
keys.forEach(function (key) {
|
||||||
parsedData[groupName][keyName] = checkBoxElement.checked;
|
delete parsedData[groupName][key];
|
||||||
}
|
if (updateKeyPair[key] !== null && updateKeyPair[key] !== "null") {
|
||||||
|
if (updateKeyPair[key] instanceof Element) {
|
||||||
|
if(updateKeyPair[key].type === "checkbox") {
|
||||||
|
if (updateKeyPair[key].checked !== defaults[key]) {
|
||||||
|
parsedData[groupName][key] = updateKeyPair[key].checked;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var val = isNaN(updateKeyPair[key].value) ? updateKeyPair[key].value : parseInt(updateKeyPair[key].value);
|
||||||
|
if (val !== defaults[key]) {
|
||||||
|
parsedData[groupName][key] = val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
parsedData[groupName][key] = updateKeyPair[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
if (Object.keys(parsedData[groupName]).length == 0) {
|
if (Object.keys(parsedData[groupName]).length == 0) {
|
||||||
delete parsedData[groupName];
|
delete parsedData[groupName];
|
||||||
}
|
}
|
||||||
|
@ -368,6 +379,12 @@ function userDataChanger(groupName, keyName, checkBoxElement, userDataElement, d
|
||||||
properties: properties,
|
properties: properties,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
function userDataChanger(groupName, keyName, values, userDataElement, defaultValue) {
|
||||||
|
var val = {}, def = {};
|
||||||
|
val[keyName] = values;
|
||||||
|
def[keyName] = defaultValue;
|
||||||
|
multiDataUpdater(groupName, val, userDataElement, def);
|
||||||
};
|
};
|
||||||
|
|
||||||
function setTextareaScrolling(element) {
|
function setTextareaScrolling(element) {
|
||||||
|
@ -521,6 +538,7 @@ function unbindAllInputs() {
|
||||||
|
|
||||||
function loaded() {
|
function loaded() {
|
||||||
openEventBridge(function() {
|
openEventBridge(function() {
|
||||||
|
|
||||||
var allSections = [];
|
var allSections = [];
|
||||||
var elID = document.getElementById("property-id");
|
var elID = document.getElementById("property-id");
|
||||||
var elType = document.getElementById("property-type");
|
var elType = document.getElementById("property-type");
|
||||||
|
@ -584,6 +602,13 @@ function loaded() {
|
||||||
var elCollisionSoundURL = document.getElementById("property-collision-sound-url");
|
var elCollisionSoundURL = document.getElementById("property-collision-sound-url");
|
||||||
|
|
||||||
var elGrabbable = document.getElementById("property-grabbable");
|
var elGrabbable = document.getElementById("property-grabbable");
|
||||||
|
|
||||||
|
var elCloneable = document.getElementById("property-cloneable");
|
||||||
|
var elCloneableDynamic = document.getElementById("property-cloneable-dynamic");
|
||||||
|
var elCloneableGroup = document.getElementById("group-cloneable-group");
|
||||||
|
var elCloneableLifetime = document.getElementById("property-cloneable-lifetime");
|
||||||
|
var elCloneableLimit = document.getElementById("property-cloneable-limit");
|
||||||
|
|
||||||
var elWantsTrigger = document.getElementById("property-wants-trigger");
|
var elWantsTrigger = document.getElementById("property-wants-trigger");
|
||||||
var elIgnoreIK = document.getElementById("property-ignore-ik");
|
var elIgnoreIK = document.getElementById("property-ignore-ik");
|
||||||
|
|
||||||
|
@ -780,7 +805,7 @@ function loaded() {
|
||||||
if (lastEntityID !== '"' + properties.id + '"' && lastEntityID !== null && editor !== null) {
|
if (lastEntityID !== '"' + properties.id + '"' && lastEntityID !== null && editor !== null) {
|
||||||
saveJSONUserData(true);
|
saveJSONUserData(true);
|
||||||
}
|
}
|
||||||
//the event bridge and json parsing handle our avatar id string differently.
|
//the event bridge and json parsing handle our avatar id string differently.
|
||||||
|
|
||||||
lastEntityID = '"' + properties.id + '"';
|
lastEntityID = '"' + properties.id + '"';
|
||||||
elID.value = properties.id;
|
elID.value = properties.id;
|
||||||
|
@ -847,8 +872,16 @@ function loaded() {
|
||||||
elCollideOtherAvatar.checked = properties.collidesWith.indexOf("otherAvatar") > -1;
|
elCollideOtherAvatar.checked = properties.collidesWith.indexOf("otherAvatar") > -1;
|
||||||
|
|
||||||
elGrabbable.checked = properties.dynamic;
|
elGrabbable.checked = properties.dynamic;
|
||||||
|
|
||||||
elWantsTrigger.checked = false;
|
elWantsTrigger.checked = false;
|
||||||
elIgnoreIK.checked = true;
|
elIgnoreIK.checked = true;
|
||||||
|
|
||||||
|
elCloneable.checked = false;
|
||||||
|
elCloneableDynamic.checked = false;
|
||||||
|
elCloneableGroup.style.display = elCloneable.checked ? "block": "none";
|
||||||
|
elCloneableLimit.value = 10;
|
||||||
|
elCloneableLifetime.value = 300;
|
||||||
|
|
||||||
var parsedUserData = {}
|
var parsedUserData = {}
|
||||||
try {
|
try {
|
||||||
parsedUserData = JSON.parse(properties.userData);
|
parsedUserData = JSON.parse(properties.userData);
|
||||||
|
@ -863,8 +896,25 @@ function loaded() {
|
||||||
if ("ignoreIK" in parsedUserData["grabbableKey"]) {
|
if ("ignoreIK" in parsedUserData["grabbableKey"]) {
|
||||||
elIgnoreIK.checked = parsedUserData["grabbableKey"].ignoreIK;
|
elIgnoreIK.checked = parsedUserData["grabbableKey"].ignoreIK;
|
||||||
}
|
}
|
||||||
|
if ("cloneable" in parsedUserData["grabbableKey"]) {
|
||||||
|
elCloneable.checked = parsedUserData["grabbableKey"].cloneable;
|
||||||
|
elCloneableGroup.style.display = elCloneable.checked ? "block": "none";
|
||||||
|
elCloneableLimit.value = elCloneable.checked ? 10: 0;
|
||||||
|
elCloneableLifetime.value = elCloneable.checked ? 300: 0;
|
||||||
|
elCloneableDynamic.checked = parsedUserData["grabbableKey"].cloneDynamic ? parsedUserData["grabbableKey"].cloneDynamic : properties.dynamic;
|
||||||
|
elDynamic.checked = elCloneable.checked ? false: properties.dynamic;
|
||||||
|
if (elCloneable.checked) {
|
||||||
|
if ("cloneLifetime" in parsedUserData["grabbableKey"]) {
|
||||||
|
elCloneableLifetime.value = parsedUserData["grabbableKey"].cloneLifetime ? parsedUserData["grabbableKey"].cloneLifetime : 300;
|
||||||
|
}
|
||||||
|
if ("cloneLimit" in parsedUserData["grabbableKey"]) {
|
||||||
|
elCloneableLimit.value = parsedUserData["grabbableKey"].cloneLimit ? parsedUserData["grabbableKey"].cloneLimit : 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {
|
||||||
|
}
|
||||||
|
|
||||||
elCollisionSoundURL.value = properties.collisionSoundURL;
|
elCollisionSoundURL.value = properties.collisionSoundURL;
|
||||||
elLifetime.value = properties.lifetime;
|
elLifetime.value = properties.lifetime;
|
||||||
|
@ -1154,8 +1204,38 @@ function loaded() {
|
||||||
});
|
});
|
||||||
|
|
||||||
elGrabbable.addEventListener('change', function() {
|
elGrabbable.addEventListener('change', function() {
|
||||||
|
if(elCloneable.checked) {
|
||||||
|
elGrabbable.checked = false;
|
||||||
|
}
|
||||||
userDataChanger("grabbableKey", "grabbable", elGrabbable, elUserData, properties.dynamic);
|
userDataChanger("grabbableKey", "grabbable", elGrabbable, elUserData, properties.dynamic);
|
||||||
});
|
});
|
||||||
|
elCloneableDynamic.addEventListener('change', function (event){
|
||||||
|
userDataChanger("grabbableKey", "cloneDynamic", event.target, elUserData, -1);
|
||||||
|
});
|
||||||
|
elCloneable.addEventListener('change', function (event) {
|
||||||
|
var checked = event.target.checked;
|
||||||
|
if (checked) {
|
||||||
|
multiDataUpdater("grabbableKey",
|
||||||
|
{cloneLifetime: elCloneableLifetime, cloneLimit: elCloneableLimit, cloneDynamic: elCloneableDynamic, cloneable: event.target},
|
||||||
|
elUserData, {});
|
||||||
|
elCloneableGroup.style.display = "block";
|
||||||
|
EventBridge.emitWebEvent(
|
||||||
|
'{"id":' + lastEntityID + ', "type":"update", "properties":{"dynamic":false, "grabbable": false}}'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
multiDataUpdater("grabbableKey",
|
||||||
|
{cloneLifetime: null, cloneLimit: null, cloneDynamic: null, cloneable: false},
|
||||||
|
elUserData, {});
|
||||||
|
elCloneableGroup.style.display = "none";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var numberListener = function (event) {
|
||||||
|
userDataChanger("grabbableKey", event.target.getAttribute("data-user-data-type"), parseInt(event.target.value), elUserData, false);
|
||||||
|
};
|
||||||
|
elCloneableLifetime.addEventListener('change', numberListener);
|
||||||
|
elCloneableLimit.addEventListener('change', numberListener);
|
||||||
|
|
||||||
elWantsTrigger.addEventListener('change', function() {
|
elWantsTrigger.addEventListener('change', function() {
|
||||||
userDataChanger("grabbableKey", "wantsTrigger", elWantsTrigger, elUserData, false);
|
userDataChanger("grabbableKey", "wantsTrigger", elWantsTrigger, elUserData, false);
|
||||||
});
|
});
|
||||||
|
@ -1390,7 +1470,7 @@ function loaded() {
|
||||||
elZoneFlyingAllowed.addEventListener('change', createEmitCheckedPropertyUpdateFunction('flyingAllowed'));
|
elZoneFlyingAllowed.addEventListener('change', createEmitCheckedPropertyUpdateFunction('flyingAllowed'));
|
||||||
elZoneGhostingAllowed.addEventListener('change', createEmitCheckedPropertyUpdateFunction('ghostingAllowed'));
|
elZoneGhostingAllowed.addEventListener('change', createEmitCheckedPropertyUpdateFunction('ghostingAllowed'));
|
||||||
elZoneFilterURL.addEventListener('change', createEmitTextPropertyUpdateFunction('filterURL'));
|
elZoneFilterURL.addEventListener('change', createEmitTextPropertyUpdateFunction('filterURL'));
|
||||||
|
|
||||||
var voxelVolumeSizeChangeFunction = createEmitVec3PropertyUpdateFunction(
|
var voxelVolumeSizeChangeFunction = createEmitVec3PropertyUpdateFunction(
|
||||||
'voxelVolumeSize', elVoxelVolumeSizeX, elVoxelVolumeSizeY, elVoxelVolumeSizeZ);
|
'voxelVolumeSize', elVoxelVolumeSizeX, elVoxelVolumeSizeY, elVoxelVolumeSizeZ);
|
||||||
elVoxelVolumeSizeX.addEventListener('change', voxelVolumeSizeChangeFunction);
|
elVoxelVolumeSizeX.addEventListener('change', voxelVolumeSizeChangeFunction);
|
||||||
|
@ -1441,7 +1521,15 @@ function loaded() {
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.addEventListener("keydown", function (keyDown) {
|
||||||
|
if (keyDown.keyCode === KEY_P && keyDown.ctrlKey) {
|
||||||
|
if (keyDown.shiftKey) {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'unparent' }));
|
||||||
|
} else {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'parent' }));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
window.onblur = function() {
|
window.onblur = function() {
|
||||||
// Fake a change event
|
// Fake a change event
|
||||||
var ev = document.createEvent("HTMLEvents");
|
var ev = document.createEvent("HTMLEvents");
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
|
||||||
|
const KEY_P = 80; //Key code for letter p used for Parenting hotkey.
|
||||||
|
|
||||||
function loaded() {
|
function loaded() {
|
||||||
openEventBridge(function() {
|
openEventBridge(function() {
|
||||||
elPosY = document.getElementById("horiz-y");
|
elPosY = document.getElementById("horiz-y");
|
||||||
|
@ -131,10 +133,17 @@ function loaded() {
|
||||||
|
|
||||||
EventBridge.emitWebEvent(JSON.stringify({ type: 'init' }));
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'init' }));
|
||||||
});
|
});
|
||||||
|
document.addEventListener("keydown", function (keyDown) {
|
||||||
|
if (keyDown.keyCode === KEY_P && keyDown.ctrlKey) {
|
||||||
|
if (keyDown.shiftKey) {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'unparent' }));
|
||||||
|
} else {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'parent' }));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
// Disable right-click context menu which is not visible in the HMD and makes it seem like the app has locked
|
// Disable right-click context menu which is not visible in the HMD and makes it seem like the app has locked
|
||||||
document.addEventListener("contextmenu", function (event) {
|
document.addEventListener("contextmenu", function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}, false);
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1167,14 +1167,14 @@ SelectionDisplay = (function() {
|
||||||
// determine which bottom corner we are closest to
|
// determine which bottom corner we are closest to
|
||||||
/*------------------------------
|
/*------------------------------
|
||||||
example:
|
example:
|
||||||
|
|
||||||
BRF +--------+ BLF
|
BRF +--------+ BLF
|
||||||
| |
|
| |
|
||||||
| |
|
| |
|
||||||
BRN +--------+ BLN
|
BRN +--------+ BLN
|
||||||
|
|
||||||
*
|
*
|
||||||
|
|
||||||
------------------------------*/
|
------------------------------*/
|
||||||
|
|
||||||
var cameraPosition = Camera.getPosition();
|
var cameraPosition = Camera.getPosition();
|
||||||
|
@ -2187,8 +2187,12 @@ SelectionDisplay = (function() {
|
||||||
offset = Vec3.multiplyQbyV(props.rotation, offset);
|
offset = Vec3.multiplyQbyV(props.rotation, offset);
|
||||||
var boxPosition = Vec3.sum(props.position, offset);
|
var boxPosition = Vec3.sum(props.position, offset);
|
||||||
|
|
||||||
|
var color = {red: 255, green: 128, blue: 0};
|
||||||
|
if (i >= selectionManager.selections.length - 1) color = {red: 255, green: 255, blue: 64};
|
||||||
|
|
||||||
Overlays.editOverlay(selectionBoxes[i], {
|
Overlays.editOverlay(selectionBoxes[i], {
|
||||||
position: boxPosition,
|
position: boxPosition,
|
||||||
|
color: color,
|
||||||
rotation: props.rotation,
|
rotation: props.rotation,
|
||||||
dimensions: props.dimensions,
|
dimensions: props.dimensions,
|
||||||
visible: true,
|
visible: true,
|
||||||
|
@ -2393,7 +2397,7 @@ SelectionDisplay = (function() {
|
||||||
if (wantDebug) {
|
if (wantDebug) {
|
||||||
print("Start Elevation: " + translateXZTool.startingElevation + ", elevation: " + elevation);
|
print("Start Elevation: " + translateXZTool.startingElevation + ", elevation: " + elevation);
|
||||||
}
|
}
|
||||||
if ((translateXZTool.startingElevation > 0.0 && elevation < MIN_ELEVATION) ||
|
if ((translateXZTool.startingElevation > 0.0 && elevation < MIN_ELEVATION) ||
|
||||||
(translateXZTool.startingElevation < 0.0 && elevation > -MIN_ELEVATION)) {
|
(translateXZTool.startingElevation < 0.0 && elevation > -MIN_ELEVATION)) {
|
||||||
if (wantDebug) {
|
if (wantDebug) {
|
||||||
print("too close to horizon!");
|
print("too close to horizon!");
|
||||||
|
@ -3857,7 +3861,7 @@ SelectionDisplay = (function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
that.mousePressEvent = function(event) {
|
that.mousePressEvent = function(event) {
|
||||||
var wantDebug = false;
|
var wantDebug = false;
|
||||||
if (!event.isLeftButton && !that.triggered) {
|
if (!event.isLeftButton && !that.triggered) {
|
||||||
// if another mouse button than left is pressed ignore it
|
// if another mouse button than left is pressed ignore it
|
||||||
return false;
|
return false;
|
||||||
|
@ -3888,7 +3892,6 @@ SelectionDisplay = (function() {
|
||||||
|
|
||||||
result = Overlays.findRayIntersection(pickRay);
|
result = Overlays.findRayIntersection(pickRay);
|
||||||
if (result.intersects) {
|
if (result.intersects) {
|
||||||
|
|
||||||
if (wantDebug) {
|
if (wantDebug) {
|
||||||
print("something intersects... ");
|
print("something intersects... ");
|
||||||
print(" result.overlayID:" + result.overlayID + "[" + overlayNames[result.overlayID] + "]");
|
print(" result.overlayID:" + result.overlayID + "[" + overlayNames[result.overlayID] + "]");
|
||||||
|
@ -3988,7 +3991,7 @@ SelectionDisplay = (function() {
|
||||||
if (wantDebug) {
|
if (wantDebug) {
|
||||||
print("rotate handle case...");
|
print("rotate handle case...");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// After testing our stretch handles, then check out rotate handles
|
// After testing our stretch handles, then check out rotate handles
|
||||||
Overlays.editOverlay(yawHandle, {
|
Overlays.editOverlay(yawHandle, {
|
||||||
|
@ -4210,7 +4213,7 @@ SelectionDisplay = (function() {
|
||||||
case selectionBox:
|
case selectionBox:
|
||||||
activeTool = translateXZTool;
|
activeTool = translateXZTool;
|
||||||
translateXZTool.pickPlanePosition = result.intersection;
|
translateXZTool.pickPlanePosition = result.intersection;
|
||||||
translateXZTool.greatestDimension = Math.max(Math.max(SelectionManager.worldDimensions.x, SelectionManager.worldDimensions.y),
|
translateXZTool.greatestDimension = Math.max(Math.max(SelectionManager.worldDimensions.x, SelectionManager.worldDimensions.y),
|
||||||
SelectionManager.worldDimensions.z);
|
SelectionManager.worldDimensions.z);
|
||||||
if (wantDebug) {
|
if (wantDebug) {
|
||||||
print("longest dimension: " + translateXZTool.greatestDimension);
|
print("longest dimension: " + translateXZTool.greatestDimension);
|
||||||
|
@ -4219,7 +4222,7 @@ SelectionDisplay = (function() {
|
||||||
translateXZTool.startingElevation = translateXZTool.elevation(pickRay.origin, translateXZTool.pickPlanePosition);
|
translateXZTool.startingElevation = translateXZTool.elevation(pickRay.origin, translateXZTool.pickPlanePosition);
|
||||||
print(" starting elevation: " + translateXZTool.startingElevation);
|
print(" starting elevation: " + translateXZTool.startingElevation);
|
||||||
}
|
}
|
||||||
|
|
||||||
mode = translateXZTool.mode;
|
mode = translateXZTool.mode;
|
||||||
activeTool.onBegin(event);
|
activeTool.onBegin(event);
|
||||||
somethingClicked = 'selectionBox';
|
somethingClicked = 'selectionBox';
|
||||||
|
|
|
@ -521,6 +521,9 @@ function onEditError(msg) {
|
||||||
createNotification(wordWrap(msg), NotificationType.EDIT_ERROR);
|
createNotification(wordWrap(msg), NotificationType.EDIT_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onNotify(msg) {
|
||||||
|
createNotification(wordWrap(msg), NotificationType.UNKNOWN); // Needs a generic notification system for user feedback, thus using this
|
||||||
|
}
|
||||||
|
|
||||||
function onSnapshotTaken(pathStillSnapshot, pathAnimatedSnapshot, notify) {
|
function onSnapshotTaken(pathStillSnapshot, pathAnimatedSnapshot, notify) {
|
||||||
if (notify) {
|
if (notify) {
|
||||||
|
@ -637,6 +640,7 @@ Window.domainConnectionRefused.connect(onDomainConnectionRefused);
|
||||||
Window.snapshotTaken.connect(onSnapshotTaken);
|
Window.snapshotTaken.connect(onSnapshotTaken);
|
||||||
Window.processingGif.connect(processingGif);
|
Window.processingGif.connect(processingGif);
|
||||||
Window.notifyEditError = onEditError;
|
Window.notifyEditError = onEditError;
|
||||||
|
Window.notify = onNotify;
|
||||||
|
|
||||||
setup();
|
setup();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue