mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Updated
This commit is contained in:
parent
f211f015d7
commit
f5d266a562
5 changed files with 36 additions and 12 deletions
|
@ -859,7 +859,6 @@ function setupModelMenus() {
|
|||
menuItemName: "Unparent Entity",
|
||||
afterItem: "Entity List...",
|
||||
shortcutKey: "CTRL+SHIFT+P",
|
||||
afterItem: "Entity List...",
|
||||
grouping: "Advanced"
|
||||
});
|
||||
Menu.addMenuItem({
|
||||
|
@ -1003,6 +1002,9 @@ Script.scriptEnding.connect(function () {
|
|||
|
||||
Overlays.deleteOverlay(importingSVOImageOverlay);
|
||||
Overlays.deleteOverlay(importingSVOTextOverlay);
|
||||
|
||||
Controller.keyReleaseEvent.disconnect(keyReleaseEvent);
|
||||
Controller.keyPressEvent.disconnect(keyPressEvent);
|
||||
});
|
||||
|
||||
var lastOrientation = null;
|
||||
|
@ -1121,10 +1123,8 @@ function unparentSelectedEntities() {
|
|||
Entities.editEntity(id, {parentID: null})
|
||||
return true;
|
||||
});
|
||||
|
||||
Window.notify("Entities Unparented");
|
||||
}
|
||||
|
||||
}
|
||||
function parentSelectedEntities() {
|
||||
if (SelectionManager.hasSelection()) {
|
||||
|
@ -1335,13 +1335,12 @@ Window.svoImportRequested.connect(importSVO);
|
|||
|
||||
Menu.menuItemEvent.connect(handeMenuEvent);
|
||||
|
||||
Controller.keyPressEvent.connect(function (event) {
|
||||
var keyPressEvent = function (event) {
|
||||
if (isActive) {
|
||||
cameraManager.keyPressEvent(event);
|
||||
}
|
||||
});
|
||||
|
||||
Controller.keyReleaseEvent.connect(function (event) {
|
||||
};
|
||||
var keyReleaseEvent = function (event) {
|
||||
if (isActive) {
|
||||
cameraManager.keyReleaseEvent(event);
|
||||
}
|
||||
|
@ -1375,14 +1374,16 @@ Controller.keyReleaseEvent.connect(function (event) {
|
|||
});
|
||||
grid.setPosition(newPosition);
|
||||
}
|
||||
} else if (event.text === 'p' && event.isControl ) {
|
||||
} else if (event.text === 'p' && event.isControl && !event.isAutoRepeat ) {
|
||||
if (event.isShifted) {
|
||||
unparentSelectedEntities();
|
||||
} else {
|
||||
parentSelectedEntities();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
Controller.keyReleaseEvent.connect(keyReleaseEvent);
|
||||
Controller.keyPressEvent.connect(keyPressEvent);
|
||||
|
||||
function recursiveAdd(newParentID, parentData) {
|
||||
var children = parentData.children;
|
||||
|
@ -1632,6 +1633,10 @@ var PropertiesTool = function (opts) {
|
|||
}
|
||||
pushCommandForSelections();
|
||||
selectionManager._update();
|
||||
} else if(data.type === 'parent') {
|
||||
parentSelectedEntities();
|
||||
} else if(data.type === 'unparent') {
|
||||
unparentSelectedEntities();
|
||||
} else if(data.type === 'saveUserData'){
|
||||
//the event bridge and json parsing handle our avatar id string differently.
|
||||
var actualID = data.id.split('"')[1];
|
||||
|
@ -1889,6 +1894,9 @@ var PopupMenu = function () {
|
|||
for (var i = 0; i < overlays.length; 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);
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
<script type="text/javascript" src="js/spinButtons.js"></script>
|
||||
<script type="text/javascript" src="js/keyboardControl.js"></script>
|
||||
<script type="text/javascript" src="js/entityList.js"></script>
|
||||
<script type="text/javascript" src="js/parentingHotkey.js"></script>
|
||||
</head>
|
||||
<body onload='loaded();'>
|
||||
<div id="entity-list-header">
|
||||
|
@ -89,6 +90,8 @@
|
|||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<input type="button" class="green" id="parent" value="Parent" />
|
||||
<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.
|
||||
</div>
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
<script type="text/javascript" src="js/keyboardControl.js"></script>
|
||||
<script type="text/javascript" src="js/entityProperties.js"></script>
|
||||
<script src="js/jsoneditor.min.js"></script>
|
||||
<script type="text/javascript" src="js/parentingHotkey.js"></script>
|
||||
</head>
|
||||
<body onload='loaded();'>
|
||||
<div id="properties-list">
|
||||
|
@ -61,7 +62,7 @@
|
|||
<label for="property-description">Description</label>
|
||||
<input type="text" id="property-description">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="property textarea">
|
||||
<label for="property-user-data">User data</label>
|
||||
<br>
|
||||
|
|
12
scripts/system/html/js/parentingHotkey.js
Normal file
12
scripts/system/html/js/parentingHotkey.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
var keyReleaseEvent = function (event) {
|
||||
if (event.text === 'p' && event.isControl && !event.isAutoRepeat ) {
|
||||
if (event.isShifted) {
|
||||
EventBridge.emitWebEvent(JSON.stringify({ type: 'unparent' }));
|
||||
} else {
|
||||
EventBridge.emitWebEvent(JSON.stringify({ type: 'parent' }));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
window.onkeypress = keyReleaseEvent;
|
||||
Controller.keyReleaseEvent.connect(keyReleaseEvent);
|
|
@ -2189,8 +2189,8 @@ SelectionDisplay = (function() {
|
|||
offset = Vec3.multiplyQbyV(properties.rotation, offset);
|
||||
var boxPosition = Vec3.sum(properties.position, offset);
|
||||
|
||||
var color = {red: 255, green: 153, blue: 0};
|
||||
if (i >= selectionManager.selections.length - 1) color = {red: 255, green: 255, blue: 0};
|
||||
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], {
|
||||
position: boxPosition,
|
||||
|
|
Loading…
Reference in a new issue