mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 22:06:18 +02:00
removed tabs and also remove script from host
This commit is contained in:
parent
f7df9a64b2
commit
8f36090884
3 changed files with 41 additions and 11 deletions
|
@ -98,28 +98,26 @@ WebTablet = function (url, width, dpi, location, clientOnly) {
|
|||
|
||||
this.createWebEntity(url);
|
||||
|
||||
|
||||
this.homeButtonEntity = Entities.addEntity({
|
||||
name: "homeButton",
|
||||
type: "Sphere",
|
||||
localPosition: {x: 0, y: HOME_BUTTON_Y_OFFSET, z: 0},
|
||||
dimensions: {x: 0.05, y: 0.05, z: 0.05},
|
||||
parentID: this.tabletEntityID,
|
||||
script: "https://people.ucsc.edu/~druiz4/scripts/homeButton.js"
|
||||
script: Script.resolvePath("../tablet-ui/HomeButton.js")
|
||||
}, clientOnly);
|
||||
|
||||
|
||||
setEntityCustomData('grabbableKey', this.homeButtonEntity, {wantsTrigger: true});
|
||||
|
||||
|
||||
setEntityCustomData('grabbableKey', this.homeButtonEntity, {wantsTrigger: true});
|
||||
|
||||
this.receive = function (channel, senderID, senderUUID, localOnly) {
|
||||
if (_this.homeButtonEntity == senderID) {
|
||||
if (_this.clicked) {
|
||||
Entities.editEntity(_this.homeButtonEntity, {color: {red: 0, green: 255, blue: 255}});
|
||||
_this.clicked = false;
|
||||
Entities.editEntity(_this.homeButtonEntity, {color: {red: 0, green: 255, blue: 255}});
|
||||
_this.clicked = false;
|
||||
} else {
|
||||
Entities.editEntity(_this.homeButtonEntity, {color: {red: 255, green: 255, blue: 0}});
|
||||
_this.clicked = true;
|
||||
Entities.editEntity(_this.homeButtonEntity, {color: {red: 255, green: 255, blue: 0}});
|
||||
_this.clicked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
32
scripts/system/tablet-ui/HomeButton.js
Normal file
32
scripts/system/tablet-ui/HomeButton.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
//
|
||||
// HomeButton.js
|
||||
//
|
||||
// Created by Dante Ruiz on 12/6/2016
|
||||
// Copyright 2016 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
(function(){
|
||||
_this = this;
|
||||
|
||||
this.preload = function(entityID) {
|
||||
print(entityID);
|
||||
this.entityID = entityID;
|
||||
}
|
||||
|
||||
this.clickDownOnEntity = function(entityID, mouseEvent) {
|
||||
Messages.sendLocalMessage("home", _this.entityID);
|
||||
}
|
||||
|
||||
this.startNearTrigger = function() {
|
||||
Messages.sendLocalMessage("home", _this.entityID);
|
||||
}
|
||||
|
||||
|
||||
this.startFarTrigger = function() {
|
||||
Messages.sendLocalMessage("home", _this.entityID);
|
||||
}
|
||||
|
||||
});
|
|
@ -24,7 +24,7 @@
|
|||
tabletShown = true;
|
||||
print("show tablet-ui");
|
||||
UIWebTablet = new WebTablet("qml/hifi/tablet/Tablet.qml", null, null, tabletLocation);
|
||||
UIWebTablet.register();
|
||||
UIWebTablet.register();
|
||||
HMD.tabletID = UIWebTablet.webEntityID;
|
||||
|
||||
var setUpTabletUI = function() {
|
||||
|
@ -49,7 +49,7 @@
|
|||
}
|
||||
|
||||
tabletLocation = UIWebTablet.getLocation();
|
||||
UIWebTablet.unregister();
|
||||
UIWebTablet.unregister();
|
||||
UIWebTablet.destroy();
|
||||
UIWebTablet = null;
|
||||
HMD.tabletID = null;
|
||||
|
|
Loading…
Reference in a new issue