From 8698ee61cdf13efe54d74fa5f6930de54bf9075b Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Tue, 20 Dec 2016 22:44:10 +0000 Subject: [PATCH 1/7] commit update --- .../resources/icons/tablet-icons/bubble-i.svg | 46 +++++++++++++++++++ .../resources/icons/tablet-icons/edit-i.svg | 25 ++++++++++ .../resources/icons/tablet-icons/goto-i.svg | 16 +++++++ .../resources/icons/tablet-icons/help-i.svg | 27 +++++++++++ .../resources/icons/tablet-icons/market-i.svg | 23 ++++++++++ .../resources/icons/tablet-icons/menu-i.svg | 17 +++++++ .../resources/icons/tablet-icons/mic-a.svg | 21 +++++++++ .../resources/icons/tablet-icons/mic-i.svg | 22 +++++++++ .../resources/icons/tablet-icons/people-i.svg | 22 +++++++++ .../icons/tablet-icons/scripts-i.svg | 21 +++++++++ .../resources/icons/tablet-icons/snap-i.svg | 18 ++++++++ .../resources/icons/tablet-icons/switch-a.svg | 16 +++++++ .../resources/icons/tablet-icons/switch-i.svg | 15 ++++++ scripts/system/bubble.js | 3 +- scripts/system/edit.js | 2 +- scripts/system/goto.js | 3 +- scripts/system/snapshot.js | 39 ++++++---------- 17 files changed, 309 insertions(+), 27 deletions(-) create mode 100644 interface/resources/icons/tablet-icons/bubble-i.svg create mode 100644 interface/resources/icons/tablet-icons/edit-i.svg create mode 100644 interface/resources/icons/tablet-icons/goto-i.svg create mode 100644 interface/resources/icons/tablet-icons/help-i.svg create mode 100644 interface/resources/icons/tablet-icons/market-i.svg create mode 100644 interface/resources/icons/tablet-icons/menu-i.svg create mode 100644 interface/resources/icons/tablet-icons/mic-a.svg create mode 100644 interface/resources/icons/tablet-icons/mic-i.svg create mode 100644 interface/resources/icons/tablet-icons/people-i.svg create mode 100644 interface/resources/icons/tablet-icons/scripts-i.svg create mode 100644 interface/resources/icons/tablet-icons/snap-i.svg create mode 100644 interface/resources/icons/tablet-icons/switch-a.svg create mode 100644 interface/resources/icons/tablet-icons/switch-i.svg diff --git a/interface/resources/icons/tablet-icons/bubble-i.svg b/interface/resources/icons/tablet-icons/bubble-i.svg new file mode 100644 index 0000000000..d7c8948e01 --- /dev/null +++ b/interface/resources/icons/tablet-icons/bubble-i.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/interface/resources/icons/tablet-icons/edit-i.svg b/interface/resources/icons/tablet-icons/edit-i.svg new file mode 100644 index 0000000000..e430333597 --- /dev/null +++ b/interface/resources/icons/tablet-icons/edit-i.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + diff --git a/interface/resources/icons/tablet-icons/goto-i.svg b/interface/resources/icons/tablet-icons/goto-i.svg new file mode 100644 index 0000000000..911e346866 --- /dev/null +++ b/interface/resources/icons/tablet-icons/goto-i.svg @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/interface/resources/icons/tablet-icons/help-i.svg b/interface/resources/icons/tablet-icons/help-i.svg new file mode 100644 index 0000000000..8d53e04d64 --- /dev/null +++ b/interface/resources/icons/tablet-icons/help-i.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/interface/resources/icons/tablet-icons/market-i.svg b/interface/resources/icons/tablet-icons/market-i.svg new file mode 100644 index 0000000000..bf9aa9335f --- /dev/null +++ b/interface/resources/icons/tablet-icons/market-i.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + diff --git a/interface/resources/icons/tablet-icons/menu-i.svg b/interface/resources/icons/tablet-icons/menu-i.svg new file mode 100644 index 0000000000..a7a7400ffd --- /dev/null +++ b/interface/resources/icons/tablet-icons/menu-i.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/interface/resources/icons/tablet-icons/mic-a.svg b/interface/resources/icons/tablet-icons/mic-a.svg new file mode 100644 index 0000000000..69feec7c17 --- /dev/null +++ b/interface/resources/icons/tablet-icons/mic-a.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + diff --git a/interface/resources/icons/tablet-icons/mic-i.svg b/interface/resources/icons/tablet-icons/mic-i.svg new file mode 100644 index 0000000000..c4eda55cbc --- /dev/null +++ b/interface/resources/icons/tablet-icons/mic-i.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + diff --git a/interface/resources/icons/tablet-icons/people-i.svg b/interface/resources/icons/tablet-icons/people-i.svg new file mode 100644 index 0000000000..8665dfc6f7 --- /dev/null +++ b/interface/resources/icons/tablet-icons/people-i.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + diff --git a/interface/resources/icons/tablet-icons/scripts-i.svg b/interface/resources/icons/tablet-icons/scripts-i.svg new file mode 100644 index 0000000000..647cf805ce --- /dev/null +++ b/interface/resources/icons/tablet-icons/scripts-i.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + diff --git a/interface/resources/icons/tablet-icons/snap-i.svg b/interface/resources/icons/tablet-icons/snap-i.svg new file mode 100644 index 0000000000..abafa1c3cf --- /dev/null +++ b/interface/resources/icons/tablet-icons/snap-i.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + diff --git a/interface/resources/icons/tablet-icons/switch-a.svg b/interface/resources/icons/tablet-icons/switch-a.svg new file mode 100644 index 0000000000..2e26d09e62 --- /dev/null +++ b/interface/resources/icons/tablet-icons/switch-a.svg @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/interface/resources/icons/tablet-icons/switch-i.svg b/interface/resources/icons/tablet-icons/switch-i.svg new file mode 100644 index 0000000000..a6460f9c27 --- /dev/null +++ b/interface/resources/icons/tablet-icons/switch-i.svg @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/scripts/system/bubble.js b/scripts/system/bubble.js index 7880faa934..35fc7db59b 100644 --- a/scripts/system/bubble.js +++ b/scripts/system/bubble.js @@ -166,6 +166,7 @@ // Setup the bubble button and add it to the toolbar var button = tablet.addButton({ + icon: "icons/tablet-icons/bubble-i.svg", text: "BUBBLE" }); onBubbleToggled(); @@ -176,7 +177,7 @@ // Cleanup the toolbar button and overlays when script is stopped Script.scriptEnding.connect(function () { - tablet.removeButton('bubble'); + tablet.removeButton(button); button.clicked.disconnect(Users.toggleIgnoreRadius); Users.ignoreRadiusEnabledChanged.disconnect(onBubbleToggled); Users.enteredIgnoreRadius.disconnect(enteredIgnoreRadius); diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 63e64ba982..083d587480 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -196,7 +196,6 @@ var toolBar = (function () { function cleanup() { that.setActive(false); - systemToolbar.removeButton(EDIT_TOGGLE_BUTTON); } function addButton(name, image, handler) { @@ -233,6 +232,7 @@ var toolBar = (function () { tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); activeButton = tablet.addButton({ + icon: "icons/tablet-icons/edit-i.svg", text: "EDIT" }); diff --git a/scripts/system/goto.js b/scripts/system/goto.js index 62b9dce35b..b058f9695b 100644 --- a/scripts/system/goto.js +++ b/scripts/system/goto.js @@ -16,6 +16,7 @@ var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); var isActive = false var button = tablet.addButton({ + icon: "icons/tablet-icons/goto-i.svg", text:"GOTO" }); @@ -35,7 +36,7 @@ button.clicked.connect(onClicked); DialogsManager.addressBarShown.connect(onAddressBarShown); Script.scriptEnding.connect(function () { - toolBar.removeButton("goto"); + tablet.removeButton(button); button.clicked.disconnect(onClicked); DialogsManager.addressBarShown.disconnect(onAddressBarShown); }); diff --git a/scripts/system/snapshot.js b/scripts/system/snapshot.js index d79a6e46cb..a89203235c 100644 --- a/scripts/system/snapshot.js +++ b/scripts/system/snapshot.js @@ -11,18 +11,13 @@ (function() { // BEGIN LOCAL_SCOPE var SNAPSHOT_DELAY = 500; // 500ms -var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system"); +var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); var resetOverlays; var reticleVisible; var clearOverlayWhenMoving; -var button = toolBar.addButton({ - objectName: "snapshot", - imageURL: Script.resolvePath("assets/images/tools/snap.svg"), - visible: true, - buttonState: 1, - defaultState: 1, - hoverState: 2, - alpha: 0.9, +var button = tablet.addButton({ + icon: "icons/tablet-icons/snap-i.svg", + text: "SNAP" }); function shouldOpenFeedAfterShare() { @@ -117,17 +112,14 @@ function onClicked() { Reticle.visible = false; Window.snapshotTaken.connect(resetButtons); - button.writeProperty("buttonState", 0); - button.writeProperty("defaultState", 0); - button.writeProperty("hoverState", 2); + //button.writeProperty("buttonState", 0); + //button.writeProperty("defaultState", 0); + //button.writeProperty("hoverState", 2); // hide overlays if they are on if (resetOverlays) { Menu.setIsOptionChecked("Overlays", false); } - - // hide hud - toolBar.writeProperty("visible", false); // take snapshot (with no notification) Script.setTimeout(function () { @@ -160,7 +152,7 @@ function resetButtons(pathStillSnapshot, pathAnimatedSnapshot, notify) { // If we ARE taking an animated snapshot, we've already re-enabled the HUD by this point. if (pathAnimatedSnapshot === "") { // show hud - toolBar.writeProperty("visible", true); + //toolBar.writeProperty("visible", true); Reticle.visible = reticleVisible; // show overlays if they were on if (resetOverlays) { @@ -171,9 +163,9 @@ function resetButtons(pathStillSnapshot, pathAnimatedSnapshot, notify) { button.clicked.connect(onClicked); } // update button states - button.writeProperty("buttonState", 1); - button.writeProperty("defaultState", 1); - button.writeProperty("hoverState", 3); + //button.writeProperty("buttonState", 1); + //button.writeProperty("defaultState", 1); + //button.writeProperty("hoverState", 3); Window.snapshotTaken.disconnect(resetButtons); // A Snapshot Review dialog might be left open indefinitely after taking the picture, @@ -197,13 +189,12 @@ function resetButtons(pathStillSnapshot, pathAnimatedSnapshot, notify) { function processingGif() { // show hud - toolBar.writeProperty("visible", true); Reticle.visible = reticleVisible; // update button states - button.writeProperty("buttonState", 0); - button.writeProperty("defaultState", 0); - button.writeProperty("hoverState", 2); + //button.writeProperty("buttonState", 0); + //button.writeProperty("defaultState", 0); + //button.writeProperty("hoverState", 2); // Don't allow the user to click the snapshot button yet button.clicked.disconnect(onClicked); // show overlays if they were on @@ -217,7 +208,7 @@ Window.snapshotShared.connect(snapshotShared); Window.processingGif.connect(processingGif); Script.scriptEnding.connect(function () { - toolBar.removeButton("snapshot"); + tablet.removeButton(button); button.clicked.disconnect(onClicked); Window.snapshotShared.disconnect(snapshotShared); Window.processingGif.disconnect(processingGif); From fa761af1a60037cc0df77f9e84db0fbbb6475c45 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Tue, 20 Dec 2016 23:37:54 +0000 Subject: [PATCH 2/7] update#2 --- .../resources/icons/tablet-icons/ignore.svg | 177 ++++++++++++++++++ .../resources/icons/tablet-icons/kick.svg | 140 ++++++++++++++ scripts/system/hmd.js | 1 + scripts/system/mod.js | 23 +-- 4 files changed, 327 insertions(+), 14 deletions(-) create mode 100644 interface/resources/icons/tablet-icons/ignore.svg create mode 100644 interface/resources/icons/tablet-icons/kick.svg diff --git a/interface/resources/icons/tablet-icons/ignore.svg b/interface/resources/icons/tablet-icons/ignore.svg new file mode 100644 index 0000000000..f315c5f249 --- /dev/null +++ b/interface/resources/icons/tablet-icons/ignore.svg @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/interface/resources/icons/tablet-icons/kick.svg b/interface/resources/icons/tablet-icons/kick.svg new file mode 100644 index 0000000000..1eed6e7f43 --- /dev/null +++ b/interface/resources/icons/tablet-icons/kick.svg @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/hmd.js b/scripts/system/hmd.js index bfe2be7664..e6e8ed1c5c 100644 --- a/scripts/system/hmd.js +++ b/scripts/system/hmd.js @@ -53,6 +53,7 @@ function onClicked(){ } if (headset) { button = tablet.addButton({ + icon: "icons/tablet-icons/switch-a.svg", text: "SWITCH" }); onHmdChanged(HMD.active); diff --git a/scripts/system/mod.js b/scripts/system/mod.js index 7e5cc5d2a5..d3f384f63d 100644 --- a/scripts/system/mod.js +++ b/scripts/system/mod.js @@ -18,29 +18,24 @@ Script.include("/~/system/libraries/controllers.js"); // grab the toolbar -var toolbar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system"); +var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); var ASSETS_PATH = Script.resolvePath("assets"); var TOOLS_PATH = Script.resolvePath("assets/images/tools/"); function buttonImageURL() { - return TOOLS_PATH + (Users.canKick ? 'kick.svg' : 'ignore.svg'); + return "icons/tablet-icons/" + (Users.canKick ? 'kick.svg' : 'ignore.svg'); } // setup the mod button and add it to the toolbar var button = toolbar.addButton({ - objectName: 'mod', - imageURL: buttonImageURL(), - visible: true, - buttonState: 1, - defaultState: 1, - hoverState: 3, - alpha: 0.9 + icon: buttonImageURL(), + text: "KICK" }); // if this user's kick permissions change, change the state of the button in the HUD Users.canKickChanged.connect(function(canKick){ - button.writeProperty('imageURL', buttonImageURL()); + button.editProperties({icon: buttonImageURL()}); }); var isShowingOverlays = false; @@ -69,9 +64,9 @@ function buttonClicked(){ isShowingOverlays = true; } - button.writeProperty('buttonState', isShowingOverlays ? 0 : 1); - button.writeProperty('defaultState', isShowingOverlays ? 0 : 1); - button.writeProperty('hoverState', isShowingOverlays ? 2 : 3); + //button.writeProperty('buttonState', isShowingOverlays ? 0 : 1); + //button.writeProperty('defaultState', isShowingOverlays ? 0 : 1); + //button.writeProperty('hoverState', isShowingOverlays ? 2 : 3); } button.clicked.connect(buttonClicked); @@ -251,7 +246,7 @@ triggerMapping.enable(); // cleanup the toolbar button and overlays when script is stopped Script.scriptEnding.connect(function() { - toolbar.removeButton('mod'); + tablet.removeButton(button); removeOverlays(); triggerMapping.disable(); }); From 5ed8831beeb3374c50efa3070b2f30b82361e302 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 21 Dec 2016 23:25:40 +0000 Subject: [PATCH 3/7] all hud buttons on tablet --- .../resources/icons/tablet-icons/ignore-i.svg | 28 ++++++++++ scripts/system/bubble.js | 2 +- scripts/system/edit.js | 1 - scripts/system/goto.js | 2 +- scripts/system/help.js | 1 + scripts/system/libraries/WebTablet.js | 8 +-- scripts/system/marketplaces/marketplace.js | 53 ++++++------------- scripts/system/mod.js | 8 +-- scripts/system/mute.js | 26 ++++----- scripts/system/snapshot.js | 2 +- scripts/system/tablet-ui/tabletUI.js | 12 ----- 11 files changed, 65 insertions(+), 78 deletions(-) create mode 100644 interface/resources/icons/tablet-icons/ignore-i.svg diff --git a/interface/resources/icons/tablet-icons/ignore-i.svg b/interface/resources/icons/tablet-icons/ignore-i.svg new file mode 100644 index 0000000000..3b73385574 --- /dev/null +++ b/interface/resources/icons/tablet-icons/ignore-i.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + diff --git a/scripts/system/bubble.js b/scripts/system/bubble.js index 35fc7db59b..556cb91487 100644 --- a/scripts/system/bubble.js +++ b/scripts/system/bubble.js @@ -177,8 +177,8 @@ // Cleanup the toolbar button and overlays when script is stopped Script.scriptEnding.connect(function () { - tablet.removeButton(button); button.clicked.disconnect(Users.toggleIgnoreRadius); + tablet.removeButton(button); Users.ignoreRadiusEnabledChanged.disconnect(onBubbleToggled); Users.enteredIgnoreRadius.disconnect(enteredIgnoreRadius); Overlays.deleteOverlay(bubbleOverlay); diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 083d587480..4c931589d9 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -478,7 +478,6 @@ var toolBar = (function () { toolBar.writeProperty("shown", false); toolBar.writeProperty("shown", true); } - // toolBar.selectTool(activeButton, isActive); lightOverlayManager.setVisible(isActive && Menu.isOptionChecked(MENU_SHOW_LIGHTS_IN_EDIT_MODE)); Entities.setDrawZoneBoundaries(isActive && Menu.isOptionChecked(MENU_SHOW_ZONES_IN_EDIT_MODE)); }; diff --git a/scripts/system/goto.js b/scripts/system/goto.js index b058f9695b..5059a27ce2 100644 --- a/scripts/system/goto.js +++ b/scripts/system/goto.js @@ -36,8 +36,8 @@ button.clicked.connect(onClicked); DialogsManager.addressBarShown.connect(onAddressBarShown); Script.scriptEnding.connect(function () { - tablet.removeButton(button); button.clicked.disconnect(onClicked); + tablet.removeButton(button); DialogsManager.addressBarShown.disconnect(onAddressBarShown); }); diff --git a/scripts/system/help.js b/scripts/system/help.js index b95ccbb529..663d2edf56 100644 --- a/scripts/system/help.js +++ b/scripts/system/help.js @@ -16,6 +16,7 @@ var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ + icon: "icons/tablet-icons/help-i.svg", text: "HELP" }); diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index 1445e9250e..a9f433a38b 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -41,7 +41,7 @@ function calcSpawnInfo() { // ctor WebTablet = function (url, width, dpi, location, clientOnly) { - + print(url); var _this = this; var ASPECT = 4.0 / 3.0; var WIDTH = width || DEFAULT_WIDTH; @@ -54,7 +54,7 @@ WebTablet = function (url, width, dpi, location, clientOnly) { var spawnInfo = calcSpawnInfo(); var tabletEntityPosition = spawnInfo.position; var tabletEntityRotation = spawnInfo.rotation; - + var tabletProperties = { name: "WebTablet Tablet", type: "Model", @@ -75,7 +75,7 @@ WebTablet = function (url, width, dpi, location, clientOnly) { tabletProperties.position = spawnInfo.position; tabletProperties.rotation = spawnInfo.rotation; } - + this.tabletURL = url; this.tabletEntityID = Entities.addEntity(tabletProperties, clientOnly); var WEB_ENTITY_Z_OFFSET = -0.01; @@ -117,6 +117,8 @@ WebTablet = function (url, width, dpi, location, clientOnly) { Entities.editEntity(_this.homeButtonEntity, {color: {red: 255, green: 255, blue: 0}}); _this.clicked = true; } + var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + tablet.gotoHomeScreen(); } } diff --git a/scripts/system/marketplaces/marketplace.js b/scripts/system/marketplaces/marketplace.js index 04e59697d1..4cfac86501 100644 --- a/scripts/system/marketplaces/marketplace.js +++ b/scripts/system/marketplaces/marketplace.js @@ -42,30 +42,11 @@ function shouldShowWebTablet() { } function showMarketplace(marketplaceID) { - if (shouldShowWebTablet()) { - updateButtonState(true); - - if (HMD.tabletID) { - UIWebTablet.createWebEntity("https://metaverse.highfidelity.com/marketplace"); - HMD.tabletID = UIWebTablet.webEntityID; - } else { - marketplaceWebTablet = new WebTablet("https://metaverse.highfidelity.com/marketplace", - null, // width - null, // dpi - null, // location - true); // client-only - marketplaceWebTablet.register(); - } - Settings.setValue(persistenceKey, marketplaceWebTablet.pickle()); - } else { - var url = MARKETPLACE_URL; - if (marketplaceID) { - url = url + "/items/" + marketplaceID; - } - marketplaceWindow.setURL(url); - marketplaceWindow.setVisible(true); + var url = MARKETPLACE_URL; + if (marketplaceID) { + url = url + "/items/" + marketplaceID; } - + tablet.gotoWebScreen(url); marketplaceVisible = true; UserActivityLogger.openedMarketplace(); } @@ -81,15 +62,15 @@ function hideTablet(tablet) { Settings.setValue(persistenceKey, ""); } function clearOldTablet() { // If there was a tablet from previous domain or session, kill it and let it be recreated - var tablet = WebTablet.unpickle(Settings.getValue(persistenceKey, "")); - hideTablet(tablet); + //var tablet = WebTablet.unpickle(Settings.getValue(persistenceKey, "")); + //hideTablet(tablet); } function hideMarketplace() { if (marketplaceWindow.visible) { marketplaceWindow.setVisible(false); marketplaceWindow.setURL("about:blank"); } else if (marketplaceWebTablet) { - hideTablet(marketplaceWebTablet); + //hideTablet(marketplaceWebTablet); } marketplaceVisible = false; } @@ -102,21 +83,17 @@ function toggleMarketplace() { } } -var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system"); +var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); -var browseExamplesButton = toolBar.addButton({ - imageURL: toolIconUrl + "market.svg", - objectName: "marketplace", - buttonState: 1, - defaultState: 1, - hoverState: 3, - alpha: 0.9 +var browseExamplesButton = tablet.addButton({ + icon: "icons/tablet-icons/market-i.svg", + text: "MARKET" }); function updateButtonState(visible) { - browseExamplesButton.writeProperty('buttonState', visible ? 0 : 1); - browseExamplesButton.writeProperty('defaultState', visible ? 0 : 1); - browseExamplesButton.writeProperty('hoverState', visible ? 2 : 3); + //browseExamplesButton.writeProperty('buttonState', visible ? 0 : 1); + //browseExamplesButton.writeProperty('defaultState', visible ? 0 : 1); + //browseExamplesButton.writeProperty('hoverState', visible ? 2 : 3); } function onMarketplaceWindowVisibilityChanged() { updateButtonState(marketplaceWindow.visible); @@ -135,8 +112,8 @@ clearOldTablet(); // Run once at startup, in case there's anything laying around // but the HUD version stays around, so lets do the same. Script.scriptEnding.connect(function () { - toolBar.removeButton("marketplace"); browseExamplesButton.clicked.disconnect(onClick); + tablet.removeButton(browseExamplesButton); marketplaceWindow.visibleChanged.disconnect(onMarketplaceWindowVisibilityChanged); }); diff --git a/scripts/system/mod.js b/scripts/system/mod.js index d3f384f63d..4574861455 100644 --- a/scripts/system/mod.js +++ b/scripts/system/mod.js @@ -24,18 +24,18 @@ var ASSETS_PATH = Script.resolvePath("assets"); var TOOLS_PATH = Script.resolvePath("assets/images/tools/"); function buttonImageURL() { - return "icons/tablet-icons/" + (Users.canKick ? 'kick.svg' : 'ignore.svg'); + return (Users.canKick ? "kick.svg" : "ignore.svg"); } // setup the mod button and add it to the toolbar -var button = toolbar.addButton({ - icon: buttonImageURL(), +var button = tablet.addButton({ + icon: "icons/tablet-icons/ignore-i.svg", text: "KICK" }); // if this user's kick permissions change, change the state of the button in the HUD Users.canKickChanged.connect(function(canKick){ - button.editProperties({icon: buttonImageURL()}); + button.editProperties({text: buttonImageURL()}); }); var isShowingOverlays = false; diff --git a/scripts/system/mute.js b/scripts/system/mute.js index 722ed65b3d..97a00fb0b2 100644 --- a/scripts/system/mute.js +++ b/scripts/system/mute.js @@ -13,26 +13,18 @@ (function() { // BEGIN LOCAL_SCOPE -var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system"); +var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); -var button = toolBar.addButton({ - objectName: "mute", - imageURL: Script.resolvePath("assets/images/tools/mic.svg"), - visible: true, - buttonState: 1, - defaultState: 1, - hoverState: 3, - alpha: 0.9 +function muteURL() { + return "icons/tablet-icons/" + (AudioDevice.getMuted() ? "mic-a.svg" : "mic-i.svg"); +} +var button = tablet.addButton({ + icon: "icons/tablet-icons/mic-a.svg", + text: "MUTE" }); function onMuteToggled() { - // We could just toggle state, but we're less likely to get out of wack if we read the AudioDevice. - // muted => button "on" state => 1. go figure. - var state = AudioDevice.getMuted() ? 0 : 1; - var hoverState = AudioDevice.getMuted() ? 2 : 3; - button.writeProperty('buttonState', state); - button.writeProperty('defaultState', state); - button.writeProperty('hoverState', hoverState); + button.editProperties({icon: muteURL()}); } onMuteToggled(); function onClicked(){ @@ -43,8 +35,8 @@ button.clicked.connect(onClicked); AudioDevice.muteToggled.connect(onMuteToggled); Script.scriptEnding.connect(function () { - toolBar.removeButton("mute"); button.clicked.disconnect(onClicked); + tablet.removeButton(button); AudioDevice.muteToggled.disconnect(onMuteToggled); }); diff --git a/scripts/system/snapshot.js b/scripts/system/snapshot.js index a89203235c..ee346a0abb 100644 --- a/scripts/system/snapshot.js +++ b/scripts/system/snapshot.js @@ -208,8 +208,8 @@ Window.snapshotShared.connect(snapshotShared); Window.processingGif.connect(processingGif); Script.scriptEnding.connect(function () { - tablet.removeButton(button); button.clicked.disconnect(onClicked); + tablet.removeButton(button); Window.snapshotShared.disconnect(snapshotShared); Window.processingGif.disconnect(processingGif); }); diff --git a/scripts/system/tablet-ui/tabletUI.js b/scripts/system/tablet-ui/tabletUI.js index 077485ea35..784d7727d5 100644 --- a/scripts/system/tablet-ui/tabletUI.js +++ b/scripts/system/tablet-ui/tabletUI.js @@ -26,18 +26,6 @@ UIWebTablet = new WebTablet("qml/hifi/tablet/TabletRoot.qml", null, null, tabletLocation); UIWebTablet.register(); HMD.tabletID = UIWebTablet.webEntityID; - - var setUpTabletUI = function() { - var root = UIWebTablet.getRoot(); - if (!root) { - print("HERE no root yet"); - Script.setTimeout(setUpTabletUI, 100); - return; - } - print("HERE got root", root); - } - - Script.setTimeout(setUpTabletUI, 100); } function hideTabletUI() { From 1753508f534f95d2a844663742a6ee8ecd30b89a Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 21 Dec 2016 23:31:00 +0000 Subject: [PATCH 4/7] diff minimize --- scripts/system/snapshot.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/scripts/system/snapshot.js b/scripts/system/snapshot.js index ee346a0abb..236b3c1793 100644 --- a/scripts/system/snapshot.js +++ b/scripts/system/snapshot.js @@ -111,10 +111,6 @@ function onClicked() { reticleVisible = Reticle.visible; Reticle.visible = false; Window.snapshotTaken.connect(resetButtons); - - //button.writeProperty("buttonState", 0); - //button.writeProperty("defaultState", 0); - //button.writeProperty("hoverState", 2); // hide overlays if they are on if (resetOverlays) { @@ -162,10 +158,6 @@ function resetButtons(pathStillSnapshot, pathAnimatedSnapshot, notify) { // Allow the user to click the snapshot HUD button again button.clicked.connect(onClicked); } - // update button states - //button.writeProperty("buttonState", 1); - //button.writeProperty("defaultState", 1); - //button.writeProperty("hoverState", 3); Window.snapshotTaken.disconnect(resetButtons); // A Snapshot Review dialog might be left open indefinitely after taking the picture, @@ -191,11 +183,6 @@ function processingGif() { // show hud Reticle.visible = reticleVisible; - // update button states - //button.writeProperty("buttonState", 0); - //button.writeProperty("defaultState", 0); - //button.writeProperty("hoverState", 2); - // Don't allow the user to click the snapshot button yet button.clicked.disconnect(onClicked); // show overlays if they were on if (resetOverlays) { From cad9f66572f068c01a296b40547c252538c2422f Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 21 Dec 2016 23:35:46 +0000 Subject: [PATCH 5/7] removed qml generated buttons --- .../resources/qml/hifi/tablet/Tablet.qml | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/Tablet.qml b/interface/resources/qml/hifi/tablet/Tablet.qml index 93d388b374..9a4be95b64 100644 --- a/interface/resources/qml/hifi/tablet/Tablet.qml +++ b/interface/resources/qml/hifi/tablet/Tablet.qml @@ -166,28 +166,6 @@ Item { anchors.top: parent.top anchors.topMargin: 30 } - - Component.onCompleted: { - console.log("Tablet.onCompleted!"); - var component = Qt.createComponent("TabletButton.qml"); - var buttons = []; - for (var i = 0; i < 6; i++) { - var button = component.createObject(flowMain); - button.inDebugMode = true; - buttons.push(button); - } - - // set button text - buttons[0].text = "MUTE"; - buttons[1].text = "VR"; - buttons[2].text = "MENU"; - buttons[3].text = "BUBBLE"; - buttons[4].text = "SNAP"; - buttons[5].text = "HELP"; - - // set button icon - buttons[0].icon = "icons/tablet-mute-icon.svg" - } } states: [ State { From bf6178f5002035220d8bb16906192bf540feddce Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 21 Dec 2016 23:48:45 +0000 Subject: [PATCH 6/7] diff minimize --- scripts/system/libraries/WebTablet.js | 6 +++--- scripts/system/marketplaces/marketplace.js | 9 +++------ scripts/system/mod.js | 4 +--- scripts/system/snapshot.js | 2 +- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index a9f433a38b..b169a644bb 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -41,7 +41,7 @@ function calcSpawnInfo() { // ctor WebTablet = function (url, width, dpi, location, clientOnly) { - print(url); + var _this = this; var ASPECT = 4.0 / 3.0; var WIDTH = width || DEFAULT_WIDTH; @@ -54,7 +54,7 @@ WebTablet = function (url, width, dpi, location, clientOnly) { var spawnInfo = calcSpawnInfo(); var tabletEntityPosition = spawnInfo.position; var tabletEntityRotation = spawnInfo.rotation; - + var tabletProperties = { name: "WebTablet Tablet", type: "Model", @@ -75,7 +75,7 @@ WebTablet = function (url, width, dpi, location, clientOnly) { tabletProperties.position = spawnInfo.position; tabletProperties.rotation = spawnInfo.rotation; } - this.tabletURL = url; + this.tabletEntityID = Entities.addEntity(tabletProperties, clientOnly); var WEB_ENTITY_Z_OFFSET = -0.01; diff --git a/scripts/system/marketplaces/marketplace.js b/scripts/system/marketplaces/marketplace.js index 4cfac86501..f365ca5d4c 100644 --- a/scripts/system/marketplaces/marketplace.js +++ b/scripts/system/marketplaces/marketplace.js @@ -62,15 +62,14 @@ function hideTablet(tablet) { Settings.setValue(persistenceKey, ""); } function clearOldTablet() { // If there was a tablet from previous domain or session, kill it and let it be recreated - //var tablet = WebTablet.unpickle(Settings.getValue(persistenceKey, "")); - //hideTablet(tablet); + } function hideMarketplace() { if (marketplaceWindow.visible) { marketplaceWindow.setVisible(false); marketplaceWindow.setURL("about:blank"); } else if (marketplaceWebTablet) { - //hideTablet(marketplaceWebTablet); + } marketplaceVisible = false; } @@ -91,9 +90,7 @@ var browseExamplesButton = tablet.addButton({ }); function updateButtonState(visible) { - //browseExamplesButton.writeProperty('buttonState', visible ? 0 : 1); - //browseExamplesButton.writeProperty('defaultState', visible ? 0 : 1); - //browseExamplesButton.writeProperty('hoverState', visible ? 2 : 3); + } function onMarketplaceWindowVisibilityChanged() { updateButtonState(marketplaceWindow.visible); diff --git a/scripts/system/mod.js b/scripts/system/mod.js index 4574861455..a3b4974f8d 100644 --- a/scripts/system/mod.js +++ b/scripts/system/mod.js @@ -64,9 +64,7 @@ function buttonClicked(){ isShowingOverlays = true; } - //button.writeProperty('buttonState', isShowingOverlays ? 0 : 1); - //button.writeProperty('defaultState', isShowingOverlays ? 0 : 1); - //button.writeProperty('hoverState', isShowingOverlays ? 2 : 3); + } button.clicked.connect(buttonClicked); diff --git a/scripts/system/snapshot.js b/scripts/system/snapshot.js index 236b3c1793..06a148be2f 100644 --- a/scripts/system/snapshot.js +++ b/scripts/system/snapshot.js @@ -148,7 +148,7 @@ function resetButtons(pathStillSnapshot, pathAnimatedSnapshot, notify) { // If we ARE taking an animated snapshot, we've already re-enabled the HUD by this point. if (pathAnimatedSnapshot === "") { // show hud - //toolBar.writeProperty("visible", true); + Reticle.visible = reticleVisible; // show overlays if they were on if (resetOverlays) { From 61277c0605718811b6e6d6d2ad1e2e275434df46 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 22 Dec 2016 17:33:25 +0000 Subject: [PATCH 7/7] Stylus now works in edit mode --- .../system/controllers/handControllerGrab.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 384e0e24a6..602ce898fc 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -1290,11 +1290,11 @@ function MyController(hand) { Entities.sendHoverOverEntity(entity, pointerEvent); } - if (!isEditing()) { - this.grabbedEntity = entity; - this.setState(STATE_ENTITY_TOUCHING, "begin touching entity '" + name + "'"); - return; - } + + this.grabbedEntity = entity; + this.setState(STATE_ENTITY_TOUCHING, "begin touching entity '" + name + "'"); + return; + } else if (this.hoverEntity) { pointerEvent = { type: "Move", @@ -1346,11 +1346,11 @@ function MyController(hand) { Overlays.sendHoverOverOverlay(overlay, pointerEvent); } - if (!isEditing()) { - this.grabbedOverlay = overlay; - this.setState(STATE_OVERLAY_TOUCHING, "begin touching overlay '" + overlay + "'"); - return; - } + + this.grabbedOverlay = overlay; + this.setState(STATE_OVERLAY_TOUCHING, "begin touching overlay '" + overlay + "'"); + return; + } else if (this.hoverOverlay) { pointerEvent = {