mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 05:23:33 +02:00
rename marketplace.js to examples.js
This commit is contained in:
parent
cd548744f6
commit
eaa0ba9e32
2 changed files with 27 additions and 29 deletions
|
@ -11,7 +11,7 @@
|
||||||
Script.load("away.js");
|
Script.load("away.js");
|
||||||
Script.load("progress.js");
|
Script.load("progress.js");
|
||||||
Script.load("edit.js");
|
Script.load("edit.js");
|
||||||
Script.load("marketplace.js");
|
Script.load("examples.js");
|
||||||
Script.load("selectAudioDevice.js");
|
Script.load("selectAudioDevice.js");
|
||||||
Script.load("notifications.js");
|
Script.load("notifications.js");
|
||||||
Script.load("users.js");
|
Script.load("users.js");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//
|
//
|
||||||
// marketplace.js
|
// examples.js
|
||||||
// examples
|
// examples
|
||||||
//
|
//
|
||||||
// Created by Eric Levin on 8 Jan 2016
|
// Created by Eric Levin on 8 Jan 2016
|
||||||
|
@ -16,9 +16,9 @@ Script.include([
|
||||||
HIFI_PUBLIC_BUCKET = "http://s3.amazonaws.com/hifi-public/";
|
HIFI_PUBLIC_BUCKET = "http://s3.amazonaws.com/hifi-public/";
|
||||||
var toolIconUrl = HIFI_PUBLIC_BUCKET + "images/tools/";
|
var toolIconUrl = HIFI_PUBLIC_BUCKET + "images/tools/";
|
||||||
|
|
||||||
var MARKETPLACE_URL = "https://metaverse.highfidelity.com/marketplace";
|
var EXAMPLES_URL = "https://metaverse.highfidelity.com/examples";
|
||||||
var marketplaceWindow = new OverlayWebWindow({
|
var examplesWindow = new OverlayWebWindow({
|
||||||
title: 'Marketplace',
|
title: 'Examples',
|
||||||
source: "about:blank",
|
source: "about:blank",
|
||||||
width: 900,
|
width: 900,
|
||||||
height: 700,
|
height: 700,
|
||||||
|
@ -29,43 +29,43 @@ var toolHeight = 50;
|
||||||
var toolWidth = 50;
|
var toolWidth = 50;
|
||||||
|
|
||||||
|
|
||||||
function showMarketplace(marketplaceID) {
|
function showExamples(marketplaceID) {
|
||||||
var url = MARKETPLACE_URL;
|
var url = EXAMPLES_URL;
|
||||||
if (marketplaceID) {
|
if (marketplaceID) {
|
||||||
url = url + "/items/" + marketplaceID;
|
url = url + "/items/" + marketplaceID;
|
||||||
}
|
}
|
||||||
print("setting marketplace URL to " + url);
|
print("setting examples URL to " + url);
|
||||||
marketplaceWindow.setURL(url);
|
examplesWindow.setURL(url);
|
||||||
marketplaceWindow.setVisible(true);
|
examplesWindow.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideMarketplace() {
|
function hideExamples() {
|
||||||
marketplaceWindow.setVisible(false);
|
examplesWindow.setVisible(false);
|
||||||
marketplaceWindow.setURL("about:blank");
|
examplesWindow.setURL("about:blank");
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleMarketplace() {
|
function toggleExamples() {
|
||||||
if (marketplaceWindow.visible) {
|
if (examplesWindow.visible) {
|
||||||
hideMarketplace();
|
hideExamples();
|
||||||
} else {
|
} else {
|
||||||
showMarketplace();
|
showExamples();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var toolBar = (function() {
|
var toolBar = (function() {
|
||||||
var that = {},
|
var that = {},
|
||||||
toolBar,
|
toolBar,
|
||||||
browseMarketplaceButton;
|
browseExamplesButton;
|
||||||
|
|
||||||
function initialize() {
|
function initialize() {
|
||||||
toolBar = new ToolBar(0, 0, ToolBar.VERTICAL, "highfidelity.marketplace.toolbar", function(windowDimensions, toolbar) {
|
toolBar = new ToolBar(0, 0, ToolBar.VERTICAL, "highfidelity.examples.toolbar", function(windowDimensions, toolbar) {
|
||||||
return {
|
return {
|
||||||
x: windowDimensions.x - 8 - toolbar.width,
|
x: windowDimensions.x - 8 - toolbar.width,
|
||||||
y: 135
|
y: 135
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
browseMarketplaceButton = toolBar.addTool({
|
browseExamplesButton = toolBar.addTool({
|
||||||
imageURL: toolIconUrl + "market-01.svg",
|
imageURL: toolIconUrl + "examples-01.svg",
|
||||||
subImage: {
|
subImage: {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: Tool.IMAGE_WIDTH,
|
y: Tool.IMAGE_WIDTH,
|
||||||
|
@ -79,10 +79,10 @@ var toolBar = (function() {
|
||||||
showButtonDown: true
|
showButtonDown: true
|
||||||
});
|
});
|
||||||
|
|
||||||
toolBar.showTool(browseMarketplaceButton, true);
|
toolBar.showTool(browseExamplesButton, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
var browseMarketplaceButtonDown = false;
|
var browseExamplesButtonDown = false;
|
||||||
that.mousePressEvent = function(event) {
|
that.mousePressEvent = function(event) {
|
||||||
var clickedOverlay,
|
var clickedOverlay,
|
||||||
url,
|
url,
|
||||||
|
@ -98,10 +98,8 @@ var toolBar = (function() {
|
||||||
y: event.y
|
y: event.y
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (browseExamplesButton === toolBar.clicked(clickedOverlay)) {
|
||||||
|
toggleExamples();
|
||||||
if (browseMarketplaceButton === toolBar.clicked(clickedOverlay)) {
|
|
||||||
toggleMarketplace();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +110,7 @@ var toolBar = (function() {
|
||||||
var handled = false;
|
var handled = false;
|
||||||
|
|
||||||
|
|
||||||
if (browseMarketplaceButtonDown) {
|
if (browseExamplesButtonDown) {
|
||||||
var clickedOverlay = Overlays.getOverlayAtPoint({
|
var clickedOverlay = Overlays.getOverlayAtPoint({
|
||||||
x: event.x,
|
x: event.x,
|
||||||
y: event.y
|
y: event.y
|
||||||
|
@ -120,7 +118,7 @@ var toolBar = (function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
newModelButtonDown = false;
|
newModelButtonDown = false;
|
||||||
browseMarketplaceButtonDown = false;
|
browseExamplesButtonDown = false;
|
||||||
|
|
||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
Loading…
Reference in a new issue