mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 14:37:46 +02:00
Make marketplace button always visible
This commit is contained in:
parent
b89a50590e
commit
b6af9fde9e
1 changed files with 14 additions and 16 deletions
|
@ -134,12 +134,19 @@ var toolBar = (function () {
|
||||||
newSphereButton,
|
newSphereButton,
|
||||||
newLightButton,
|
newLightButton,
|
||||||
newTextButton,
|
newTextButton,
|
||||||
browseModelsButton;
|
browseMarketplaceButton;
|
||||||
|
|
||||||
function initialize() {
|
function initialize() {
|
||||||
toolBar = new ToolBar(0, 0, ToolBar.VERTICAL);
|
toolBar = new ToolBar(0, 0, ToolBar.VERTICAL);
|
||||||
|
|
||||||
// Hide active button for now - this may come back, so not deleting yet.
|
browseMarketplaceButton = toolBar.addTool({
|
||||||
|
imageURL: toolIconUrl + "marketplace.svg",
|
||||||
|
width: toolWidth,
|
||||||
|
height: toolHeight,
|
||||||
|
alpha: 0.9,
|
||||||
|
visible: true,
|
||||||
|
});
|
||||||
|
|
||||||
activeButton = toolBar.addTool({
|
activeButton = toolBar.addTool({
|
||||||
imageURL: toolIconUrl + "edit-status.svg",
|
imageURL: toolIconUrl + "edit-status.svg",
|
||||||
subImage: { x: 0, y: Tool.IMAGE_WIDTH, width: Tool.IMAGE_WIDTH, height: Tool.IMAGE_HEIGHT },
|
subImage: { x: 0, y: Tool.IMAGE_WIDTH, width: Tool.IMAGE_WIDTH, height: Tool.IMAGE_HEIGHT },
|
||||||
|
@ -158,14 +165,6 @@ var toolBar = (function () {
|
||||||
visible: false
|
visible: false
|
||||||
});
|
});
|
||||||
|
|
||||||
browseModelsButton = toolBar.addTool({
|
|
||||||
imageURL: toolIconUrl + "marketplace.svg",
|
|
||||||
width: toolWidth,
|
|
||||||
height: toolHeight,
|
|
||||||
alpha: 0.9,
|
|
||||||
visible: false
|
|
||||||
});
|
|
||||||
|
|
||||||
newCubeButton = toolBar.addTool({
|
newCubeButton = toolBar.addTool({
|
||||||
imageURL: toolIconUrl + "add-cube.svg",
|
imageURL: toolIconUrl + "add-cube.svg",
|
||||||
subImage: { x: 0, y: Tool.IMAGE_WIDTH, width: Tool.IMAGE_WIDTH, height: Tool.IMAGE_HEIGHT },
|
subImage: { x: 0, y: Tool.IMAGE_WIDTH, width: Tool.IMAGE_WIDTH, height: Tool.IMAGE_HEIGHT },
|
||||||
|
@ -237,7 +236,6 @@ var toolBar = (function () {
|
||||||
// Sets visibility of tool buttons, excluding the power button
|
// Sets visibility of tool buttons, excluding the power button
|
||||||
that.showTools = function(doShow) {
|
that.showTools = function(doShow) {
|
||||||
toolBar.showTool(newModelButton, doShow);
|
toolBar.showTool(newModelButton, doShow);
|
||||||
toolBar.showTool(browseModelsButton, doShow);
|
|
||||||
toolBar.showTool(newCubeButton, doShow);
|
toolBar.showTool(newCubeButton, doShow);
|
||||||
toolBar.showTool(newSphereButton, doShow);
|
toolBar.showTool(newSphereButton, doShow);
|
||||||
toolBar.showTool(newLightButton, doShow);
|
toolBar.showTool(newLightButton, doShow);
|
||||||
|
@ -309,7 +307,7 @@ var toolBar = (function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
var newModelButtonDown = false;
|
var newModelButtonDown = false;
|
||||||
var browseModelsButtonDown = false;
|
var browseMarketplaceButtonDown = false;
|
||||||
that.mousePressEvent = function (event) {
|
that.mousePressEvent = function (event) {
|
||||||
var clickedOverlay,
|
var clickedOverlay,
|
||||||
url,
|
url,
|
||||||
|
@ -328,7 +326,7 @@ var toolBar = (function () {
|
||||||
newModelButtonDown = true;
|
newModelButtonDown = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (browseModelsButton === toolBar.clicked(clickedOverlay)) {
|
if (browseMarketplaceButton === toolBar.clicked(clickedOverlay)) {
|
||||||
if (marketplaceWindow.url != MARKETPLACE_URL) {
|
if (marketplaceWindow.url != MARKETPLACE_URL) {
|
||||||
marketplaceWindow.setURL(MARKETPLACE_URL);
|
marketplaceWindow.setURL(MARKETPLACE_URL);
|
||||||
}
|
}
|
||||||
|
@ -427,9 +425,9 @@ var toolBar = (function () {
|
||||||
}
|
}
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
} else if (browseModelsButtonDown) {
|
} else if (browseMarketplaceButtonDown) {
|
||||||
var clickedOverlay = Overlays.getOverlayAtPoint({ x: event.x, y: event.y });
|
var clickedOverlay = Overlays.getOverlayAtPoint({ x: event.x, y: event.y });
|
||||||
if (browseModelsButton === toolBar.clicked(clickedOverlay)) {
|
if (browseMarketplaceButton === toolBar.clicked(clickedOverlay)) {
|
||||||
url = Window.s3Browse(".*(fbx|FBX|obj|OBJ)");
|
url = Window.s3Browse(".*(fbx|FBX|obj|OBJ)");
|
||||||
if (url !== null && url !== "") {
|
if (url !== null && url !== "") {
|
||||||
addModel(url);
|
addModel(url);
|
||||||
|
@ -439,7 +437,7 @@ var toolBar = (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
newModelButtonDown = false;
|
newModelButtonDown = false;
|
||||||
browseModelsButtonDown = false;
|
browseMarketplaceButtonDown = false;
|
||||||
|
|
||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue