From e00ef220dacb4f5301d084f5171d6f024df19831 Mon Sep 17 00:00:00 2001 From: algoworks Date: Tue, 8 Aug 2017 14:01:28 -0700 Subject: [PATCH 01/16] 3 file changes, build directory --- interface/src/Application.cpp | 2 +- libraries/physics/src/EntityMotionState.cpp | 2 +- libraries/physics/src/PhysicsEngine.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index ceded99f40..0e2f7ca55d 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -242,7 +242,7 @@ static const int THROTTLED_SIM_FRAME_PERIOD_MS = MSECS_PER_SECOND / THROTTLED_SI static const uint32_t INVALID_FRAME = UINT32_MAX; -static const float PHYSICS_READY_RANGE = 3.0f; // how far from avatar to check for entities that aren't ready for simulation +static const float PHYSICS_READY_RANGE = 1.0f; // how far from avatar to check for entities that aren't ready for simulation static const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); diff --git a/libraries/physics/src/EntityMotionState.cpp b/libraries/physics/src/EntityMotionState.cpp index f02dcee8f6..93ef140f30 100644 --- a/libraries/physics/src/EntityMotionState.cpp +++ b/libraries/physics/src/EntityMotionState.cpp @@ -531,7 +531,7 @@ void EntityMotionState::sendUpdate(OctreeEditPacketSender* packetSender, uint32_ } if (!_body->isStaticOrKinematicObject()) { - const float DYNAMIC_LINEAR_VELOCITY_THRESHOLD = 0.05f; // 5 cm/sec + const float DYNAMIC_LINEAR_VELOCITY_THRESHOLD = 0.02f; // 5 cm/sec const float DYNAMIC_ANGULAR_VELOCITY_THRESHOLD = 0.087266f; // ~5 deg/sec bool movingSlowlyLinear = diff --git a/libraries/physics/src/PhysicsEngine.cpp b/libraries/physics/src/PhysicsEngine.cpp index a64796308e..1dba0e9a07 100644 --- a/libraries/physics/src/PhysicsEngine.cpp +++ b/libraries/physics/src/PhysicsEngine.cpp @@ -441,7 +441,7 @@ const CollisionEvents& PhysicsEngine::getCollisionEvents() { while (contactItr != _contactMap.end()) { ContactInfo& contact = contactItr->second; ContactEventType type = contact.computeType(_numContactFrames); - const btScalar SIGNIFICANT_DEPTH = -0.002f; // penetrations have negative distance + const btScalar SIGNIFICANT_DEPTH = -0.008f; // penetrations have negative distance if (type != CONTACT_EVENT_TYPE_CONTINUE || (contact.distance < SIGNIFICANT_DEPTH && contact.readyForContinue(_numContactFrames))) { From 10eaed71f95c6fcb4a1f47a873d5e1d1071c44a6 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Thu, 24 Aug 2017 16:00:36 -0700 Subject: [PATCH 02/16] crash on shutdown --- interface/src/Application.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Application.h b/interface/src/Application.h index c951b25930..6a11751061 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -707,8 +707,8 @@ private: QUrl _avatarOverrideUrl; bool _saveAvatarOverrideUrl { false }; - LaserPointerManager _laserPointerManager; RayPickManager _rayPickManager; + LaserPointerManager _laserPointerManager; }; #endif // hifi_Application_h From 35459a7b93afdc51f4edec9f1f4346f591494f87 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 28 Aug 2017 17:01:01 -0700 Subject: [PATCH 03/16] cherry-pick --- libraries/entities-renderer/src/EntityTreeRenderer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index a2d2d34837..414509cf0c 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -55,6 +55,13 @@ EntityTreeRenderer::EntityTreeRenderer(bool wantScripts, AbstractViewStateInterf _displayModelBounds(false), _layeredZones(this) { + setMouseRayPickResultOperator([&](QUuid rayPickID) { + RayToEntityIntersectionResult entityResult; + return entityResult; + }); + setSetPrecisionPickingOperator([&](QUuid rayPickID, bool value) {}); + EntityRenderer::initEntityRenderers(); + REGISTER_ENTITY_TYPE_WITH_FACTORY(Model, RenderableModelEntityItem::factory) REGISTER_ENTITY_TYPE_WITH_FACTORY(Light, RenderableLightEntityItem::factory) REGISTER_ENTITY_TYPE_WITH_FACTORY(Text, RenderableTextEntityItem::factory) From b8795c3ea9b23b624f8f0fe5ad05ff0dbf4c8067 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 28 Aug 2017 17:08:59 -0700 Subject: [PATCH 04/16] remove unneeded bind-by-ref thing from lambdas --- libraries/entities-renderer/src/EntityTreeRenderer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index 414509cf0c..972ca9d777 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -55,11 +55,11 @@ EntityTreeRenderer::EntityTreeRenderer(bool wantScripts, AbstractViewStateInterf _displayModelBounds(false), _layeredZones(this) { - setMouseRayPickResultOperator([&](QUuid rayPickID) { + setMouseRayPickResultOperator([](QUuid rayPickID) { RayToEntityIntersectionResult entityResult; return entityResult; }); - setSetPrecisionPickingOperator([&](QUuid rayPickID, bool value) {}); + setSetPrecisionPickingOperator([](QUuid rayPickID, bool value) {}); EntityRenderer::initEntityRenderers(); REGISTER_ENTITY_TYPE_WITH_FACTORY(Model, RenderableModelEntityItem::factory) From a6aa71f8fd4a73729635eac00b587f65f777d277 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 29 Aug 2017 09:51:08 -0700 Subject: [PATCH 05/16] unmangle merge --- libraries/entities-renderer/src/EntityTreeRenderer.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index 972ca9d777..abb7f3bb88 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -60,7 +60,6 @@ EntityTreeRenderer::EntityTreeRenderer(bool wantScripts, AbstractViewStateInterf return entityResult; }); setSetPrecisionPickingOperator([](QUuid rayPickID, bool value) {}); - EntityRenderer::initEntityRenderers(); REGISTER_ENTITY_TYPE_WITH_FACTORY(Model, RenderableModelEntityItem::factory) REGISTER_ENTITY_TYPE_WITH_FACTORY(Light, RenderableLightEntityItem::factory) From 180acbc188db5c7fb43df46dfaf4185567c7ec23 Mon Sep 17 00:00:00 2001 From: beholder Date: Tue, 29 Aug 2017 23:49:44 +0300 Subject: [PATCH 06/16] 6819 - Create button not disabled --- interface/resources/qml/hifi/toolbars/ToolbarButton.qml | 3 ++- scripts/system/edit.js | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/toolbars/ToolbarButton.qml b/interface/resources/qml/hifi/toolbars/ToolbarButton.qml index 3d4231ced7..bbf2d019fb 100644 --- a/interface/resources/qml/hifi/toolbars/ToolbarButton.qml +++ b/interface/resources/qml/hifi/toolbars/ToolbarButton.qml @@ -4,6 +4,7 @@ import QtQuick.Controls 1.4 StateImage { id: button + property string captionColorOverride: "" property bool buttonEnabled: true property bool isActive: false property bool isEntered: false @@ -97,7 +98,7 @@ StateImage { Text { id: caption - color: button.isActive ? "#000000" : "#ffffff" + color: captionColorOverride !== "" ? captionColorOverride: (button.isActive ? "#000000" : "#ffffff") text: button.isActive ? (button.isEntered ? button.activeHoverText : button.activeText) : (button.isEntered ? button.hoverText : button.text) font.bold: false font.pixelSize: 9 diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 7ee6c64858..8b61226235 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -405,9 +405,11 @@ var toolBar = (function () { } }); - var createButtonIconRsrc = ((Entities.canRez() || Entities.canRezTmp()) ? CREATE_ENABLED_ICON : CREATE_DISABLED_ICON); + var hasRezPermissions = (Entities.canRez() || Entities.canRezTmp()); + var createButtonIconRsrc = (hasRezPermissions ? CREATE_ENABLED_ICON : CREATE_DISABLED_ICON); tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); activeButton = tablet.addButton({ + captionColorOverride: hasRezPermissions ? "" : "#888888", icon: createButtonIconRsrc, activeIcon: "icons/tablet-icons/edit-a.svg", text: "CREATE", @@ -789,6 +791,7 @@ function handleDomainChange() { var hasRezPermissions = (Entities.canRez() || Entities.canRezTmp()); createButton.editProperties({ icon: (hasRezPermissions ? CREATE_ENABLED_ICON : CREATE_DISABLED_ICON), + captionColorOverride: (hasRezPermissions ? "" : "#888888"), }); } From 492d05301667a93eeca73e077e3ffdd6d02583ee Mon Sep 17 00:00:00 2001 From: Liv Date: Wed, 23 Aug 2017 17:38:24 -0700 Subject: [PATCH 07/16] Create home path for new content sets loaded in --- interface/src/Application.cpp | 6 +++++- interface/src/LocationBookmarks.cpp | 4 ++++ interface/src/LocationBookmarks.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index d3b547a54c..ea4a3db465 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6284,7 +6284,11 @@ bool Application::askToReplaceDomainContent(const QString& url) { octreeFilePacket->write(urlData); limitedNodeList->sendPacket(std::move(octreeFilePacket), *octreeNode); }); - DependencyManager::get()->handleLookupString(DOMAIN_SPAWNING_POINT); + auto addressManager = DependencyManager::get(); + addressManager->handleLookupString(DOMAIN_SPAWNING_POINT); + QString newHomeAddress = addressManager->getHost() + DOMAIN_SPAWNING_POINT; + qCDebug(interfaceapp) << "Setting new home bookmark to: " << newHomeAddress; + DependencyManager::get()->setHomeLocationToAddress(newHomeAddress); methodDetails = "SuccessfulRequestToReplaceContent"; } else { methodDetails = "UserDeclinedToReplaceContent"; diff --git a/interface/src/LocationBookmarks.cpp b/interface/src/LocationBookmarks.cpp index eee6cdf3c8..b234f8c07b 100644 --- a/interface/src/LocationBookmarks.cpp +++ b/interface/src/LocationBookmarks.cpp @@ -63,6 +63,10 @@ void LocationBookmarks::setHomeLocation() { Bookmarks::addBookmarkToFile(HOME_BOOKMARK, bookmarkAddress); } +void LocationBookmarks::setHomeLocationToAddress(const QVariant& address) { + Bookmarks::insert("Home", address); +} + void LocationBookmarks::teleportToBookmark() { QAction* action = qobject_cast(sender()); QString address = action->data().toString(); diff --git a/interface/src/LocationBookmarks.h b/interface/src/LocationBookmarks.h index 6cac56ae04..9a800ba35e 100644 --- a/interface/src/LocationBookmarks.h +++ b/interface/src/LocationBookmarks.h @@ -27,6 +27,7 @@ public: public slots: void addBookmark(); + void setHomeLocationToAddress(const QVariant& address); protected: void addBookmarkToMenu(Menu* menubar, const QString& name, const QVariant& address) override; From 164eeaae64b8e8e080fbe79c39c8c7f8d285a798 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 31 Aug 2017 10:41:44 -0700 Subject: [PATCH 08/16] Fix the duplicated buy buttons for admins on Marketplace --- scripts/system/html/js/marketplacesInject.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/system/html/js/marketplacesInject.js b/scripts/system/html/js/marketplacesInject.js index 2675bb97b6..28d116d3ec 100644 --- a/scripts/system/html/js/marketplacesInject.js +++ b/scripts/system/html/js/marketplacesInject.js @@ -173,16 +173,16 @@ function injectHiFiItemPageCode() { if (confirmAllPurchases) { - var href = $('#side-info').find('.btn').attr('href'); - $('#side-info').find('.btn').attr('href', '#'); + var href = $('#side-info').find('.btn').first().attr('href'); + $('#side-info').find('.btn').first().attr('href', '#'); var cost = $('.item-cost').text(); if (parseInt(cost) > 0 && $('#side-info').find('#buyItemButton').size() === 0) { - $('#side-info').find('.btn').html('Own Item: ' + (parseFloat(cost / 100).toFixed(2)) + ' HFC'); + $('#side-info').find('.btn').first().html('Own Item: ' + (parseFloat(cost / 100).toFixed(2)) + ' HFC'); } - $('#side-info').find('.btn').on('click', function () { + $('#side-info').find('.btn').first().on('click', function () { buyButtonClicked(window.location.pathname.split("/")[3], $('#top-center').find('h1').text(), $('#creator').find('.value').text(), From 8fbdd207c8da2933c1177bb896bfc5e1b4fffad2 Mon Sep 17 00:00:00 2001 From: David Kelly Date: Thu, 31 Aug 2017 12:10:12 -0700 Subject: [PATCH 09/16] display hfc in "pennies" --- .../qml/hifi/commerce/checkout/Checkout.qml | 28 ++++----- .../qml/hifi/commerce/wallet/WalletHome.qml | 4 +- interface/src/commerce/Ledger.cpp | 59 ++++++++++++++++++- 3 files changed, 73 insertions(+), 18 deletions(-) diff --git a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml index 109e357206..72e4e7622b 100644 --- a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml +++ b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml @@ -89,8 +89,8 @@ Rectangle { console.log("Failed to get balance", result.data.message); } else { root.balanceReceived = true; - hfcBalanceText.text = (parseFloat(result.data.balance/100).toFixed(2)) + " HFC"; - balanceAfterPurchase = parseFloat(result.data.balance/100) - root.itemPriceFull/100; + hfcBalanceText.text = result.data.balance + " HFC"; + balanceAfterPurchase = result.data.balance - root.itemPriceFull; root.setBuyText(); } } @@ -199,7 +199,7 @@ Rectangle { commerce.getLoginStatus(); } } - + HifiWallet.NeedsLogIn { id: needsLogIn; visible: root.activeView === "needsLogIn"; @@ -222,7 +222,7 @@ Rectangle { } - + // // "WALLET NOT SET UP" START // @@ -233,7 +233,7 @@ Rectangle { anchors.bottom: parent.bottom; anchors.left: parent.left; anchors.right: parent.right; - + RalewayRegular { id: notSetUpText; text: "Your wallet isn't set up.

Set up your Wallet (no credit card necessary) to claim your free HFC " + @@ -264,7 +264,7 @@ Rectangle { anchors.left: parent.left; anchors.bottom: parent.bottom; anchors.bottomMargin: 24; - + // "Cancel" button HifiControlsUit.Button { id: cancelButton; @@ -648,7 +648,7 @@ Rectangle { sendToScript({method: 'checkout_goToPurchases'}); } } - + RalewayRegular { id: buyText; // Text size @@ -687,7 +687,7 @@ Rectangle { anchors.bottom: root.bottom; anchors.left: parent.left; anchors.right: parent.right; - + RalewayRegular { id: completeText; text: "Purchase Complete!

You bought " + (itemNameText.text) + " by " + (itemAuthorText.text) + ""; @@ -706,7 +706,7 @@ Rectangle { horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter; } - + Item { id: checkoutSuccessActionButtonsContainer; // Size @@ -756,7 +756,7 @@ Rectangle { } } } - + Item { id: continueShoppingButtonContainer; // Size @@ -799,7 +799,7 @@ Rectangle { anchors.bottom: root.bottom; anchors.left: parent.left; anchors.right: parent.right; - + RalewayRegular { id: failureHeaderText; text: "Purchase Failed.
Your Purchases and HFC balance haven't changed."; @@ -818,7 +818,7 @@ Rectangle { horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter; } - + RalewayRegular { id: failureErrorText; // Text size @@ -836,7 +836,7 @@ Rectangle { horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter; } - + Item { id: backToMarketplaceButtonContainer; // Size @@ -892,7 +892,7 @@ Rectangle { itemNameText.text = message.params.itemName; itemAuthorText.text = message.params.itemAuthor; root.itemPriceFull = message.params.itemPrice; - itemPriceText.text = root.itemPriceFull === 0 ? "Free" : "" + (parseFloat(root.itemPriceFull/100).toFixed(2)) + " HFC"; + itemPriceText.text = root.itemPriceFull === 0 ? "Free" : "" + root.itemPriceFull + " HFC"; itemHref = message.params.itemHref; if (itemHref.indexOf('.json') === -1) { root.itemIsJson = false; diff --git a/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml b/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml index b55f7f800a..413fd8b71c 100644 --- a/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml +++ b/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml @@ -38,7 +38,7 @@ Item { } onBalanceResult : { - balanceText.text = parseFloat(result.data.balance/100).toFixed(2); + balanceText.text = result.data.balance; } onHistoryResult : { @@ -272,7 +272,7 @@ Item { horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter; } - + HifiControlsUit.Separator { anchors.left: parent.left; anchors.right: parent.right; diff --git a/interface/src/commerce/Ledger.cpp b/interface/src/commerce/Ledger.cpp index 08eb79017f..9991958455 100644 --- a/interface/src/commerce/Ledger.cpp +++ b/interface/src/commerce/Ledger.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include "AccountManager.h" #include "Wallet.h" @@ -45,7 +46,6 @@ Handler(buy) Handler(receiveAt) Handler(balance) Handler(inventory) -Handler(history) void Ledger::send(const QString& endpoint, const QString& success, const QString& fail, QNetworkAccessManager::Operation method, QJsonObject request) { auto accountManager = DependencyManager::get(); @@ -108,6 +108,61 @@ void Ledger::inventory(const QStringList& keys) { keysQuery("inventory", "inventorySuccess", "inventoryFailure"); } +QString nameFromKey(const QString& key, const QStringList& publicKeys) { + if (key.isNull() || key.isEmpty()) { + return "Marketplace"; + } + if (publicKeys.contains(key)) { + return "You"; + } + return "Someone"; +} + +void Ledger::historySuccess(QNetworkReply& reply) { + // here we send a historyResult with some extra stuff in it + // Namely, the styled text we'd like to show. The issue is the + // QML cannot do that easily since it doesn't know what the wallet + // public key(s) are. Let's keep it that way + QByteArray response = reply.readAll(); + QJsonObject data = QJsonDocument::fromJson(response).object(); + + // we will need the array of public keys from the wallet + auto wallet = DependencyManager::get(); + auto keys = wallet->listPublicKeys(); + + // now we need to loop through the transactions and add fancy text... + auto historyArray = data.find("data").value().toObject().find("history").value().toArray(); + QJsonArray newHistoryArray; + + // TODO: do this with 0 copies if possible + auto it = historyArray.begin(); + for(auto it = historyArray.begin(); it != historyArray.end(); it++) { + auto valueObject = (*it).toObject(); + QString from = nameFromKey(valueObject["sender_key"].toString(), keys); + QString to = nameFromKey(valueObject["recipient_key"].toString(), keys); + // turns out on my machine, toLocalTime convert to some weird timezone, yet the + // systemTimeZone is correct. To avoid a strange bug with other's systems too, lets + // be explicit + QDateTime createdAt = QDateTime::fromSecsSinceEpoch(valueObject["created_at"].toInt(), Qt::UTC); + QDateTime localCreatedAt = createdAt.toTimeZone(QTimeZone::systemTimeZone()); + valueObject["text"] = QString("%1 sent %2 %3 %4 on %5 with message \"%6\""). + arg(from, to, QString::number(valueObject["quantity"].toInt()), valueObject["asset_title"].toString(), localCreatedAt.toString(Qt::SystemLocaleShortDate), valueObject["message"].toString()); + newHistoryArray.push_back(valueObject); + } + // now copy the rest of the json -- this is inefficient + // TODO: try to do this without making copies + QJsonObject newData; + newData["status"] = "success"; + QJsonObject newDataData; + newDataData["history"] = newHistoryArray; + newData["data"] = newDataData; + emit historyResult(newData); +} + +void Ledger::historyFailure(QNetworkReply& reply) { + failResponse("history", reply); +} + void Ledger::history(const QStringList& keys) { keysQuery("history", "historySuccess", "historyFailure"); } @@ -117,4 +172,4 @@ void Ledger::resetSuccess(QNetworkReply& reply) { apiResponse("reset", reply); } void Ledger::resetFailure(QNetworkReply& reply) { failResponse("reset", reply); } void Ledger::reset() { send("reset_user_hfc_account", "resetSuccess", "resetFailure", QNetworkAccessManager::PutOperation, QJsonObject()); -} \ No newline at end of file +} From 396f1081824ff4bc2b5bab40c9a23e9109ba6a22 Mon Sep 17 00:00:00 2001 From: David Kelly Date: Thu, 31 Aug 2017 12:18:46 -0700 Subject: [PATCH 10/16] forgot this the first time --- scripts/system/html/js/marketplacesInject.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/system/html/js/marketplacesInject.js b/scripts/system/html/js/marketplacesInject.js index 2675bb97b6..57450d043b 100644 --- a/scripts/system/html/js/marketplacesInject.js +++ b/scripts/system/html/js/marketplacesInject.js @@ -27,7 +27,7 @@ var isPreparing = false; // Explicitly track download request status. var confirmAllPurchases = false; // Set this to "true" to cause Checkout.qml to popup for all items, even if free - + function injectCommonCode(isDirectoryPage) { // Supporting styles from marketplaces.css. @@ -122,7 +122,7 @@ function injectBuyButtonOnMainPage() { var cost; - + $('.grid-item').find('#price-or-edit').find('a').each(function() { $(this).attr('data-href', $(this).attr('href')); $(this).attr('href', '#'); @@ -130,7 +130,7 @@ $(this).closest('.col-xs-3').prev().attr("class", 'col-xs-6'); $(this).closest('.col-xs-3').attr("class", 'col-xs-6'); - + if (parseInt(cost) > 0) { var priceElement = $(this).find('.price') priceElement.css({ "width": "auto", "padding": "3px 5px", "height": "26px" }); @@ -138,8 +138,8 @@ priceElement.css({ "min-width": priceElement.width() + 10 }); } }); - - + + $('.grid-item').find('#price-or-edit').find('a').on('click', function () { buyButtonClicked($(this).closest('.grid-item').attr('data-item-id'), $(this).closest('.grid-item').find('.item-title').text(), @@ -175,11 +175,11 @@ if (confirmAllPurchases) { var href = $('#side-info').find('.btn').attr('href'); $('#side-info').find('.btn').attr('href', '#'); - + var cost = $('.item-cost').text(); if (parseInt(cost) > 0 && $('#side-info').find('#buyItemButton').size() === 0) { - $('#side-info').find('.btn').html('Own Item: ' + (parseFloat(cost / 100).toFixed(2)) + ' HFC'); + $('#side-info').find('.btn').html('Own Item: ' + cost + ' HFC'); } $('#side-info').find('.btn').on('click', function () { @@ -264,7 +264,7 @@ // Reference: https://clara.io/learn/sdk/api/export //var XMLHTTPREQUEST_URL = "https://clara.io/api/scenes/{uuid}/export/fbx?zip=true¢erScene=true&alignSceneGround=true&fbxUnit=Meter&fbxVersion=7&fbxEmbedTextures=true&imageFormat=WebGL"; - // 13 Jan 2017: Specify FBX version 5 and remove some options in order to make Clara.io site more likely to + // 13 Jan 2017: Specify FBX version 5 and remove some options in order to make Clara.io site more likely to // be successful in generating zip files. var XMLHTTPREQUEST_URL = "https://clara.io/api/scenes/{uuid}/export/fbx?fbxUnit=Meter&fbxVersion=5&fbxEmbedTextures=true&imageFormat=WebGL"; @@ -447,7 +447,7 @@ cancelClaraDownload(); } else { var parsedJsonMessage = JSON.parse(message); - + if (parsedJsonMessage.type === "marketplaces") { if (parsedJsonMessage.action === "inspectionModeSetting") { confirmAllPurchases = !!parsedJsonMessage.data; From f8341ce1daacf48626516b756b8605f4102c90e4 Mon Sep 17 00:00:00 2001 From: David Kelly Date: Thu, 31 Aug 2017 13:24:07 -0700 Subject: [PATCH 11/16] warning --- interface/src/commerce/Ledger.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/interface/src/commerce/Ledger.cpp b/interface/src/commerce/Ledger.cpp index 9991958455..0f7f533e13 100644 --- a/interface/src/commerce/Ledger.cpp +++ b/interface/src/commerce/Ledger.cpp @@ -135,7 +135,6 @@ void Ledger::historySuccess(QNetworkReply& reply) { QJsonArray newHistoryArray; // TODO: do this with 0 copies if possible - auto it = historyArray.begin(); for(auto it = historyArray.begin(); it != historyArray.end(); it++) { auto valueObject = (*it).toObject(); QString from = nameFromKey(valueObject["sender_key"].toString(), keys); From cdadaa8c9c220b15d868095d8e68b43432a2c0fa Mon Sep 17 00:00:00 2001 From: David Kelly Date: Thu, 31 Aug 2017 13:41:53 -0700 Subject: [PATCH 12/16] missed one --- interface/resources/qml/hifi/commerce/checkout/Checkout.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml index 72e4e7622b..d3de8f745b 100644 --- a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml +++ b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml @@ -553,7 +553,7 @@ Rectangle { } RalewayRegular { id: balanceAfterPurchaseText; - text: balanceAfterPurchase.toFixed(2) + " HFC"; + text: balanceAfterPurchase + " HFC"; // Text size size: balanceAfterPurchaseTextLabel.size; // Anchors From 6f1bb6abe28df76956db1be8e55e007f745fa3e7 Mon Sep 17 00:00:00 2001 From: Hisham Qayum Date: Thu, 31 Aug 2017 14:29:03 -0800 Subject: [PATCH 13/16] wallet icon now has white background, diff design --- .../resources/icons/tablet-icons/wallet-a.svg | 181 +---------- .../resources/icons/tablet-icons/wallet-i.svg | 290 +----------------- 2 files changed, 15 insertions(+), 456 deletions(-) diff --git a/interface/resources/icons/tablet-icons/wallet-a.svg b/interface/resources/icons/tablet-icons/wallet-a.svg index 4a0bab4b33..50ea64848f 100644 --- a/interface/resources/icons/tablet-icons/wallet-a.svg +++ b/interface/resources/icons/tablet-icons/wallet-a.svg @@ -1,180 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - HFC - + \ No newline at end of file diff --git a/interface/resources/icons/tablet-icons/wallet-i.svg b/interface/resources/icons/tablet-icons/wallet-i.svg index 2a16ecf973..4e27e41b44 100644 --- a/interface/resources/icons/tablet-icons/wallet-i.svg +++ b/interface/resources/icons/tablet-icons/wallet-i.svg @@ -1,276 +1,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - HFC - + + + + + + + + From 1eb503f526b548705c3695cdfd4932562726cc52 Mon Sep 17 00:00:00 2001 From: David Kelly Date: Thu, 31 Aug 2017 16:49:12 -0700 Subject: [PATCH 14/16] we are qt5.6 on mac --- interface/src/commerce/Ledger.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interface/src/commerce/Ledger.cpp b/interface/src/commerce/Ledger.cpp index 0f7f533e13..7937fa4bbb 100644 --- a/interface/src/commerce/Ledger.cpp +++ b/interface/src/commerce/Ledger.cpp @@ -142,7 +142,11 @@ void Ledger::historySuccess(QNetworkReply& reply) { // turns out on my machine, toLocalTime convert to some weird timezone, yet the // systemTimeZone is correct. To avoid a strange bug with other's systems too, lets // be explicit +#ifdef Q_OS_MAC + QDateTime createdAt = QDateTime::fromTime_t(valueObject["created_at"].toInt(), Qt::UTC); +#elif QDateTime createdAt = QDateTime::fromSecsSinceEpoch(valueObject["created_at"].toInt(), Qt::UTC); +#endif QDateTime localCreatedAt = createdAt.toTimeZone(QTimeZone::systemTimeZone()); valueObject["text"] = QString("%1 sent %2 %3 %4 on %5 with message \"%6\""). arg(from, to, QString::number(valueObject["quantity"].toInt()), valueObject["asset_title"].toString(), localCreatedAt.toString(Qt::SystemLocaleShortDate), valueObject["message"].toString()); From ff6217069b7b16f5c94ccc4c21b55e968e98012d Mon Sep 17 00:00:00 2001 From: Hisham Qayum Date: Thu, 31 Aug 2017 17:30:24 -0800 Subject: [PATCH 15/16] reverting some unneeded code changes --- interface/src/Application.cpp | 2 +- libraries/physics/src/EntityMotionState.cpp | 2 +- libraries/physics/src/PhysicsEngine.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index b48ef22763..88003bb10f 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -319,7 +319,7 @@ static const int THROTTLED_SIM_FRAME_PERIOD_MS = MSECS_PER_SECOND / THROTTLED_SI static const uint32_t INVALID_FRAME = UINT32_MAX; -static const float PHYSICS_READY_RANGE = 1.0f; // how far from avatar to check for entities that aren't ready for simulation +static const float PHYSICS_READY_RANGE = 3.0f; // how far from avatar to check for entities that aren't ready for simulation static const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); diff --git a/libraries/physics/src/EntityMotionState.cpp b/libraries/physics/src/EntityMotionState.cpp index 93ef140f30..f02dcee8f6 100644 --- a/libraries/physics/src/EntityMotionState.cpp +++ b/libraries/physics/src/EntityMotionState.cpp @@ -531,7 +531,7 @@ void EntityMotionState::sendUpdate(OctreeEditPacketSender* packetSender, uint32_ } if (!_body->isStaticOrKinematicObject()) { - const float DYNAMIC_LINEAR_VELOCITY_THRESHOLD = 0.02f; // 5 cm/sec + const float DYNAMIC_LINEAR_VELOCITY_THRESHOLD = 0.05f; // 5 cm/sec const float DYNAMIC_ANGULAR_VELOCITY_THRESHOLD = 0.087266f; // ~5 deg/sec bool movingSlowlyLinear = diff --git a/libraries/physics/src/PhysicsEngine.cpp b/libraries/physics/src/PhysicsEngine.cpp index 1dba0e9a07..a64796308e 100644 --- a/libraries/physics/src/PhysicsEngine.cpp +++ b/libraries/physics/src/PhysicsEngine.cpp @@ -441,7 +441,7 @@ const CollisionEvents& PhysicsEngine::getCollisionEvents() { while (contactItr != _contactMap.end()) { ContactInfo& contact = contactItr->second; ContactEventType type = contact.computeType(_numContactFrames); - const btScalar SIGNIFICANT_DEPTH = -0.008f; // penetrations have negative distance + const btScalar SIGNIFICANT_DEPTH = -0.002f; // penetrations have negative distance if (type != CONTACT_EVENT_TYPE_CONTINUE || (contact.distance < SIGNIFICANT_DEPTH && contact.readyForContinue(_numContactFrames))) { From 655dc61ff270f717755896b33b92674023e04fdf Mon Sep 17 00:00:00 2001 From: David Kelly Date: Fri, 1 Sep 2017 10:16:45 -0700 Subject: [PATCH 16/16] doh --- interface/src/commerce/Ledger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/commerce/Ledger.cpp b/interface/src/commerce/Ledger.cpp index 7937fa4bbb..2055229059 100644 --- a/interface/src/commerce/Ledger.cpp +++ b/interface/src/commerce/Ledger.cpp @@ -144,7 +144,7 @@ void Ledger::historySuccess(QNetworkReply& reply) { // be explicit #ifdef Q_OS_MAC QDateTime createdAt = QDateTime::fromTime_t(valueObject["created_at"].toInt(), Qt::UTC); -#elif +#else QDateTime createdAt = QDateTime::fromSecsSinceEpoch(valueObject["created_at"].toInt(), Qt::UTC); #endif QDateTime localCreatedAt = createdAt.toTimeZone(QTimeZone::systemTimeZone());