Merge pull request #4058 from huffman/entity-tool-updates

Entity tool updates
This commit is contained in:
Brad Hefta-Gaub 2015-01-07 12:42:47 -08:00
commit ddea2c4a68
5 changed files with 24 additions and 9 deletions

View file

@ -42,7 +42,15 @@ gridTool = GridTool({ horizontalGrid: grid });
Script.include("libraries/entityList.js");
var entityListTool = EntityListTool();
selectionManager.addEventListener(selectionDisplay.updateHandles);
var hasShownPropertiesTool = false;
selectionManager.addEventListener(function() {
selectionDisplay.updateHandles();
if (selectionManager.hasSelection() && !hasShownPropertiesTool) {
propertiesTool.setVisible(true);
hasShownPropertiesTool = true;
}
});
var windowDimensions = Controller.getViewportDimensions();
var toolIconUrl = HIFI_PUBLIC_BUCKET + "images/tools/";
@ -223,10 +231,9 @@ var toolBar = (function () {
selectionManager.clearSelections();
cameraManager.disable();
} else {
hasShownPropertiesTool = false;
cameraManager.enable();
entityListTool.setVisible(true);
gridTool.setVisible(true);
propertiesTool.setVisible(true);
grid.setEnabled(true);
}
}

View file

@ -618,7 +618,7 @@
<tr>
<td class="label">Script URL</td>
<td>
<input id="property-script-url"></input>
<input id="property-script-url" class="url"></input>
</td>
</tr>
@ -637,13 +637,13 @@
<tr class="model-section">
<td class="label">Model URL</td>
<td>
<input type="text" id="property-model-url"></input>
<input type="text" id="property-model-url" class="url"></input>
</td>
</tr>
<tr class="model-section">
<td class="label">Animation URL</td>
<td>
<input type="text" id="property-model-animation-url"></input>
<input type="text" id="property-model-animation-url" class="url"></input>
</td>
</tr>
<tr class="model-section">

View file

@ -96,6 +96,10 @@ input {
background-color: #eee;
}
input.url {
width: 100%;
}
table#entity-table {
border-collapse: collapse;
font-family: Sans-Serif;
@ -171,7 +175,7 @@ table#properties-table {
}
#properties-table td {
padding: 5px 0px 5px 10px;
padding: 5px;
}
col#col-label {

View file

@ -439,7 +439,11 @@ GridTool = function(opts) {
} else if (overlay == uiOverlays.snapToGridCheckbox.overlay) {
horizontalGrid.setSnapToGrid(!horizontalGrid.getSnapToGrid());
} else if (overlay == uiOverlays.moveToAvatar.overlay) {
horizontalGrid.setPosition(MyAvatar.position);
var position = MyAvatar.getJointPosition("LeftFoot");
if (position.x == 0 && position.y == 0 && position.z == 0) {
position = MyAvatar.position;
}
horizontalGrid.setPosition(position);
} else if (overlay == uiOverlays.moveToSelection.overlay) {
var newPosition = selectionManager.worldPosition;
newPosition = Vec3.subtract(newPosition, { x: 0, y: selectionManager.worldDimensions.y * 0.5, z: 0 });

View file

@ -599,7 +599,7 @@ Menu::Menu() :
AudioIOStatsRenderer::SharedPointer statsRenderer = DependencyManager::get<AudioIOStatsRenderer>();
addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::AudioStats,
Qt::CTRL | Qt::Key_A,
Qt::CTRL | Qt::SHIFT | Qt::Key_A,
false,
statsRenderer.data(),
SLOT(toggle()));