mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
Merge pull request #4215 from huffman/edit-changes
A few improvements to editEntities.js
This commit is contained in:
commit
b5e62922a2
4 changed files with 15 additions and 17 deletions
|
@ -60,6 +60,7 @@ selectionManager.addEventListener(function() {
|
|||
propertiesTool.setVisible(true);
|
||||
entityListTool.setVisible(true);
|
||||
gridTool.setVisible(true);
|
||||
Window.setFocus();
|
||||
hasShownPropertiesTool = true;
|
||||
}
|
||||
if (!selectionManager.hasSelection()) {
|
||||
|
@ -534,7 +535,7 @@ function mousePressEvent(event) {
|
|||
if (result !== null) {
|
||||
var currentProperties = Entities.getEntityProperties(result.entityID);
|
||||
cameraManager.enable();
|
||||
cameraManager.focus(currentProperties.position, null, Menu.isOptionChecked(MENU_EASE_ON_FOCUS));
|
||||
cameraManager.focus(currentProperties.position, null, true);
|
||||
cameraManager.mousePressEvent(event);
|
||||
}
|
||||
} else {
|
||||
|
@ -670,19 +671,19 @@ function mouseClickEvent(event) {
|
|||
orientation = MyAvatar.orientation;
|
||||
intersection = rayPlaneIntersection(pickRay, P, Quat.getFront(orientation));
|
||||
|
||||
if (!event.isShifted) {
|
||||
selectionManager.clearSelections();
|
||||
}
|
||||
|
||||
var toggle = event.isShifted;
|
||||
selectionManager.addEntity(foundEntity, toggle);
|
||||
if (!event.isShifted) {
|
||||
selectionManager.setSelections([foundEntity]);
|
||||
} else {
|
||||
selectionManager.addEntity(foundEntity, true);
|
||||
}
|
||||
|
||||
print("Model selected: " + foundEntity.id);
|
||||
selectionDisplay.select(selectedEntityID, event);
|
||||
|
||||
cameraManager.focus(selectionManager.worldPosition,
|
||||
selectionManager.worldDimensions,
|
||||
Menu.isOptionChecked(MENU_EASE_ON_FOCUS));
|
||||
true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -820,9 +821,7 @@ function handeMenuEvent(menuItem) {
|
|||
} else if (menuItem == "Import Models") {
|
||||
modelImporter.doImport();
|
||||
} else if (menuItem == "Entity List...") {
|
||||
if (isActive) {
|
||||
entityListTool.toggleVisible();
|
||||
}
|
||||
entityListTool.toggleVisible();
|
||||
}
|
||||
tooltip.show(false);
|
||||
}
|
||||
|
|
|
@ -559,13 +559,6 @@
|
|||
</div>
|
||||
|
||||
<div class="property">
|
||||
<div class="label">Mass</div>
|
||||
<div class="value">
|
||||
<input type='number' id="property-mass"></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="label">Density</div>
|
||||
<div>
|
||||
<input type='number' id="property-density"></input>
|
||||
|
|
|
@ -44,6 +44,11 @@ QScriptValue WindowScriptingInterface::hasFocus() {
|
|||
return DependencyManager::get<GLCanvas>()->hasFocus();
|
||||
}
|
||||
|
||||
void WindowScriptingInterface::setFocus() {
|
||||
Application::getInstance()->getWindow()->activateWindow();
|
||||
Application::getInstance()->getWindow()->setFocus();
|
||||
}
|
||||
|
||||
void WindowScriptingInterface::setCursorVisible(bool visible) {
|
||||
Application::getInstance()->setCursorVisible(visible);
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ public slots:
|
|||
void setCursorPosition(int x, int y);
|
||||
void setCursorVisible(bool visible);
|
||||
QScriptValue hasFocus();
|
||||
void setFocus();
|
||||
QScriptValue alert(const QString& message = "");
|
||||
QScriptValue confirm(const QString& message = "");
|
||||
QScriptValue form(const QString& title, QScriptValue array);
|
||||
|
|
Loading…
Reference in a new issue