mirror of
https://github.com/overte-org/overte.git
synced 2025-04-27 22:36:01 +02:00
Tidying
This commit is contained in:
parent
d857f943f8
commit
8e30674069
4 changed files with 19 additions and 21 deletions
|
@ -5526,7 +5526,7 @@ void Application::addAssetToWorld(QString filePath) {
|
|||
|
||||
if (!DependencyManager::get<NodeList>()->getThisNodeCanWriteAssets()) {
|
||||
QString errorInfo = "Do not have permissions to write to asset server.";
|
||||
qCDebug(interfaceapp) << "Error downloading asset: " + errorInfo;
|
||||
qWarning(interfaceapp) << "Error downloading asset: " + errorInfo;
|
||||
addAssetToWorldError(errorInfo);
|
||||
return;
|
||||
}
|
||||
|
@ -5551,7 +5551,7 @@ void Application::addAssetToWorldWithNewMapping(QString path, QString mapping, i
|
|||
} else if (result != GetMappingRequest::NoError) {
|
||||
QString errorInfo = "Could not map asset name: "
|
||||
+ mapping.left(mapping.length() - QString::number(copy).length() - 1);
|
||||
qCDebug(interfaceapp) << "Error downloading asset: " + errorInfo;
|
||||
qWarning(interfaceapp) << "Error downloading asset: " + errorInfo;
|
||||
addAssetToWorldError(errorInfo);
|
||||
} else if (copy < MAX_COPY_COUNT - 1) {
|
||||
if (copy > 0) {
|
||||
|
@ -5563,7 +5563,7 @@ void Application::addAssetToWorldWithNewMapping(QString path, QString mapping, i
|
|||
} else {
|
||||
QString errorInfo = "Too many copies of asset name: "
|
||||
+ mapping.left(mapping.length() - QString::number(copy).length() - 1);
|
||||
qCDebug(interfaceapp) << "Error downloading asset: " + errorInfo;
|
||||
qWarning(interfaceapp) << "Error downloading asset: " + errorInfo;
|
||||
addAssetToWorldError(errorInfo);
|
||||
}
|
||||
request->deleteLater();
|
||||
|
@ -5581,7 +5581,7 @@ void Application::addAssetToWorldUpload(QString path, QString mapping) {
|
|||
QObject::connect(upload, &AssetUpload::finished, this, [=](AssetUpload* upload, const QString& hash) mutable {
|
||||
if (upload->getError() != AssetUpload::NoError) {
|
||||
QString errorInfo = "Could not upload asset to asset server.";
|
||||
qCDebug(interfaceapp) << "Error downloading asset: " + errorInfo;
|
||||
qWarning(interfaceapp) << "Error downloading asset: " + errorInfo;
|
||||
addAssetToWorldError(errorInfo);
|
||||
} else {
|
||||
addAssetToWorldSetMapping(mapping, hash);
|
||||
|
@ -5610,7 +5610,7 @@ void Application::addAssetToWorldSetMapping(QString mapping, QString hash) {
|
|||
connect(request, &SetMappingRequest::finished, this, [=](SetMappingRequest* request) mutable {
|
||||
if (request->getError() != SetMappingRequest::NoError) {
|
||||
QString errorInfo = "Could not set asset mapping.";
|
||||
qCDebug(interfaceapp) << "Error downloading asset: " + errorInfo;
|
||||
qWarning(interfaceapp) << "Error downloading asset: " + errorInfo;
|
||||
addAssetToWorldError(errorInfo);
|
||||
} else {
|
||||
addAssetToWorldAddEntity(mapping);
|
||||
|
@ -5637,12 +5637,12 @@ void Application::addAssetToWorldAddEntity(QString mapping) {
|
|||
auto result = DependencyManager::get<EntityScriptingInterface>()->addEntity(properties);
|
||||
|
||||
if (result == QUuid()) {
|
||||
QString errorInfo = "Could not add downloaded asset " + mapping + " to world.";
|
||||
qCDebug(interfaceapp) << "Error downloading asset: " + errorInfo;
|
||||
QString errorInfo = "Could not add asset " + mapping + " to world.";
|
||||
qWarning(interfaceapp) << "Could not add asset to world: " + errorInfo;
|
||||
addAssetToWorldError(errorInfo);
|
||||
} else {
|
||||
QString successInfo = "Downloaded asset " + mapping + " added to world.";
|
||||
qCDebug(interfaceapp) << "Downloading asset completed: " + successInfo;
|
||||
QString successInfo = mapping + " added to world.";
|
||||
qInfo() << "Downloading asset completed: " + successInfo;
|
||||
_addAssetToWorldMessageBox->setProperty("text", successInfo);
|
||||
_addAssetToWorldMessageBox->setProperty("buttons", QMessageBox::Ok);
|
||||
_addAssetToWorldMessageBox->setProperty("defaultButton", QMessageBox::Ok);
|
||||
|
|
|
@ -80,7 +80,6 @@ bool FileScriptingInterface::isZipped(QUrl url) {
|
|||
return (url.toString().endsWith(".zip"));
|
||||
}
|
||||
|
||||
// this function is not in use
|
||||
QString FileScriptingInterface::getTempDir() {
|
||||
QTemporaryDir dir;
|
||||
dir.setAutoRemove(false);
|
||||
|
@ -106,7 +105,6 @@ void FileScriptingInterface::downloadZip(QString path, const QString link) {
|
|||
request->send();
|
||||
}
|
||||
|
||||
|
||||
QString FileScriptingInterface::unzipFile(QString path, QString tempDir) {
|
||||
|
||||
QDir dir(path);
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
function onLoad() {
|
||||
$(document).ready(function () {
|
||||
|
||||
// Supporting styles from marketplaces.css.
|
||||
// Glyph font family, size, and spacing adjusted because HiFi-Glyphs cannot be used cross-domain.
|
||||
$("head").append(
|
||||
|
@ -46,6 +47,5 @@ function onLoad() {
|
|||
$("#marketplace-content").attr("src", "marketplacesDirectory.html");
|
||||
EventBridge.emitWebEvent("RELOAD_DIRECTORY");
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener("load", onLoad);
|
||||
});
|
||||
|
|
|
@ -29,12 +29,12 @@ var marketplaceWindow = new OverlayWebWindow({
|
|||
});
|
||||
marketplaceWindow.setScriptURL(MARKETPLACES_DIRECTORY_SCRIPT_URL);
|
||||
marketplaceWindow.webEventReceived.connect(function (data) {
|
||||
if (data === "INJECT_CLARA") {
|
||||
marketplaceWindow.setScriptURL(MARKETPLACES_CLARA_SCRIPT_URL);
|
||||
}
|
||||
if (data === "INJECT_HIFI") {
|
||||
marketplaceWindow.setScriptURL(MARKETPLACES_HFIF_SCRIPT_URL);
|
||||
}
|
||||
if (data === "INJECT_CLARA") {
|
||||
marketplaceWindow.setScriptURL(MARKETPLACES_CLARA_SCRIPT_URL);
|
||||
}
|
||||
if (data === "RELOAD_DIRECTORY") {
|
||||
marketplaceWindow.setScriptURL(MARKETPLACES_DIRECTORY_SCRIPT_URL);
|
||||
marketplaceWindow.setURL(MARKETPLACES_URL);
|
||||
|
@ -47,7 +47,7 @@ var TOOLBAR_MARGIN_Y = 0;
|
|||
var marketplaceVisible = false;
|
||||
var marketplaceWebTablet;
|
||||
|
||||
// We persist clientOnly data in the .ini file, and reconsistitute it on restart.
|
||||
// We persist clientOnly data in the .ini file, and reconstitute it on restart.
|
||||
// To keep things consistent, we pickle the tablet data in Settings, and kill any existing such on restart and domain change.
|
||||
var persistenceKey = "io.highfidelity.lastDomainTablet";
|
||||
|
||||
|
@ -65,12 +65,12 @@ function showMarketplace(marketplaceID) {
|
|||
Settings.setValue(persistenceKey, marketplaceWebTablet.pickle());
|
||||
marketplaceWebTablet.setScriptURL(MARKETPLACES_DIRECTORY_SCRIPT_URL);
|
||||
marketplaceWebTablet.getOverlayObject().webEventReceived.connect(function (data) {
|
||||
if (data === "INJECT_CLARA") {
|
||||
marketplaceWebTablet.setScriptURL(MARKETPLACES_CLARA_SCRIPT_URL);
|
||||
}
|
||||
if (data === "INJECT_HIFI") {
|
||||
marketplaceWebTablet.setScriptURL(MARKETPLACES_HFIF_SCRIPT_URL);
|
||||
}
|
||||
if (data === "INJECT_CLARA") {
|
||||
marketplaceWebTablet.setScriptURL(MARKETPLACES_CLARA_SCRIPT_URL);
|
||||
}
|
||||
if (data === "RELOAD_DIRECTORY") {
|
||||
marketplaceWebTablet.setScriptURL(MARKETPLACES_DIRECTORY_SCRIPT_URL);
|
||||
marketplaceWebTablet.setURL(""); // Force reload of URL.
|
||||
|
|
Loading…
Reference in a new issue