mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 19:03:07 +02:00
only disconnect mouse if connected
This commit is contained in:
parent
51b335c902
commit
663dadd1b4
5 changed files with 20 additions and 18 deletions
|
@ -13,18 +13,18 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
var IMPORT_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/eric/arfs/junkyard.json";
|
var IMPORT_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/eric/arfs/junkyard.json";
|
||||||
var PASTE_ENTITIES_LOCATION = {x: 0, y: 0, z: 0};
|
var PASTE_ENTITIES_LOCATION = {x: 0, y: 20, z: 0};
|
||||||
reset();
|
// reset();
|
||||||
|
|
||||||
function reset() {
|
|
||||||
// Delete everything and re-import the junkyard arf
|
|
||||||
var e = Entities.findEntities(MyAvatar.position, 1000);
|
|
||||||
for (i = 0; i < e.length; i++) {
|
|
||||||
Entities.deleteEntity(e[i]);
|
|
||||||
}
|
|
||||||
importAssetResourceFile();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// function reset() {
|
||||||
|
// // Delete everything and re-import the junkyard arf
|
||||||
|
// var e = Entities.findEntities(MyAvatar.position, 1000);
|
||||||
|
// for (i = 0; i < e.length; i++) {
|
||||||
|
// Entities.deleteEntity(e[i]);
|
||||||
|
// }
|
||||||
|
// importAssetResourceFile();
|
||||||
|
// }
|
||||||
|
importAssetResourceFile()
|
||||||
function importAssetResourceFile() {
|
function importAssetResourceFile() {
|
||||||
Clipboard.importEntities(IMPORT_URL);
|
Clipboard.importEntities(IMPORT_URL);
|
||||||
Clipboard.pasteEntities(PASTE_ENTITIES_LOCATION);
|
Clipboard.pasteEntities(PASTE_ENTITIES_LOCATION);
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
this.buttonImageURL = baseURL + "GUI/GUI_jump_off.png";
|
this.buttonImageURL = baseURL + "GUI/GUI_jump_off.png";
|
||||||
this.addExitButton();
|
this.addExitButton();
|
||||||
this.isRiding = false;
|
this.isRiding = false;
|
||||||
|
self.mouseIsConnected = false;
|
||||||
if (this.data && this.data.isDynein) {
|
if (this.data && this.data.isDynein) {
|
||||||
this.rotation = 180;
|
this.rotation = 180;
|
||||||
} else {
|
} else {
|
||||||
|
@ -66,6 +66,7 @@
|
||||||
visible: true
|
visible: true
|
||||||
});
|
});
|
||||||
Controller.mousePressEvent.connect(this.onMousePress);
|
Controller.mousePressEvent.connect(this.onMousePress);
|
||||||
|
self.mouseIsConnected = true;
|
||||||
Script.update.connect(this.update);
|
Script.update.connect(this.update);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,8 +137,9 @@
|
||||||
// print("unload");
|
// print("unload");
|
||||||
self.reset();
|
self.reset();
|
||||||
|
|
||||||
Controller.mousePressEvent.disconnect(this.onMousePress);
|
if (self.mouseIsConnected === true) {
|
||||||
|
Controller.mousePressEvent.disconnect(this.onMousePress);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
var version = 1;
|
var version = 2;
|
||||||
var added = false;
|
var added = false;
|
||||||
this.frame = 0;
|
this.frame = 0;
|
||||||
var utilsScript = Script.resolvePath('utils.js');
|
var utilsScript = Script.resolvePath('utils.js');
|
||||||
|
|
|
@ -8,13 +8,13 @@
|
||||||
(function() {
|
(function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
var baseURL = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";
|
var baseURL = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";
|
||||||
var version = 9;
|
var version = 10;
|
||||||
this.preload = function(entityId) {
|
this.preload = function(entityId) {
|
||||||
self.soundPlaying = false;
|
self.soundPlaying = false;
|
||||||
self.entityId = entityId;
|
self.entityId = entityId;
|
||||||
self.getUserData();
|
self.getUserData();
|
||||||
self.soundURL = baseURL + "Audio/" + self.userData.name + ".wav?" + version;
|
self.soundURL = baseURL + "Audio/" + self.userData.name + ".wav?" + version;
|
||||||
print("Script.clearTimeout creating WAV name location is " + baseURL + "Audio/" + self.userData.name + ".wav");
|
print("creating WAV name location is " + baseURL + "Audio/" + self.userData.name + ".wav");
|
||||||
|
|
||||||
self.soundOptions = {
|
self.soundOptions = {
|
||||||
stereo: true,
|
stereo: true,
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
var version = 1004;
|
var version = 1005;
|
||||||
var cellLayout;
|
var cellLayout;
|
||||||
var baseLocation = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";
|
var baseLocation = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue