mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 17:01:18 +02:00
Turn Edit.js on when importing SVO
This commit is contained in:
parent
36d8e6d64d
commit
cfd4294743
1 changed files with 13 additions and 8 deletions
|
@ -240,11 +240,8 @@ var toolBar = (function () {
|
||||||
hoverState: 3,
|
hoverState: 3,
|
||||||
defaultState: 1
|
defaultState: 1
|
||||||
});
|
});
|
||||||
activeButton.clicked.connect(function () {
|
activeButton.clicked.connect(function() {
|
||||||
that.setActive(!isActive);
|
that.toggle();
|
||||||
activeButton.writeProperty("buttonState", isActive ? 0 : 1);
|
|
||||||
activeButton.writeProperty("defaultState", isActive ? 0 : 1);
|
|
||||||
activeButton.writeProperty("hoverState", isActive ? 2 : 3);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
toolBar = Toolbars.getToolbar(EDIT_TOOLBAR);
|
toolBar = Toolbars.getToolbar(EDIT_TOOLBAR);
|
||||||
|
@ -440,6 +437,14 @@ var toolBar = (function () {
|
||||||
entityListTool.clearEntityList();
|
entityListTool.clearEntityList();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
that.toggle = function () {
|
||||||
|
that.setActive(!isActive);
|
||||||
|
activeButton.writeProperty("buttonState", isActive ? 0 : 1);
|
||||||
|
activeButton.writeProperty("defaultState", isActive ? 0 : 1);
|
||||||
|
activeButton.writeProperty("hoverState", isActive ? 2 : 3);
|
||||||
|
};
|
||||||
|
|
||||||
that.setActive = function (active) {
|
that.setActive = function (active) {
|
||||||
if (active === isActive) {
|
if (active === isActive) {
|
||||||
return;
|
return;
|
||||||
|
@ -1093,7 +1098,6 @@ function handeMenuEvent(menuItem) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (menuItem === "Import Entities" || menuItem === "Import Entities from URL") {
|
} else if (menuItem === "Import Entities" || menuItem === "Import Entities from URL") {
|
||||||
|
|
||||||
var importURL = null;
|
var importURL = null;
|
||||||
if (menuItem === "Import Entities") {
|
if (menuItem === "Import Entities") {
|
||||||
var fullPath = Window.browse("Select Model to Import", "", "*.json");
|
var fullPath = Window.browse("Select Model to Import", "", "*.json");
|
||||||
|
@ -1105,6 +1109,9 @@ function handeMenuEvent(menuItem) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (importURL) {
|
if (importURL) {
|
||||||
|
if (!isActive && (Entities.canRez() && Entities.canRezTmp())) {
|
||||||
|
toolBar.toggle();
|
||||||
|
}
|
||||||
importSVO(importURL);
|
importSVO(importURL);
|
||||||
}
|
}
|
||||||
} else if (menuItem === "Entity List...") {
|
} else if (menuItem === "Entity List...") {
|
||||||
|
@ -1185,8 +1192,6 @@ function importSVO(importURL) {
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
selectionManager.setSelections(pastedEntityIDs);
|
selectionManager.setSelections(pastedEntityIDs);
|
||||||
}
|
}
|
||||||
|
|
||||||
Window.raiseMainWindow();
|
|
||||||
} else {
|
} else {
|
||||||
Window.notifyEditError("Can't import objects: objects would be out of bounds.");
|
Window.notifyEditError("Can't import objects: objects would be out of bounds.");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue