mirror of
https://github.com/overte-org/overte.git
synced 2025-04-13 22:27:47 +02:00
Merge branch 'instancing' of https://github.com/highfidelity/hifi into instancing
This commit is contained in:
commit
fc4a314fd3
4 changed files with 48 additions and 116 deletions
|
@ -33,6 +33,12 @@ Item {
|
|||
property var item: null
|
||||
|
||||
function load(url, scriptUrl) {
|
||||
// Ensure we reset any existing item to "about:blank" to ensure web audio stops: DEV-2375
|
||||
if (root.item != null) {
|
||||
root.item.url = "about:blank"
|
||||
root.item.destroy()
|
||||
root.item = null
|
||||
}
|
||||
QmlSurface.load("./controls/WebView.qml", root, function(newItem) {
|
||||
root.item = newItem
|
||||
root.item.url = url
|
||||
|
|
|
@ -580,8 +580,9 @@ Rectangle {
|
|||
sendToScript(msg);
|
||||
} else if (msg.method === "showInvalidatedLightbox") {
|
||||
lightboxPopup.titleText = "Item Invalidated";
|
||||
lightboxPopup.bodyText = 'Your item is marked "invalidated" because this item has been suspended ' +
|
||||
"from the Marketplace due to a claim against its author.";
|
||||
lightboxPopup.bodyText = 'This item has been invalidated and is no longer available.<br>' +
|
||||
'If you have questions, please contact marketplace@highfidelity.com.<br>' +
|
||||
'Thank you!';
|
||||
lightboxPopup.button1text = "CLOSE";
|
||||
lightboxPopup.button1method = function() {
|
||||
lightboxPopup.visible = false;
|
||||
|
|
|
@ -92,15 +92,19 @@ public:
|
|||
ToolbarProxy(QObject* qmlObject, QObject* parent = nullptr);
|
||||
|
||||
/**jsdoc
|
||||
* <em>Currently doesn't work.</em>
|
||||
* @function ToolbarProxy#addButton
|
||||
* @param {object} properties
|
||||
* @returns {ToolbarButtonProxy}
|
||||
* @param {object} properties - Button properties
|
||||
* @returns {object} The button added.
|
||||
* @deprecated This method is deprecated and will be removed.
|
||||
*/
|
||||
Q_INVOKABLE ToolbarButtonProxy* addButton(const QVariant& properties);
|
||||
|
||||
/**jsdoc
|
||||
* <em>Currently doesn't work.</em>
|
||||
* @function ToolbarProxy#removeButton
|
||||
* @param {string} name
|
||||
* @param {string} name - Button name.
|
||||
* @deprecated This method is deprecated and will be removed.
|
||||
*/
|
||||
Q_INVOKABLE void removeButton(const QVariant& name);
|
||||
|
||||
|
|
|
@ -1,117 +1,38 @@
|
|||
var isActive = false;
|
||||
(function () {
|
||||
|
||||
var toolBar = (function() {
|
||||
var that = {},
|
||||
toolBar,
|
||||
activeButton,
|
||||
newModelButton,
|
||||
newShapeButton,
|
||||
newLightButton,
|
||||
newTextButton,
|
||||
newWebButton,
|
||||
newZoneButton,
|
||||
newParticleButton,
|
||||
newMaterialButton
|
||||
|
||||
var toolIconUrl = Script.resolvePath("../../system/assets/images/tools/");
|
||||
|
||||
function initialize() {
|
||||
print("Toolbars: " + Toolbars);
|
||||
toolBar = Toolbars.getToolbar("highfidelity.edit.toolbar");
|
||||
print("Toolbar: " + toolBar);
|
||||
activeButton = toolBar.addButton({
|
||||
objectName: "activeButton",
|
||||
imageURL: toolIconUrl + "edit-01.svg",
|
||||
visible: true,
|
||||
alpha: 0.9,
|
||||
});
|
||||
|
||||
print("Button " + activeButton);
|
||||
print("Button signal " + activeButton.clicked);
|
||||
activeButton.clicked.connect(function(){
|
||||
print("Clicked on button " + isActive);
|
||||
that.setActive(!isActive);
|
||||
});
|
||||
|
||||
newModelButton = toolBar.addButton({
|
||||
objectName: "newModelButton",
|
||||
imageURL: toolIconUrl + "model-01.svg",
|
||||
alpha: 0.9,
|
||||
visible: false
|
||||
});
|
||||
|
||||
newShapeButton = toolBar.addButton({
|
||||
objectName: "newShapeButton",
|
||||
imageURL: toolIconUrl + "cube-01.svg",
|
||||
alpha: 0.9,
|
||||
visible: false
|
||||
});
|
||||
|
||||
newLightButton = toolBar.addButton({
|
||||
objectName: "newLightButton",
|
||||
imageURL: toolIconUrl + "light-01.svg",
|
||||
alpha: 0.9,
|
||||
visible: false
|
||||
});
|
||||
|
||||
newTextButton = toolBar.addButton({
|
||||
objectName: "newTextButton",
|
||||
imageURL: toolIconUrl + "text-01.svg",
|
||||
alpha: 0.9,
|
||||
visible: false
|
||||
});
|
||||
|
||||
newWebButton = toolBar.addButton({
|
||||
objectName: "newWebButton",
|
||||
imageURL: toolIconUrl + "web-01.svg",
|
||||
alpha: 0.9,
|
||||
visible: false
|
||||
});
|
||||
|
||||
newZoneButton = toolBar.addButton({
|
||||
objectName: "newZoneButton",
|
||||
imageURL: toolIconUrl + "zone-01.svg",
|
||||
alpha: 0.9,
|
||||
visible: false
|
||||
});
|
||||
|
||||
newParticleButton = toolBar.addButton({
|
||||
objectName: "newParticleButton",
|
||||
imageURL: toolIconUrl + "particle-01.svg",
|
||||
alpha: 0.9,
|
||||
visible: false
|
||||
});
|
||||
|
||||
newMaterialButton = toolBar.addButton({
|
||||
objectName: "newMaterialButton",
|
||||
imageURL: toolIconUrl + "material-01.svg",
|
||||
alpha: 0.9,
|
||||
visible: false
|
||||
});
|
||||
|
||||
that.setActive(false);
|
||||
newModelButton.clicked();
|
||||
// Get the system toolbar.
|
||||
var toolbar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||
if (!toolbar) {
|
||||
print("ERROR: Couldn't get system toolbar.");
|
||||
return;
|
||||
}
|
||||
|
||||
that.setActive = function(active) {
|
||||
if (active != isActive) {
|
||||
isActive = active;
|
||||
that.showTools(isActive);
|
||||
}
|
||||
};
|
||||
Script.setTimeout(function () {
|
||||
// Report the system toolbar visibility.
|
||||
var isToolbarVisible = toolbar.readProperty("visible");
|
||||
print("Toolbar visible: " + isToolbarVisible);
|
||||
|
||||
// Sets visibility of tool buttons, excluding the power button
|
||||
that.showTools = function(doShow) {
|
||||
newModelButton.writeProperty('visible', doShow);
|
||||
newShapeButton.writeProperty('visible', doShow);
|
||||
newLightButton.writeProperty('visible', doShow);
|
||||
newTextButton.writeProperty('visible', doShow);
|
||||
newWebButton.writeProperty('visible', doShow);
|
||||
newZoneButton.writeProperty('visible', doShow);
|
||||
newParticleButton.writeProperty('visible', doShow);
|
||||
newMaterialButton.writeProperty('visible', doShow);
|
||||
};
|
||||
// Briefly toggle the system toolbar visibility.
|
||||
print("Toggle toolbar");
|
||||
toolbar.writeProperty("visible", !isToolbarVisible);
|
||||
Script.setTimeout(function () {
|
||||
print("Toggle toolbar");
|
||||
toolbar.writeProperty("visible", isToolbarVisible);
|
||||
}, 2000);
|
||||
}, 2000);
|
||||
|
||||
Script.setTimeout(function () {
|
||||
// Report the system toolbar visibility alternative method.
|
||||
isToolbarVisible = toolbar.readProperties(["visible"]).visible;
|
||||
print("Toolbar visible: " + isToolbarVisible);
|
||||
|
||||
// Briefly toggle the system toolbar visibility.
|
||||
print("Toggle toolbar");
|
||||
toolbar.writeProperties({ visible: !isToolbarVisible });
|
||||
Script.setTimeout(function () {
|
||||
print("Toggle toolbar");
|
||||
toolbar.writeProperties({ visible: isToolbarVisible });
|
||||
}, 2000);
|
||||
}, 6000);
|
||||
|
||||
initialize();
|
||||
return that;
|
||||
}());
|
||||
|
|
Loading…
Reference in a new issue