hook up qml button to edit.js

This commit is contained in:
Faye Li 2017-03-17 11:22:07 -07:00
parent 10ebb6efd7
commit 6531efffbc
2 changed files with 20 additions and 1 deletions

View file

@ -186,6 +186,11 @@ StackView {
anchors.leftMargin: 55
anchors.top: assetServerButton.bottom
anchors.topMargin: 20
onClicked: {
editRoot.sendToScript({
method: "newEntityButtonClicked", params: { buttonName: "importEntitiesButton" }
});
}
}
}
}

View file

@ -294,7 +294,21 @@ var toolBar = (function () {
that.toggle();
});
addButton("openAssetBrowserButton", "assets-01.svg", function(){
addButton("importEntitiesButton", "assets-01.svg", function() {
var importURL = null;
var fullPath = Window.browse("Select Model to Import", "", "*.json");
if (fullPath) {
importURL = "file:///" + fullPath;
}
if (importURL) {
if (!isActive && (Entities.canRez() && Entities.canRezTmp())) {
toolBar.toggle();
}
importSVO(importURL);
}
});
addButton("openAssetBrowserButton", "assets-01.svg", function() {
Window.showAssetServer();
});