Make marketplace button always visible

This commit is contained in:
Ryan Huffman 2015-04-08 13:57:41 -07:00
parent b89a50590e
commit b6af9fde9e

View file

@ -134,12 +134,19 @@ var toolBar = (function () {
newSphereButton,
newLightButton,
newTextButton,
browseModelsButton;
browseMarketplaceButton;
function initialize() {
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({
imageURL: toolIconUrl + "edit-status.svg",
subImage: { x: 0, y: Tool.IMAGE_WIDTH, width: Tool.IMAGE_WIDTH, height: Tool.IMAGE_HEIGHT },
@ -158,14 +165,6 @@ var toolBar = (function () {
visible: false
});
browseModelsButton = toolBar.addTool({
imageURL: toolIconUrl + "marketplace.svg",
width: toolWidth,
height: toolHeight,
alpha: 0.9,
visible: false
});
newCubeButton = toolBar.addTool({
imageURL: toolIconUrl + "add-cube.svg",
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
that.showTools = function(doShow) {
toolBar.showTool(newModelButton, doShow);
toolBar.showTool(browseModelsButton, doShow);
toolBar.showTool(newCubeButton, doShow);
toolBar.showTool(newSphereButton, doShow);
toolBar.showTool(newLightButton, doShow);
@ -309,7 +307,7 @@ var toolBar = (function () {
};
var newModelButtonDown = false;
var browseModelsButtonDown = false;
var browseMarketplaceButtonDown = false;
that.mousePressEvent = function (event) {
var clickedOverlay,
url,
@ -328,7 +326,7 @@ var toolBar = (function () {
newModelButtonDown = true;
return true;
}
if (browseModelsButton === toolBar.clicked(clickedOverlay)) {
if (browseMarketplaceButton === toolBar.clicked(clickedOverlay)) {
if (marketplaceWindow.url != MARKETPLACE_URL) {
marketplaceWindow.setURL(MARKETPLACE_URL);
}
@ -427,9 +425,9 @@ var toolBar = (function () {
}
handled = true;
}
} else if (browseModelsButtonDown) {
} else if (browseMarketplaceButtonDown) {
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)");
if (url !== null && url !== "") {
addModel(url);
@ -439,7 +437,7 @@ var toolBar = (function () {
}
newModelButtonDown = false;
browseModelsButtonDown = false;
browseMarketplaceButtonDown = false;
return handled;
}