mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Merge branch 'master' into create_in_landscape
This commit is contained in:
commit
30ab9771ef
6 changed files with 86 additions and 145 deletions
BIN
interface/resources/snapshot/img/no-image.jpg
Normal file
BIN
interface/resources/snapshot/img/no-image.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
|
||||||
const Discoverability::Mode DEFAULT_DISCOVERABILITY_MODE = Discoverability::Friends;
|
const Discoverability::Mode DEFAULT_DISCOVERABILITY_MODE = Discoverability::Connections;
|
||||||
|
|
||||||
DiscoverabilityManager::DiscoverabilityManager() :
|
DiscoverabilityManager::DiscoverabilityManager() :
|
||||||
_mode("discoverabilityMode", DEFAULT_DISCOVERABILITY_MODE)
|
_mode("discoverabilityMode", DEFAULT_DISCOVERABILITY_MODE)
|
||||||
|
|
|
@ -293,19 +293,25 @@ function addImage(image_data, isLoggedIn, canShare, isGifLoading, isShowingPrevi
|
||||||
isGif = img.src.split('.').pop().toLowerCase() === "gif";
|
isGif = img.src.split('.').pop().toLowerCase() === "gif";
|
||||||
imageContainer.appendChild(img);
|
imageContainer.appendChild(img);
|
||||||
document.getElementById("snapshot-images").appendChild(imageContainer);
|
document.getElementById("snapshot-images").appendChild(imageContainer);
|
||||||
paths.push(image_data.localPath);
|
img.onload = function () {
|
||||||
if (isGif) {
|
paths.push(image_data.localPath);
|
||||||
imageContainer.innerHTML += '<span class="gifLabel">GIF</span>';
|
if (isGif) {
|
||||||
}
|
imageContainer.innerHTML += '<span class="gifLabel">GIF</span>';
|
||||||
if (!isGifLoading) {
|
}
|
||||||
appendShareBar(id, isLoggedIn, canShare, isGif, blastButtonDisabled, hifiButtonDisabled, canBlast);
|
if (!isGifLoading) {
|
||||||
}
|
appendShareBar(id, isLoggedIn, canShare, isGif, blastButtonDisabled, hifiButtonDisabled, canBlast);
|
||||||
if (!isGifLoading || (isShowingPreviousImages && !image_data.story_id)) {
|
}
|
||||||
shareForUrl(id);
|
if (!isGifLoading || (isShowingPreviousImages && !image_data.story_id)) {
|
||||||
}
|
shareForUrl(id);
|
||||||
if (isShowingPreviousImages && isLoggedIn && image_data.story_id) {
|
}
|
||||||
updateShareInfo(id, image_data.story_id);
|
if (isShowingPreviousImages && isLoggedIn && image_data.story_id) {
|
||||||
}
|
updateShareInfo(id, image_data.story_id);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
img.onerror = function () {
|
||||||
|
img.onload = null;
|
||||||
|
img.src = image_data.errorPath;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
function showConfirmationMessage(selectedID, destination) {
|
function showConfirmationMessage(selectedID, destination) {
|
||||||
if (selectedID.id) {
|
if (selectedID.id) {
|
||||||
|
|
|
@ -82,11 +82,23 @@ function showElements(els, show) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateProperty(propertyName, propertyValue) {
|
||||||
|
var properties = {};
|
||||||
|
properties[propertyName] = propertyValue;
|
||||||
|
updateProperties(properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateProperties(properties) {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
|
id: lastEntityID,
|
||||||
|
type: "update",
|
||||||
|
properties: properties
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
function createEmitCheckedPropertyUpdateFunction(propertyName) {
|
function createEmitCheckedPropertyUpdateFunction(propertyName) {
|
||||||
return function() {
|
return function() {
|
||||||
EventBridge.emitWebEvent(
|
updateProperty(propertyName, this.checked);
|
||||||
'{"id":' + lastEntityID + ', "type":"update", "properties":{"' + propertyName + '":' + this.checked + '}}'
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,13 +117,7 @@ function createEmitGroupCheckedPropertyUpdateFunction(group, propertyName) {
|
||||||
var properties = {};
|
var properties = {};
|
||||||
properties[group] = {};
|
properties[group] = {};
|
||||||
properties[group][propertyName] = this.checked;
|
properties[group][propertyName] = this.checked;
|
||||||
EventBridge.emitWebEvent(
|
updateProperties(properties);
|
||||||
JSON.stringify({
|
|
||||||
id: lastEntityID,
|
|
||||||
type: "update",
|
|
||||||
properties: properties
|
|
||||||
})
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,10 +125,7 @@ function createEmitNumberPropertyUpdateFunction(propertyName, decimals) {
|
||||||
decimals = decimals == undefined ? 4 : decimals;
|
decimals = decimals == undefined ? 4 : decimals;
|
||||||
return function() {
|
return function() {
|
||||||
var value = parseFloat(this.value).toFixed(decimals);
|
var value = parseFloat(this.value).toFixed(decimals);
|
||||||
|
updateProperty(propertyName, value);
|
||||||
EventBridge.emitWebEvent(
|
|
||||||
'{"id":' + lastEntityID + ', "type":"update", "properties":{"' + propertyName + '":' + value + '}}'
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,28 +134,14 @@ function createEmitGroupNumberPropertyUpdateFunction(group, propertyName) {
|
||||||
var properties = {};
|
var properties = {};
|
||||||
properties[group] = {};
|
properties[group] = {};
|
||||||
properties[group][propertyName] = this.value;
|
properties[group][propertyName] = this.value;
|
||||||
EventBridge.emitWebEvent(
|
updateProperties(properties);
|
||||||
JSON.stringify({
|
|
||||||
id: lastEntityID,
|
|
||||||
type: "update",
|
|
||||||
properties: properties,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function createEmitTextPropertyUpdateFunction(propertyName) {
|
function createEmitTextPropertyUpdateFunction(propertyName) {
|
||||||
return function() {
|
return function() {
|
||||||
var properties = {};
|
updateProperty(propertyName, this.value);
|
||||||
properties[propertyName] = this.value;
|
|
||||||
EventBridge.emitWebEvent(
|
|
||||||
JSON.stringify({
|
|
||||||
id: lastEntityID,
|
|
||||||
type: "update",
|
|
||||||
properties: properties,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,62 +150,44 @@ function createEmitGroupTextPropertyUpdateFunction(group, propertyName) {
|
||||||
var properties = {};
|
var properties = {};
|
||||||
properties[group] = {};
|
properties[group] = {};
|
||||||
properties[group][propertyName] = this.value;
|
properties[group][propertyName] = this.value;
|
||||||
EventBridge.emitWebEvent(
|
updateProperties(properties);
|
||||||
JSON.stringify({
|
|
||||||
id: lastEntityID,
|
|
||||||
type: "update",
|
|
||||||
properties: properties,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function createEmitVec3PropertyUpdateFunction(property, elX, elY, elZ) {
|
function createEmitVec3PropertyUpdateFunction(property, elX, elY, elZ) {
|
||||||
return function() {
|
return function() {
|
||||||
var data = {
|
var properties = {};
|
||||||
id: lastEntityID,
|
properties[property] = {
|
||||||
type: "update",
|
|
||||||
properties: {}
|
|
||||||
};
|
|
||||||
data.properties[property] = {
|
|
||||||
x: elX.value,
|
x: elX.value,
|
||||||
y: elY.value,
|
y: elY.value,
|
||||||
z: elZ.value,
|
z: elZ.value,
|
||||||
};
|
};
|
||||||
EventBridge.emitWebEvent(JSON.stringify(data));
|
updateProperties(properties);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function createEmitGroupVec3PropertyUpdateFunction(group, property, elX, elY, elZ) {
|
function createEmitGroupVec3PropertyUpdateFunction(group, property, elX, elY, elZ) {
|
||||||
return function() {
|
return function() {
|
||||||
var data = {
|
var properties = {};
|
||||||
id: lastEntityID,
|
properties[group] = {};
|
||||||
type: "update",
|
properties[group][property] = {
|
||||||
properties: {}
|
|
||||||
};
|
|
||||||
data.properties[group] = {};
|
|
||||||
data.properties[group][property] = {
|
|
||||||
x: elX.value,
|
x: elX.value,
|
||||||
y: elY.value,
|
y: elY.value,
|
||||||
z: elZ ? elZ.value : 0,
|
z: elZ ? elZ.value : 0,
|
||||||
};
|
};
|
||||||
EventBridge.emitWebEvent(JSON.stringify(data));
|
updateProperties(properties);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function createEmitVec3PropertyUpdateFunctionWithMultiplier(property, elX, elY, elZ, multiplier) {
|
function createEmitVec3PropertyUpdateFunctionWithMultiplier(property, elX, elY, elZ, multiplier) {
|
||||||
return function() {
|
return function() {
|
||||||
var data = {
|
var properties = {};
|
||||||
id: lastEntityID,
|
properties[property] = {
|
||||||
type: "update",
|
|
||||||
properties: {}
|
|
||||||
};
|
|
||||||
data.properties[property] = {
|
|
||||||
x: elX.value * multiplier,
|
x: elX.value * multiplier,
|
||||||
y: elY.value * multiplier,
|
y: elY.value * multiplier,
|
||||||
z: elZ.value * multiplier,
|
z: elZ.value * multiplier,
|
||||||
};
|
};
|
||||||
EventBridge.emitWebEvent(JSON.stringify(data));
|
updateProperties(properties);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -227,44 +198,35 @@ function createEmitColorPropertyUpdateFunction(property, elRed, elGreen, elBlue)
|
||||||
};
|
};
|
||||||
|
|
||||||
function emitColorPropertyUpdate(property, red, green, blue, group) {
|
function emitColorPropertyUpdate(property, red, green, blue, group) {
|
||||||
var data = {
|
var properties = {};
|
||||||
id: lastEntityID,
|
|
||||||
type: "update",
|
|
||||||
properties: {}
|
|
||||||
};
|
|
||||||
if (group) {
|
if (group) {
|
||||||
data.properties[group] = {};
|
properties[group] = {};
|
||||||
data.properties[group][property] = {
|
properties[group][property] = {
|
||||||
red: red,
|
red: red,
|
||||||
green: green,
|
green: green,
|
||||||
blue: blue,
|
blue: blue,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
data.properties[property] = {
|
properties[property] = {
|
||||||
red: red,
|
red: red,
|
||||||
green: green,
|
green: green,
|
||||||
blue: blue,
|
blue: blue,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
EventBridge.emitWebEvent(JSON.stringify(data));
|
updateProperties(properties);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
function createEmitGroupColorPropertyUpdateFunction(group, property, elRed, elGreen, elBlue) {
|
function createEmitGroupColorPropertyUpdateFunction(group, property, elRed, elGreen, elBlue) {
|
||||||
return function() {
|
return function() {
|
||||||
var data = {
|
var properties = {};
|
||||||
id: lastEntityID,
|
properties[group] = {};
|
||||||
type: "update",
|
properties[group][property] = {
|
||||||
properties: {}
|
|
||||||
};
|
|
||||||
data.properties[group] = {};
|
|
||||||
|
|
||||||
data.properties[group][property] = {
|
|
||||||
red: elRed.value,
|
red: elRed.value,
|
||||||
green: elGreen.value,
|
green: elGreen.value,
|
||||||
blue: elBlue.value,
|
blue: elBlue.value,
|
||||||
};
|
};
|
||||||
EventBridge.emitWebEvent(JSON.stringify(data));
|
updateProperties(properties);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -277,18 +239,7 @@ function updateCheckedSubProperty(propertyName, propertyValue, subPropertyElemen
|
||||||
// We've unchecked, so remove
|
// We've unchecked, so remove
|
||||||
propertyValue = propertyValue.replace(subPropertyString + ",", "");
|
propertyValue = propertyValue.replace(subPropertyString + ",", "");
|
||||||
}
|
}
|
||||||
|
updateProperty(propertyName, propertyValue);
|
||||||
var _properties = {}
|
|
||||||
_properties[propertyName] = propertyValue;
|
|
||||||
|
|
||||||
EventBridge.emitWebEvent(
|
|
||||||
JSON.stringify({
|
|
||||||
id: lastEntityID,
|
|
||||||
type: "update",
|
|
||||||
properties: _properties
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setUserDataFromEditor(noUpdate) {
|
function setUserDataFromEditor(noUpdate) {
|
||||||
|
@ -314,18 +265,11 @@ function setUserDataFromEditor(noUpdate) {
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
EventBridge.emitWebEvent(
|
updateProperty('userData', text);
|
||||||
JSON.stringify({
|
|
||||||
id: lastEntityID,
|
|
||||||
type: "update",
|
|
||||||
properties: {
|
|
||||||
userData: text
|
|
||||||
},
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function multiDataUpdater(groupName, updateKeyPair, userDataElement, defaults) {
|
function multiDataUpdater(groupName, updateKeyPair, userDataElement, defaults) {
|
||||||
var properties = {};
|
var properties = {};
|
||||||
var parsedData = {};
|
var parsedData = {};
|
||||||
|
@ -372,13 +316,7 @@ function multiDataUpdater(groupName, updateKeyPair, userDataElement, defaults) {
|
||||||
|
|
||||||
userDataElement.value = properties['userData'];
|
userDataElement.value = properties['userData'];
|
||||||
|
|
||||||
EventBridge.emitWebEvent(
|
updateProperties(properties);
|
||||||
JSON.stringify({
|
|
||||||
id: lastEntityID,
|
|
||||||
type: "update",
|
|
||||||
properties: properties,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
function userDataChanger(groupName, keyName, values, userDataElement, defaultValue) {
|
function userDataChanger(groupName, keyName, values, userDataElement, defaultValue) {
|
||||||
var val = {}, def = {};
|
var val = {}, def = {};
|
||||||
|
@ -900,7 +838,6 @@ function loaded() {
|
||||||
elCloneable.checked = parsedUserData["grabbableKey"].cloneable;
|
elCloneable.checked = parsedUserData["grabbableKey"].cloneable;
|
||||||
elCloneableGroup.style.display = elCloneable.checked ? "block": "none";
|
elCloneableGroup.style.display = elCloneable.checked ? "block": "none";
|
||||||
elCloneableDynamic.checked = parsedUserData["grabbableKey"].cloneDynamic ? parsedUserData["grabbableKey"].cloneDynamic : properties.dynamic;
|
elCloneableDynamic.checked = parsedUserData["grabbableKey"].cloneDynamic ? parsedUserData["grabbableKey"].cloneDynamic : properties.dynamic;
|
||||||
elDynamic.checked = elCloneable.checked ? false: properties.dynamic;
|
|
||||||
if (elCloneable.checked) {
|
if (elCloneable.checked) {
|
||||||
if ("cloneLifetime" in parsedUserData["grabbableKey"]) {
|
if ("cloneLifetime" in parsedUserData["grabbableKey"]) {
|
||||||
elCloneableLifetime.value = parsedUserData["grabbableKey"].cloneLifetime ? parsedUserData["grabbableKey"].cloneLifetime : 300;
|
elCloneableLifetime.value = parsedUserData["grabbableKey"].cloneLifetime ? parsedUserData["grabbableKey"].cloneLifetime : 300;
|
||||||
|
@ -1202,8 +1139,8 @@ function loaded() {
|
||||||
});
|
});
|
||||||
|
|
||||||
elGrabbable.addEventListener('change', function() {
|
elGrabbable.addEventListener('change', function() {
|
||||||
if(elCloneable.checked) {
|
if (elCloneable.checked) {
|
||||||
elGrabbable.checked = false;
|
elGrabbable.checked = false;
|
||||||
}
|
}
|
||||||
userDataChanger("grabbableKey", "grabbable", elGrabbable, elUserData, properties.dynamic);
|
userDataChanger("grabbableKey", "grabbable", elGrabbable, elUserData, properties.dynamic);
|
||||||
});
|
});
|
||||||
|
@ -1213,17 +1150,22 @@ function loaded() {
|
||||||
elCloneable.addEventListener('change', function (event) {
|
elCloneable.addEventListener('change', function (event) {
|
||||||
var checked = event.target.checked;
|
var checked = event.target.checked;
|
||||||
if (checked) {
|
if (checked) {
|
||||||
multiDataUpdater("grabbableKey",
|
multiDataUpdater("grabbableKey", {
|
||||||
{cloneLifetime: elCloneableLifetime, cloneLimit: elCloneableLimit, cloneDynamic: elCloneableDynamic, cloneable: event.target},
|
cloneLifetime: elCloneableLifetime,
|
||||||
elUserData, {});
|
cloneLimit: elCloneableLimit,
|
||||||
|
cloneDynamic: elCloneableDynamic,
|
||||||
|
cloneable: event.target,
|
||||||
|
grabbable: null
|
||||||
|
}, elUserData, {});
|
||||||
elCloneableGroup.style.display = "block";
|
elCloneableGroup.style.display = "block";
|
||||||
EventBridge.emitWebEvent(
|
updateProperty('dynamic', false);
|
||||||
'{"id":' + lastEntityID + ', "type":"update", "properties":{"dynamic":false, "grabbable": false}}'
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
multiDataUpdater("grabbableKey",
|
multiDataUpdater("grabbableKey", {
|
||||||
{cloneLifetime: null, cloneLimit: null, cloneDynamic: null, cloneable: false},
|
cloneLifetime: null,
|
||||||
elUserData, {});
|
cloneLimit: null,
|
||||||
|
cloneDynamic: null,
|
||||||
|
cloneable: false
|
||||||
|
}, elUserData, {});
|
||||||
elCloneableGroup.style.display = "none";
|
elCloneableGroup.style.display = "none";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1258,15 +1200,7 @@ function loaded() {
|
||||||
showUserDataTextArea();
|
showUserDataTextArea();
|
||||||
showNewJSONEditorButton();
|
showNewJSONEditorButton();
|
||||||
hideSaveUserDataButton();
|
hideSaveUserDataButton();
|
||||||
var properties = {};
|
updateProperty('userData', elUserData.value)
|
||||||
properties['userData'] = elUserData.value;
|
|
||||||
EventBridge.emitWebEvent(
|
|
||||||
JSON.stringify({
|
|
||||||
id: lastEntityID,
|
|
||||||
type: "update",
|
|
||||||
properties: properties,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
elSaveUserData.addEventListener("click", function() {
|
elSaveUserData.addEventListener("click", function() {
|
||||||
|
|
|
@ -613,7 +613,6 @@
|
||||||
error = "All participants must be logged in to connect.";
|
error = "All participants must be logged in to connect.";
|
||||||
}
|
}
|
||||||
result = error ? {status: 'error', connection: error} : response;
|
result = error ? {status: 'error', connection: error} : response;
|
||||||
UserActivityLogger.makeUserConnection(connectingId, false, error || response);
|
|
||||||
connectionRequestCompleted();
|
connectionRequestCompleted();
|
||||||
} else {
|
} else {
|
||||||
result = response;
|
result = response;
|
||||||
|
@ -668,8 +667,8 @@
|
||||||
// to be sure the hand is still close enough. If not, we terminate
|
// to be sure the hand is still close enough. If not, we terminate
|
||||||
// the interval, go back to the waiting state. If we make it
|
// the interval, go back to the waiting state. If we make it
|
||||||
// the entire CONNECTING_TIME, we make the connection. We pass in
|
// the entire CONNECTING_TIME, we make the connection. We pass in
|
||||||
// whether or not the connecting id is actually logged in, as now we
|
// whether or not the connecting id is actually logged in, as now we
|
||||||
// will allow to start the connection process but have it stop with a
|
// will allow to start the connection process but have it stop with a
|
||||||
// fail message before trying to call the backend if the other guy isn't
|
// fail message before trying to call the backend if the other guy isn't
|
||||||
// logged in.
|
// logged in.
|
||||||
function startConnecting(id, jointIndex, isLoggedIn) {
|
function startConnecting(id, jointIndex, isLoggedIn) {
|
||||||
|
|
|
@ -273,7 +273,8 @@ function fillImageDataFromPrevious() {
|
||||||
localPath: previousStillSnapPath,
|
localPath: previousStillSnapPath,
|
||||||
story_id: previousStillSnapStoryID,
|
story_id: previousStillSnapStoryID,
|
||||||
blastButtonDisabled: previousStillSnapBlastingDisabled,
|
blastButtonDisabled: previousStillSnapBlastingDisabled,
|
||||||
hifiButtonDisabled: previousStillSnapHifiSharingDisabled
|
hifiButtonDisabled: previousStillSnapHifiSharingDisabled,
|
||||||
|
errorPath: Script.resolvePath(Script.resourcesPath() + 'snapshot/img/no-image.jpg')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (previousAnimatedSnapPath !== "") {
|
if (previousAnimatedSnapPath !== "") {
|
||||||
|
@ -281,7 +282,8 @@ function fillImageDataFromPrevious() {
|
||||||
localPath: previousAnimatedSnapPath,
|
localPath: previousAnimatedSnapPath,
|
||||||
story_id: previousAnimatedSnapStoryID,
|
story_id: previousAnimatedSnapStoryID,
|
||||||
blastButtonDisabled: previousAnimatedSnapBlastingDisabled,
|
blastButtonDisabled: previousAnimatedSnapBlastingDisabled,
|
||||||
hifiButtonDisabled: previousAnimatedSnapHifiSharingDisabled
|
hifiButtonDisabled: previousAnimatedSnapHifiSharingDisabled,
|
||||||
|
errorPath: Script.resolvePath(Script.resourcesPath() + 'snapshot/img/no-image.jpg')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue