mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 02:17:11 +02:00
Merge pull request #10267 from Triplelexx/21287
21287 - Newly created entities in Edit.js should be grabbable
This commit is contained in:
commit
26173700b8
1 changed files with 19 additions and 3 deletions
|
@ -213,6 +213,8 @@ function hideMarketplace() {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
var TOOLS_PATH = Script.resolvePath("assets/images/tools/");
|
var TOOLS_PATH = Script.resolvePath("assets/images/tools/");
|
||||||
|
var GRABBABLE_ENTITIES_MENU_CATEGORY = "Edit";
|
||||||
|
var GRABBABLE_ENTITIES_MENU_ITEM = "Create Entities As Grabbable";
|
||||||
|
|
||||||
var toolBar = (function () {
|
var toolBar = (function () {
|
||||||
var EDIT_SETTING = "io.highfidelity.isEditting"; // for communication with other scripts
|
var EDIT_SETTING = "io.highfidelity.isEditting"; // for communication with other scripts
|
||||||
|
@ -227,8 +229,11 @@ var toolBar = (function () {
|
||||||
var position = getPositionToCreateEntity();
|
var position = getPositionToCreateEntity();
|
||||||
var entityID = null;
|
var entityID = null;
|
||||||
if (position !== null && position !== undefined) {
|
if (position !== null && position !== undefined) {
|
||||||
position = grid.snapToSurface(grid.snapToGrid(position, false, dimensions), dimensions),
|
position = grid.snapToSurface(grid.snapToGrid(position, false, dimensions), dimensions);
|
||||||
properties.position = position;
|
properties.position = position;
|
||||||
|
if (Menu.isOptionChecked(GRABBABLE_ENTITIES_MENU_ITEM)) {
|
||||||
|
properties.userData = JSON.stringify({ grabbableKey: { grabbable: true } });
|
||||||
|
}
|
||||||
entityID = Entities.addEntity(properties);
|
entityID = Entities.addEntity(properties);
|
||||||
if (properties.type == "ParticleEffect") {
|
if (properties.type == "ParticleEffect") {
|
||||||
selectParticleEntity(entityID);
|
selectParticleEntity(entityID);
|
||||||
|
@ -253,6 +258,7 @@ var toolBar = (function () {
|
||||||
if (systemToolbar) {
|
if (systemToolbar) {
|
||||||
systemToolbar.removeButton(EDIT_TOGGLE_BUTTON);
|
systemToolbar.removeButton(EDIT_TOGGLE_BUTTON);
|
||||||
}
|
}
|
||||||
|
Menu.removeMenuItem(GRABBABLE_ENTITIES_MENU_CATEGORY, GRABBABLE_ENTITIES_MENU_ITEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
var buttonHandlers = {}; // only used to tablet mode
|
var buttonHandlers = {}; // only used to tablet mode
|
||||||
|
@ -903,11 +909,21 @@ function setupModelMenus() {
|
||||||
afterItem: "Parent Entity to Last",
|
afterItem: "Parent Entity to Last",
|
||||||
grouping: "Advanced"
|
grouping: "Advanced"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Menu.addMenuItem({
|
||||||
|
menuName: GRABBABLE_ENTITIES_MENU_CATEGORY,
|
||||||
|
menuItemName: GRABBABLE_ENTITIES_MENU_ITEM,
|
||||||
|
afterItem: "Unparent Entity",
|
||||||
|
isCheckable: true,
|
||||||
|
isChecked: true,
|
||||||
|
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: "Unparent Entity",
|
afterItem: GRABBABLE_ENTITIES_MENU_ITEM,
|
||||||
isCheckable: true,
|
isCheckable: true,
|
||||||
isChecked: true,
|
isChecked: true,
|
||||||
grouping: "Advanced"
|
grouping: "Advanced"
|
||||||
|
|
Loading…
Reference in a new issue