From df4d81277f8e8cd5e6d32a43b1cabc725ab5b2d2 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Mon, 9 Jul 2018 16:59:32 -0700 Subject: [PATCH 01/21] clean up tablet material entities and don't show them in edit --- .../controllerModules/inEditMode.js | 26 ++++++++++++------- scripts/system/libraries/WebTablet.js | 20 ++++++++++++++ scripts/system/libraries/entityList.js | 9 +++++++ 3 files changed, 46 insertions(+), 9 deletions(-) diff --git a/scripts/system/controllers/controllerModules/inEditMode.js b/scripts/system/controllers/controllerModules/inEditMode.js index a724c2037b..377167d7bf 100644 --- a/scripts/system/controllers/controllerModules/inEditMode.js +++ b/scripts/system/controllers/controllerModules/inEditMode.js @@ -10,7 +10,7 @@ /* global Script, Controller, RIGHT_HAND, LEFT_HAND, enableDispatcherModule, disableDispatcherModule, makeRunningValues, Messages, makeDispatcherModuleParameters, HMD, getGrabPointSphereOffset, COLORS_GRAB_SEARCHING_HALF_SQUEEZE, COLORS_GRAB_SEARCHING_FULL_SQUEEZE, COLORS_GRAB_DISTANCE_HOLD, DEFAULT_SEARCH_SPHERE_DISTANCE, TRIGGER_ON_VALUE, - getEnabledModuleByName, PICK_MAX_DISTANCE, isInEditMode, Picks, makeLaserParams + getEnabledModuleByName, PICK_MAX_DISTANCE, isInEditMode, Picks, makeLaserParams, Entities */ Script.include("/~/system/libraries/controllerDispatcherUtils.js"); @@ -19,7 +19,7 @@ Script.include("/~/system/libraries/utils.js"); (function () { var MARGIN = 25; - + var TABLET_MATERIAL_ENTITY_NAME = 'Tablet-Material-Entity'; function InEditMode(hand) { this.hand = hand; this.triggerClicked = false; @@ -53,7 +53,7 @@ Script.include("/~/system/libraries/utils.js"); return (HMD.tabletScreenID && objectID === HMD.tabletScreenID) || (HMD.homeButtonID && objectID === HMD.homeButtonID); }; - + this.calculateNewReticlePosition = function(intersection) { var dims = Controller.getViewportDimensions(); this.reticleMaxX = dims.x - MARGIN; @@ -75,10 +75,12 @@ Script.include("/~/system/libraries/utils.js"); } } if (this.selectedTarget.type === Picks.INTERSECTED_ENTITY) { - Messages.sendLocalMessage("entityToolUpdates", JSON.stringify({ - method: "selectEntity", - entityID: this.selectedTarget.objectID - })); + if (!this.isTabletMaterialEntity(this.selectedTarget.objectID)) { + Messages.sendLocalMessage("entityToolUpdates", JSON.stringify({ + method: "selectEntity", + entityID: this.selectedTarget.objectID + })); + } } else if (this.selectedTarget.type === Picks.INTERSECTED_OVERLAY) { Messages.sendLocalMessage("entityToolUpdates", JSON.stringify({ method: "selectOverlay", @@ -88,10 +90,16 @@ Script.include("/~/system/libraries/utils.js"); this.triggerClicked = true; } - + this.sendPointingAtData(controllerData); }; - + + + this.isTabletMaterialEntity = function(entityID) { + return ((entityID === HMD.homeButtonHighlightMaterialID) || + (entityID === HMD.homeButtonUnhighlightMaterialID)); + }; + this.sendPointingAtData = function(controllerData) { var rayPick = controllerData.rayPicks[this.hand]; var hudRayPick = controllerData.hudRayPicks[this.hand]; diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index 532f58493f..1a3b635f80 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -30,6 +30,8 @@ var INCHES_TO_METERS = 1 / 39.3701; var NO_HANDS = -1; var DELAY_FOR_30HZ = 33; // milliseconds +var TABLET_MATERIAL_ENTITY_NAME = 'Tablet-Material-Entity'; + // will need to be recaclulated if dimensions of fbx model change. var TABLET_NATURAL_DIMENSIONS = {x: 32.083, y: 48.553, z: 2.269}; @@ -79,6 +81,21 @@ function calcSpawnInfo(hand, landscape) { }; } + +function cleanUpOldMaterialEntities() { + var avatarEntityData = MyAvatar.getAvatarEntityData(); + + for (var entityID in avatarEntityData) { + var entityName = Entities.getEntityProperties(entityID, ["name"]).name; + + if (entityName === TABLET_MATERIAL_ENTITY_NAME) { + Entities.deleteEntity(entityID); + } + } +} + +cleanUpOldMaterialEntities(); + /** * WebTablet * @param url [string] url of content to show on the tablet. @@ -134,6 +151,7 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location, visible) { } this.cleanUpOldTablets(); + cleanUpOldMaterialEntities(); this.tabletEntityID = Overlays.addOverlay("model", tabletProperties); @@ -180,6 +198,7 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location, visible) { this.homeButtonUnhighlightMaterial = Entities.addEntity({ type: "Material", + name: TABLET_MATERIAL_ENTITY_NAME, materialURL: "materialData", localPosition: { x: 0.0, y: 0.0, z: 0.0 }, priority: HIGH_PRIORITY, @@ -199,6 +218,7 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location, visible) { this.homeButtonHighlightMaterial = Entities.addEntity({ type: "Material", + name: TABLET_MATERIAL_ENTITY_NAME, materialURL: "materialData", localPosition: { x: 0.0, y: 0.0, z: 0.0 }, priority: LOW_PRIORITY, diff --git a/scripts/system/libraries/entityList.js b/scripts/system/libraries/entityList.js index 06ad7d3e03..908c8400f1 100644 --- a/scripts/system/libraries/entityList.js +++ b/scripts/system/libraries/entityList.js @@ -70,6 +70,11 @@ EntityListTool = function(opts) { return value !== undefined ? value : ""; } + function filterEntity(entityID) { + return ((entityID === HMD.homeButtonHighlightMaterialID) || + (entityID === HMD.homeButtonUnhighlightMaterialID)); + } + that.sendUpdate = function() { var entities = []; @@ -80,6 +85,10 @@ EntityListTool = function(opts) { ids = Entities.findEntities(MyAvatar.position, searchRadius); } + ids = ids.filter(function(id) { + return !filterEntity(id); + }); + var cameraPosition = Camera.position; for (var i = 0; i < ids.length; i++) { var id = ids[i]; From 1cc95fbf76475495989b5a55ba8246376ceb311f Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Tue, 10 Jul 2018 11:05:41 -0700 Subject: [PATCH 02/21] better fix --- scripts/system/libraries/WebTablet.js | 10 ++++------ scripts/system/tablet-ui/tabletUI.js | 11 ++++++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index 1a3b635f80..f83f961438 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -82,19 +82,17 @@ function calcSpawnInfo(hand, landscape) { } -function cleanUpOldMaterialEntities() { +cleanUpOldMaterialEntities = function() { var avatarEntityData = MyAvatar.getAvatarEntityData(); - for (var entityID in avatarEntityData) { var entityName = Entities.getEntityProperties(entityID, ["name"]).name; - if (entityName === TABLET_MATERIAL_ENTITY_NAME) { + if (entityName === TABLET_MATERIAL_ENTITY_NAME && entityID !== HMD.homeButtonHighlightMaterialID && + entityID !== HMD.homeButtonUnhighlightMaterialID) { Entities.deleteEntity(entityID); } } -} - -cleanUpOldMaterialEntities(); +}; /** * WebTablet diff --git a/scripts/system/tablet-ui/tabletUI.js b/scripts/system/tablet-ui/tabletUI.js index 29dc457197..bd6a9c69d5 100644 --- a/scripts/system/tablet-ui/tabletUI.js +++ b/scripts/system/tablet-ui/tabletUI.js @@ -13,7 +13,7 @@ // /* global Script, HMD, WebTablet, UIWebTablet, UserActivityLogger, Settings, Entities, Messages, Tablet, Overlays, - MyAvatar, Menu, AvatarInputs, Vec3 */ + MyAvatar, Menu, AvatarInputs, Vec3, cleanUpOldMaterialEntities */ (function() { // BEGIN LOCAL_SCOPE var tabletRezzed = false; @@ -31,6 +31,14 @@ Script.include("../libraries/WebTablet.js"); + function cleanupMaterialEntities() { + if (Window.isPhysicsEnabled()) { + cleanUpOldMaterialEntities(); + return; + } + Script.setTimeout(cleanupMaterialEntities, 100); + } + function checkTablet() { if (gTablet === null) { gTablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); @@ -327,4 +335,5 @@ HMD.homeButtonHighlightMaterialID = null; HMD.homeButtonUnhighlightMaterialID = null; }); + Script.setTimeout(cleanupMaterialEntities, 100); }()); // END LOCAL_SCOPE From 41b08fcf40adfde5574888326f97607f80a24470 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Tue, 10 Jul 2018 18:17:34 -0700 Subject: [PATCH 03/21] Validate user-supplied avatar height range before accepting --- domain-server/resources/web/settings/js/settings.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/domain-server/resources/web/settings/js/settings.js b/domain-server/resources/web/settings/js/settings.js index e67ea43158..3dd8fc99f8 100644 --- a/domain-server/resources/web/settings/js/settings.js +++ b/domain-server/resources/web/settings/js/settings.js @@ -1091,4 +1091,17 @@ $(document).ready(function(){ $('#settings_backup .panel-body').html(html); } + + function checkAvatarHeights() { + var minHeight = Settings.avatars.min_avatar_height; + var maxHeight = Settings.avatars.max_avatar_height; + if (maxHeight < minHeight) { + swal({ + type: 'error', + title: '', + text: "Maximum avatar height must not be less than minimum avatar height", + html: true + }, function(){swal.close();}); + } + } }); From 7455f9fc18ef9196e44d29fe4ac4f4a0ba3620ea Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Tue, 10 Jul 2018 18:25:43 -0700 Subject: [PATCH 04/21] Update the correct file this time --- .../resources/web/settings/js/settings.js | 46 ++++++++++++++----- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/domain-server/resources/web/settings/js/settings.js b/domain-server/resources/web/settings/js/settings.js index 3dd8fc99f8..55ce21e956 100644 --- a/domain-server/resources/web/settings/js/settings.js +++ b/domain-server/resources/web/settings/js/settings.js @@ -58,7 +58,11 @@ $(document).ready(function(){ } Settings.handlePostSettings = function(formJSON) { - + + if (!checkAvatarHeights()) { + return false; + } + // check if we've set the basic http password if (formJSON["security"]) { @@ -1093,15 +1097,35 @@ $(document).ready(function(){ } function checkAvatarHeights() { - var minHeight = Settings.avatars.min_avatar_height; - var maxHeight = Settings.avatars.max_avatar_height; - if (maxHeight < minHeight) { - swal({ - type: 'error', - title: '', - text: "Maximum avatar height must not be less than minimum avatar height", - html: true - }, function(){swal.close();}); - } + var errorString = ''; + var minAllowedHeight = 0.009; + var maxAllowedHeight = 1755; + var currentForm = form2js('settings-form'); + var minHeight = currentForm.avatars.min_avatar_height; + var maxHeight = currentForm.avatars.max_avatar_height; + //var minHeight = Number($('input[name="avatars.min_avatar_height"]').attr('value')); + //var maxHeight = Number($('input[name="avatars.max_avatar_height"]').attr('value')); + + if (maxHeight < minHeight) { + errorString = 'Maximum avatar height must not be less than minimum avatar height
'; + }; + if (minHeight < minAllowedHeight) { + errorString += 'Minimum avatar height must not be less than ' + minAllowedHeight + '
'; + } + if (maxHeight > maxAllowedHeight) { + errorString += 'Maximum avatar height must not be greater than ' + maxAllowedHeight + '
'; + } + if (errorString.length > 0) { + swal({ + type: 'error', + title: '', + text: errorString, + html: true + }); + return false; + } else { + return true; + } + } }); From 09b7787bc9b2f9e3dae9e8f792045e6d93f84e28 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Wed, 11 Jul 2018 10:27:17 -0700 Subject: [PATCH 05/21] Use jQuery correctly, other clean-up --- .../resources/web/settings/js/settings.js | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/domain-server/resources/web/settings/js/settings.js b/domain-server/resources/web/settings/js/settings.js index 55ce21e956..3888277c00 100644 --- a/domain-server/resources/web/settings/js/settings.js +++ b/domain-server/resources/web/settings/js/settings.js @@ -59,7 +59,7 @@ $(document).ready(function(){ Settings.handlePostSettings = function(formJSON) { - if (!checkAvatarHeights()) { + if (!verifyAvatarHeights()) { return false; } @@ -211,7 +211,7 @@ $(document).ready(function(){ swal({ title: '', type: 'error', - text: "There was a problem retreiving domain information from High Fidelity API.", + text: "There was a problem retrieving domain information from High Fidelity API.", confirmButtonText: 'Try again', showCancelButton: true, closeOnConfirm: false @@ -292,7 +292,7 @@ $(document).ready(function(){ swal({ title: 'Create new domain ID', type: 'input', - text: 'Enter a label this machine.

This will help you identify which domain ID belongs to which machine.

', + text: 'Enter a label for this machine.

This will help you identify which domain ID belongs to which machine.

', showCancelButton: true, confirmButtonText: "Create", closeOnConfirm: false, @@ -673,7 +673,7 @@ $(document).ready(function(){ var spinner = createDomainSpinner(); $('#' + Settings.PLACES_TABLE_ID).after($(spinner)); - var errorEl = createDomainLoadingError("There was an error retreiving your places."); + var errorEl = createDomainLoadingError("There was an error retrieving your places."); $("#" + Settings.PLACES_TABLE_ID).after(errorEl); // do we have a domain ID? @@ -1096,25 +1096,31 @@ $(document).ready(function(){ $('#settings_backup .panel-body').html(html); } - function checkAvatarHeights() { + function verifyAvatarHeights() { var errorString = ''; var minAllowedHeight = 0.009; var maxAllowedHeight = 1755; - var currentForm = form2js('settings-form'); - var minHeight = currentForm.avatars.min_avatar_height; - var maxHeight = currentForm.avatars.max_avatar_height; - //var minHeight = Number($('input[name="avatars.min_avatar_height"]').attr('value')); - //var maxHeight = Number($('input[name="avatars.max_avatar_height"]').attr('value')); - + var alertCss = { backgroundColor: '#ffa0a0' }; + var minHeightElement = $('input[name="avatars.min_avatar_height"]'); + var maxHeightElement = $('input[name="avatars.max_avatar_height"]'); + + var minHeight = Number(minHeightElement.val()); + var maxHeight = Number(maxHeightElement.val()); + if (maxHeight < minHeight) { - errorString = 'Maximum avatar height must not be less than minimum avatar height
'; + errorString = 'Maximum avatar height must not be less than minimum avatar height
'; + minHeightElement.css(alertCss); + maxHeightElement.css(alertCss); }; if (minHeight < minAllowedHeight) { - errorString += 'Minimum avatar height must not be less than ' + minAllowedHeight + '
'; + errorString += 'Minimum avatar height must not be less than ' + minAllowedHeight + '
'; + minHeightElement.css(alertCss); } if (maxHeight > maxAllowedHeight) { - errorString += 'Maximum avatar height must not be greater than ' + maxAllowedHeight + '
'; + errorString += 'Maximum avatar height must not be greater than ' + maxAllowedHeight + '
'; + maxHeightElement.css(alertCss); } + if (errorString.length > 0) { swal({ type: 'error', @@ -1124,7 +1130,7 @@ $(document).ready(function(){ }); return false; } else { - return true; + return true; } } From beb878f10ef519d64f0534a417bd1fc0c324384a Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Wed, 11 Jul 2018 10:33:42 -0700 Subject: [PATCH 06/21] Update avatar field description --- domain-server/resources/describe-settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domain-server/resources/describe-settings.json b/domain-server/resources/describe-settings.json index 83dd633d22..07f1eb7e5e 100644 --- a/domain-server/resources/describe-settings.json +++ b/domain-server/resources/describe-settings.json @@ -1223,7 +1223,7 @@ "name": "max_avatar_height", "type": "double", "label": "Maximum Avatar Height (meters)", - "help": "Limits the scale of avatars in your domain. Cannot be greater than 1755.", + "help": "Limits the height of avatars in your domain. Cannot be greater than 1755.", "placeholder": 5.2, "default": 5.2 }, From f9baeaf1513399236967a04a838f45ea6f9d0920 Mon Sep 17 00:00:00 2001 From: Cristian Luis Duarte Date: Mon, 16 Jul 2018 12:28:44 -0300 Subject: [PATCH 07/21] Android - logs during startup - weirdly did not get stuck during tests --- .../hifiinterface/InterfaceActivity.java | 3 +++ .../hifiinterface/SplashActivity.java | 5 +++++ interface/src/Application.cpp | 15 ++++++++------- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/android/app/src/main/java/io/highfidelity/hifiinterface/InterfaceActivity.java b/android/app/src/main/java/io/highfidelity/hifiinterface/InterfaceActivity.java index 8fd8b9d0e6..90db3fe47f 100644 --- a/android/app/src/main/java/io/highfidelity/hifiinterface/InterfaceActivity.java +++ b/android/app/src/main/java/io/highfidelity/hifiinterface/InterfaceActivity.java @@ -83,6 +83,7 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW @Override public void onCreate(Bundle savedInstanceState) { + Log.d("[LOADSTUCK]", "InterfaceActivity::onCreate starting Interface Activity"); super.isLoading = true; Intent intent = getIntent(); if (intent.hasExtra(DOMAIN_URL) && !intent.getStringExtra(DOMAIN_URL).isEmpty()) { @@ -128,6 +129,7 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW getActionBar().hide(); } }); + Log.d("[LOADSTUCK]", "InterfaceActivity::onCreate starting Loading Screen"); startActivity(new Intent(this, SplashActivity.class)); mVibrator = (Vibrator) this.getSystemService(VIBRATOR_SERVICE); @@ -149,6 +151,7 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW layoutParams.resolveLayoutDirection(View.LAYOUT_DIRECTION_RTL); qtLayout.addView(webSlidingDrawer, layoutParams); webSlidingDrawer.setVisibility(View.GONE); + Log.d("[LOADSTUCK]", "InterfaceActivity::onCreate done"); } @Override diff --git a/android/app/src/main/java/io/highfidelity/hifiinterface/SplashActivity.java b/android/app/src/main/java/io/highfidelity/hifiinterface/SplashActivity.java index e0aa967aaa..cd12487688 100644 --- a/android/app/src/main/java/io/highfidelity/hifiinterface/SplashActivity.java +++ b/android/app/src/main/java/io/highfidelity/hifiinterface/SplashActivity.java @@ -1,9 +1,11 @@ package io.highfidelity.hifiinterface; import android.app.Activity; +import android.app.Application; import android.content.Intent; import android.os.Bundle; import android.os.Handler; +import android.util.Log; import android.view.View; public class SplashActivity extends Activity { @@ -12,9 +14,11 @@ public class SplashActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { + Log.d("[LOADSTUCK]", "SplashActivity::onCreate Creating loading screen"); super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); registerLoadCompleteListener(); + Log.d("[LOADSTUCK]", "SplashActivity::onCreate registered as loaded listener"); } @Override @@ -37,6 +41,7 @@ public class SplashActivity extends Activity { } public void onAppLoadedComplete() { + Log.d("[LOADSTUCK]", "SplashActivity::onAppLoadedComplete received"); startActivity(new Intent(this, MainActivity.class)); SplashActivity.this.finish(); } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 311c08b858..55265dcfeb 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1003,7 +1003,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo _sampleSound(nullptr) { - + qDebug() << "[LOADSTUCK] Application::Application started constructor"; auto steamClient = PluginManager::getInstance()->getSteamClientPlugin(); setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning())); setProperty(hifi::properties::CRASHED, _previousSessionCrashed); @@ -1643,7 +1643,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo } } }); - + qDebug() << "[LOADSTUCK] Application::Application 20 user input mapper stuff done"; _applicationStateDevice = userInputMapper->getStateDevice(); _applicationStateDevice->setInputVariant(STATE_IN_HMD, []() -> float { @@ -1711,7 +1711,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo updateHeartbeat(); loadSettings(); - + qDebug() << "[LOADSTUCK] Application::Application 30 settings loaded"; updateVerboseLogging(); // Now that we've loaded the menu and thus switched to the previous display plugin @@ -1763,7 +1763,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo connect(audioIO.data(), &AudioClient::inputReceived, audioScriptingInterface.data(), &AudioScriptingInterface::inputReceived); this->installEventFilter(this); - + qDebug() << "[LOADSTUCK] Application::Application 40 event filter installed"; #ifdef HAVE_DDE auto ddeTracker = DependencyManager::get(); ddeTracker->init(); @@ -1897,7 +1897,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo } return false; }); - + qDebug() << "[LOADSTUCK] Application::Application 50 entity tree stuff done"; // Keyboard focus handling for Web overlays. auto overlays = &(qApp->getOverlays()); connect(overlays, &Overlays::overlayDeleted, [=](const OverlayID& overlayID) { @@ -2156,7 +2156,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo // Make sure we don't time out during slow operations at startup updateHeartbeat(); - + qDebug() << "[LOADSTUCK] Application::Application 60 heartbeat updated"; OctreeEditPacketSender* packetSender = entityScriptingInterface->getPacketSender(); EntityEditPacketSender* entityPacketSender = static_cast(packetSender); entityPacketSender->setMyAvatar(myAvatar.get()); @@ -2217,7 +2217,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo updateSystemTabletMode(); connect(&_myCamera, &Camera::modeUpdated, this, &Application::cameraModeChanged); - + qDebug() << "[LOADSTUCK] Application::Application 70 camera mode changed connected"; DependencyManager::get()->setShouldPickHUDOperator([&]() { return DependencyManager::get()->isHMDMode(); }); DependencyManager::get()->setCalculatePos2DFromHUDOperator([&](const glm::vec3& intersection) { const glm::vec2 MARGIN(25.0f); @@ -2261,6 +2261,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo connect(&AndroidHelper::instance(), &AndroidHelper::beforeEnterBackground, this, &Application::beforeEnterBackground); connect(&AndroidHelper::instance(), &AndroidHelper::enterBackground, this, &Application::enterBackground); connect(&AndroidHelper::instance(), &AndroidHelper::enterForeground, this, &Application::enterForeground); + qDebug() << "[LOADSTUCK] Application::Application before calling notifyLoadComplete()"; AndroidHelper::instance().notifyLoadComplete(); #endif } From c664ce767175076030c5210136bd41eb22bd755a Mon Sep 17 00:00:00 2001 From: Cristian Luis Duarte Date: Tue, 17 Jul 2018 15:05:56 -0300 Subject: [PATCH 08/21] Android - bypass settings reset dialog with cli option --- interface/src/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/interface/src/main.cpp b/interface/src/main.cpp index 85a83d88d1..c1ba6f0535 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -262,6 +262,9 @@ int main(int argc, const char* argv[]) { // Extend argv to enable WebGL rendering std::vector argvExtended(&argv[0], &argv[argc]); argvExtended.push_back("--ignore-gpu-blacklist"); +#ifdef Q_OS_ANDROID + argvExtended.push_back("--suppress-settings-reset"); +#endif int argcExtended = (int)argvExtended.size(); PROFILE_SYNC_END(startup, "main startup", ""); From 6577a93cc99c9dc8dcfe284da54c5c81f09bb18b Mon Sep 17 00:00:00 2001 From: Cristian Luis Duarte Date: Wed, 18 Jul 2018 12:43:13 -0300 Subject: [PATCH 09/21] Android Qt - Update QtActivity after change avoiding recursive loop android/app/src/main/java/org/qtproject/qt5/android/bindings/QtActivity.java --- .../java/org/qtproject/qt5/android/bindings/QtActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/src/main/java/org/qtproject/qt5/android/bindings/QtActivity.java b/android/app/src/main/java/org/qtproject/qt5/android/bindings/QtActivity.java index 4a460ff9e7..5b12cd45c0 100644 --- a/android/app/src/main/java/org/qtproject/qt5/android/bindings/QtActivity.java +++ b/android/app/src/main/java/org/qtproject/qt5/android/bindings/QtActivity.java @@ -103,7 +103,7 @@ public class QtActivity extends Activity { } public boolean super_dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { - return super_dispatchPopulateAccessibilityEvent(event); + return super.dispatchPopulateAccessibilityEvent(event); } //--------------------------------------------------------------------------- From 965c35292c36a06df8cebcb879d2833220346ec0 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Thu, 19 Jul 2018 10:40:16 -0700 Subject: [PATCH 10/21] put back old-style avatar-attachments menu-item --- interface/src/Menu.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 8524c40262..130c2c0b89 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -275,6 +275,13 @@ Menu::Menu() { QString("hifi/tablet/TabletGraphicsPreferences.qml"), "GraphicsPreferencesDialog"); }); + // Settings > Attachments... + action = addActionToQMenuAndActionHash(settingsMenu, MenuOption::Attachments); + connect(action, &QAction::triggered, [] { + qApp->showDialog(QString("hifi/dialogs/AttachmentsDialog.qml"), + QString("hifi/tablet/TabletAttachmentsDialog.qml"), "AttachmentsDialog"); + }); + // Settings > Developer Menu addCheckableActionToQMenuAndActionHash(settingsMenu, "Developer Menu", 0, false, this, SLOT(toggleDeveloperMenus())); From 25b558e6b44ee1f6bca523d17feba84035d1c87f Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Thu, 19 Jul 2018 12:56:18 -0700 Subject: [PATCH 11/21] Fix xz guides not showing when translating with Shift --- .../system/libraries/entitySelectionTool.js | 111 +++++++++++++++++- 1 file changed, 106 insertions(+), 5 deletions(-) diff --git a/scripts/system/libraries/entitySelectionTool.js b/scripts/system/libraries/entitySelectionTool.js index 96a3b2b015..5656ba68af 100644 --- a/scripts/system/libraries/entitySelectionTool.js +++ b/scripts/system/libraries/entitySelectionTool.js @@ -616,6 +616,40 @@ SelectionDisplay = (function() { dashed: false }); + var xRailOverlay = Overlays.addOverlay("line3d", { + visible: false, + start: Vec3.ZERO, + end: Vec3.ZERO, + color: { + red: 255, + green: 0, + blue: 0 + }, + ignoreRayIntersection: true // always ignore this + }); + var yRailOverlay = Overlays.addOverlay("line3d", { + visible: false, + start: Vec3.ZERO, + end: Vec3.ZERO, + color: { + red: 0, + green: 255, + blue: 0 + }, + ignoreRayIntersection: true // always ignore this + }); + var zRailOverlay = Overlays.addOverlay("line3d", { + visible: false, + start: Vec3.ZERO, + end: Vec3.ZERO, + color: { + red: 0, + green: 0, + blue: 255 + }, + ignoreRayIntersection: true // always ignore this +}); + var allOverlays = [ handleTranslateXCone, handleTranslateXCylinder, @@ -656,7 +690,11 @@ SelectionDisplay = (function() { handleScaleFLEdge, handleCloner, selectionBox, - iconSelectionBox + iconSelectionBox, + xRailOverlay, + yRailOverlay, + zRailOverlay + ]; var maximumHandleInAllOverlays = handleCloner; @@ -873,11 +911,14 @@ SelectionDisplay = (function() { }; // FUNCTION: MOUSE MOVE EVENT + var lastMouseEvent = null; that.mouseMoveEvent = function(event) { + print("Got mouse move event", JSON.stringify(event)); var wantDebug = false; if (wantDebug) { print("=============== eST::MouseMoveEvent BEG ======================="); } + lastMouseEvent = event; if (activeTool) { if (wantDebug) { print(" Trigger ActiveTool(" + activeTool.mode + ")'s onMove"); @@ -999,19 +1040,35 @@ SelectionDisplay = (function() { }; // Control key remains active only while key is held down - that.keyReleaseEvent = function(key) { - if (key.key === CTRL_KEY_CODE) { + that.keyReleaseEvent = function(event) { + if (event.key === CTRL_KEY_CODE) { ctrlPressed = false; that.updateActiveRotateRing(); } + if (activeTool && lastMouseEvent !== null) { + lastMouseEvent.isShifted = event.isShifted; + lastMouseEvent.isMeta = event.isMeta; + lastMouseEvent.isControl = event.isControl; + lastMouseEvent.isAlt = event.isAlt; + activeTool.onMove(lastMouseEvent); + SelectionManager._update(); + } }; // Triggers notification on specific key driven events - that.keyPressEvent = function(key) { - if (key.key === CTRL_KEY_CODE) { + that.keyPressEvent = function(event) { + if (event.key === CTRL_KEY_CODE) { ctrlPressed = true; that.updateActiveRotateRing(); } + if (activeTool && lastMouseEvent !== null) { + lastMouseEvent.isShifted = event.isShifted; + lastMouseEvent.isMeta = event.isMeta; + lastMouseEvent.isControl = event.isControl; + lastMouseEvent.isAlt = event.isAlt; + activeTool.onMove(lastMouseEvent); + SelectionManager._update(); + } }; // NOTE: mousePressEvent and mouseMoveEvent from the main script should call us., so we don't hook these: @@ -1705,6 +1762,14 @@ SelectionDisplay = (function() { }, onEnd: function(event, reason) { pushCommandForSelections(duplicatedEntityIDs); + if (isConstrained) { + Overlays.editOverlay(xRailOverlay, { + visible: false + }); + Overlays.editOverlay(zRailOverlay, { + visible: false + }); + } }, elevation: function(origin, intersection) { return (origin.y - intersection.y) / Vec3.distance(origin, intersection); @@ -1768,10 +1833,46 @@ SelectionDisplay = (function() { vector.x = 0; } if (!isConstrained) { + var xStart = Vec3.sum(startPosition, { + x: -10000, + y: 0, + z: 0 + }); + var xEnd = Vec3.sum(startPosition, { + x: 10000, + y: 0, + z: 0 + }); + var zStart = Vec3.sum(startPosition, { + x: 0, + y: 0, + z: -10000 + }); + var zEnd = Vec3.sum(startPosition, { + x: 0, + y: 0, + z: 10000 + }); + Overlays.editOverlay(xRailOverlay, { + start: xStart, + end: xEnd, + visible: true + }); + Overlays.editOverlay(zRailOverlay, { + start: zStart, + end: zEnd, + visible: true + }); isConstrained = true; } } else { if (isConstrained) { + Overlays.editOverlay(xRailOverlay, { + visible: false + }); + Overlays.editOverlay(zRailOverlay, { + visible: false + }); isConstrained = false; } } From 19146ef73c179477f377c69a21d7f3ea7c100917 Mon Sep 17 00:00:00 2001 From: Cristian Luis Duarte Date: Thu, 19 Jul 2018 20:31:32 -0300 Subject: [PATCH 12/21] Android - avoid the QtNative.m_qtThread.exit(); call --- .../qt5/android/bindings/QtActivity.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/java/org/qtproject/qt5/android/bindings/QtActivity.java b/android/app/src/main/java/org/qtproject/qt5/android/bindings/QtActivity.java index 5b12cd45c0..93ae2bc227 100644 --- a/android/app/src/main/java/org/qtproject/qt5/android/bindings/QtActivity.java +++ b/android/app/src/main/java/org/qtproject/qt5/android/bindings/QtActivity.java @@ -60,6 +60,8 @@ import android.view.View; import android.view.WindowManager.LayoutParams; import android.view.accessibility.AccessibilityEvent; +import org.qtproject.qt5.android.QtNative; + @SuppressWarnings("unused") public class QtActivity extends Activity { public String APPLICATION_PARAMETERS = null; @@ -362,7 +364,25 @@ public class QtActivity extends Activity { @Override protected void onDestroy() { super.onDestroy(); - QtApplication.invokeDelegate(); + /* + cduarte https://highfidelity.manuscript.com/f/cases/16712/App-freezes-on-opening-randomly + After Qt upgrade to 5.11 we had a black screen crash after closing the application with + the hardware button "Back" and trying to start the app again. It could only be fixed after + totally closing the app swiping it in the list of running apps. + This problem did not happen with the previous Qt version. + After analysing changes we came up with this case and change: + https://codereview.qt-project.org/#/c/218882/ + In summary they've moved libs loading to the same thread as main() and as a matter of correctness + in the onDestroy method in QtActivityDelegate, they exit that thread with `QtNative.m_qtThread.exit();` + That exit call is the main reason of this problem. + + In this fix we just replace the `QtApplication.invokeDelegate();` call that may end using the + entire onDestroy method including that thread exit line for other three lines that purposely + terminate qt (borrowed from QtActivityDelegate::onDestroy as well). + */ + QtNative.terminateQt(); + QtNative.setActivity(null, null); + System.exit(0); } //--------------------------------------------------------------------------- From 6d239f40fb0765c647dfe71c41080c12ced01f84 Mon Sep 17 00:00:00 2001 From: Cristian Luis Duarte Date: Thu, 19 Jul 2018 20:47:05 -0300 Subject: [PATCH 13/21] Android - Freeze at startup problem - remove logs --- .../io/highfidelity/hifiinterface/InterfaceActivity.java | 3 --- .../io/highfidelity/hifiinterface/SplashActivity.java | 3 --- interface/src/Application.cpp | 8 -------- 3 files changed, 14 deletions(-) diff --git a/android/app/src/main/java/io/highfidelity/hifiinterface/InterfaceActivity.java b/android/app/src/main/java/io/highfidelity/hifiinterface/InterfaceActivity.java index 90db3fe47f..8fd8b9d0e6 100644 --- a/android/app/src/main/java/io/highfidelity/hifiinterface/InterfaceActivity.java +++ b/android/app/src/main/java/io/highfidelity/hifiinterface/InterfaceActivity.java @@ -83,7 +83,6 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW @Override public void onCreate(Bundle savedInstanceState) { - Log.d("[LOADSTUCK]", "InterfaceActivity::onCreate starting Interface Activity"); super.isLoading = true; Intent intent = getIntent(); if (intent.hasExtra(DOMAIN_URL) && !intent.getStringExtra(DOMAIN_URL).isEmpty()) { @@ -129,7 +128,6 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW getActionBar().hide(); } }); - Log.d("[LOADSTUCK]", "InterfaceActivity::onCreate starting Loading Screen"); startActivity(new Intent(this, SplashActivity.class)); mVibrator = (Vibrator) this.getSystemService(VIBRATOR_SERVICE); @@ -151,7 +149,6 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW layoutParams.resolveLayoutDirection(View.LAYOUT_DIRECTION_RTL); qtLayout.addView(webSlidingDrawer, layoutParams); webSlidingDrawer.setVisibility(View.GONE); - Log.d("[LOADSTUCK]", "InterfaceActivity::onCreate done"); } @Override diff --git a/android/app/src/main/java/io/highfidelity/hifiinterface/SplashActivity.java b/android/app/src/main/java/io/highfidelity/hifiinterface/SplashActivity.java index cd12487688..f8c9d0538f 100644 --- a/android/app/src/main/java/io/highfidelity/hifiinterface/SplashActivity.java +++ b/android/app/src/main/java/io/highfidelity/hifiinterface/SplashActivity.java @@ -14,11 +14,9 @@ public class SplashActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { - Log.d("[LOADSTUCK]", "SplashActivity::onCreate Creating loading screen"); super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); registerLoadCompleteListener(); - Log.d("[LOADSTUCK]", "SplashActivity::onCreate registered as loaded listener"); } @Override @@ -41,7 +39,6 @@ public class SplashActivity extends Activity { } public void onAppLoadedComplete() { - Log.d("[LOADSTUCK]", "SplashActivity::onAppLoadedComplete received"); startActivity(new Intent(this, MainActivity.class)); SplashActivity.this.finish(); } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 55265dcfeb..31a0c2bc25 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1003,7 +1003,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo _sampleSound(nullptr) { - qDebug() << "[LOADSTUCK] Application::Application started constructor"; auto steamClient = PluginManager::getInstance()->getSteamClientPlugin(); setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning())); setProperty(hifi::properties::CRASHED, _previousSessionCrashed); @@ -1643,7 +1642,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo } } }); - qDebug() << "[LOADSTUCK] Application::Application 20 user input mapper stuff done"; _applicationStateDevice = userInputMapper->getStateDevice(); _applicationStateDevice->setInputVariant(STATE_IN_HMD, []() -> float { @@ -1711,7 +1709,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo updateHeartbeat(); loadSettings(); - qDebug() << "[LOADSTUCK] Application::Application 30 settings loaded"; updateVerboseLogging(); // Now that we've loaded the menu and thus switched to the previous display plugin @@ -1763,7 +1760,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo connect(audioIO.data(), &AudioClient::inputReceived, audioScriptingInterface.data(), &AudioScriptingInterface::inputReceived); this->installEventFilter(this); - qDebug() << "[LOADSTUCK] Application::Application 40 event filter installed"; #ifdef HAVE_DDE auto ddeTracker = DependencyManager::get(); ddeTracker->init(); @@ -1897,7 +1893,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo } return false; }); - qDebug() << "[LOADSTUCK] Application::Application 50 entity tree stuff done"; // Keyboard focus handling for Web overlays. auto overlays = &(qApp->getOverlays()); connect(overlays, &Overlays::overlayDeleted, [=](const OverlayID& overlayID) { @@ -2156,7 +2151,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo // Make sure we don't time out during slow operations at startup updateHeartbeat(); - qDebug() << "[LOADSTUCK] Application::Application 60 heartbeat updated"; OctreeEditPacketSender* packetSender = entityScriptingInterface->getPacketSender(); EntityEditPacketSender* entityPacketSender = static_cast(packetSender); entityPacketSender->setMyAvatar(myAvatar.get()); @@ -2217,7 +2211,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo updateSystemTabletMode(); connect(&_myCamera, &Camera::modeUpdated, this, &Application::cameraModeChanged); - qDebug() << "[LOADSTUCK] Application::Application 70 camera mode changed connected"; DependencyManager::get()->setShouldPickHUDOperator([&]() { return DependencyManager::get()->isHMDMode(); }); DependencyManager::get()->setCalculatePos2DFromHUDOperator([&](const glm::vec3& intersection) { const glm::vec2 MARGIN(25.0f); @@ -2261,7 +2254,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo connect(&AndroidHelper::instance(), &AndroidHelper::beforeEnterBackground, this, &Application::beforeEnterBackground); connect(&AndroidHelper::instance(), &AndroidHelper::enterBackground, this, &Application::enterBackground); connect(&AndroidHelper::instance(), &AndroidHelper::enterForeground, this, &Application::enterForeground); - qDebug() << "[LOADSTUCK] Application::Application before calling notifyLoadComplete()"; AndroidHelper::instance().notifyLoadComplete(); #endif } From c5ffdbfe0a55a774943baf228412fb74949ede48 Mon Sep 17 00:00:00 2001 From: Cristian Luis Duarte Date: Thu, 19 Jul 2018 21:19:18 -0300 Subject: [PATCH 14/21] Android - add a faster to load splash screen (LaunchScreen in Android terminology) and a progress indicator in our loading screen (SplashActivity), to reduce the 'frozen' nature of the app startup --- android/app/src/main/AndroidManifest.xml | 3 ++- .../highfidelity/hifiinterface/PermissionChecker.java | 10 ++++++++++ android/app/src/main/res/drawable/launch_screen.xml | 11 +++++++++++ android/app/src/main/res/layout/activity_splash.xml | 8 ++++++++ android/app/src/main/res/values/colors.xml | 1 + android/app/src/main/res/values/styles.xml | 6 ++++++ 6 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 android/app/src/main/res/drawable/launch_screen.xml diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index aa70d88c52..7255e1f295 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -22,7 +22,8 @@ android:icon="@drawable/ic_launcher" android:launchMode="singleTop" android:roundIcon="@drawable/ic_launcher"> - + diff --git a/android/app/src/main/java/io/highfidelity/hifiinterface/PermissionChecker.java b/android/app/src/main/java/io/highfidelity/hifiinterface/PermissionChecker.java index 10cfd85b50..78a6421746 100644 --- a/android/app/src/main/java/io/highfidelity/hifiinterface/PermissionChecker.java +++ b/android/app/src/main/java/io/highfidelity/hifiinterface/PermissionChecker.java @@ -8,6 +8,7 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; import android.util.Log; +import android.view.View; import org.json.JSONException; import org.json.JSONObject; @@ -135,4 +136,13 @@ public class PermissionChecker extends Activity { launchActivityWithPermissions(); } } + + @Override + protected void onResume() { + super.onResume(); + View decorView = getWindow().getDecorView(); + // Hide the status bar. + int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; + decorView.setSystemUiVisibility(uiOptions); + } } diff --git a/android/app/src/main/res/drawable/launch_screen.xml b/android/app/src/main/res/drawable/launch_screen.xml new file mode 100644 index 0000000000..0693094ffa --- /dev/null +++ b/android/app/src/main/res/drawable/launch_screen.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/layout/activity_splash.xml b/android/app/src/main/res/layout/activity_splash.xml index ed25797917..8bb7cbffb6 100644 --- a/android/app/src/main/res/layout/activity_splash.xml +++ b/android/app/src/main/res/layout/activity_splash.xml @@ -7,9 +7,17 @@ android:layout_height="match_parent" android:background="@android:color/black"> + diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml index 15895e4355..7e6cf52d36 100644 --- a/android/app/src/main/res/values/colors.xml +++ b/android/app/src/main/res/values/colors.xml @@ -17,4 +17,5 @@ #FF7171 #99000000 #292929 + #23B2E7 diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index 308c438fa6..25823214cd 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -19,6 +19,9 @@ false true + + From eb5cc00fff839f4e2799ff4a1c9a31878a1d25c4 Mon Sep 17 00:00:00 2001 From: Cristian Luis Duarte Date: Thu, 19 Jul 2018 21:24:29 -0300 Subject: [PATCH 15/21] newlines --- interface/src/Application.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 31a0c2bc25..311c08b858 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1003,6 +1003,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo _sampleSound(nullptr) { + auto steamClient = PluginManager::getInstance()->getSteamClientPlugin(); setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning())); setProperty(hifi::properties::CRASHED, _previousSessionCrashed); @@ -1642,6 +1643,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo } } }); + _applicationStateDevice = userInputMapper->getStateDevice(); _applicationStateDevice->setInputVariant(STATE_IN_HMD, []() -> float { @@ -1709,6 +1711,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo updateHeartbeat(); loadSettings(); + updateVerboseLogging(); // Now that we've loaded the menu and thus switched to the previous display plugin @@ -1760,6 +1763,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo connect(audioIO.data(), &AudioClient::inputReceived, audioScriptingInterface.data(), &AudioScriptingInterface::inputReceived); this->installEventFilter(this); + #ifdef HAVE_DDE auto ddeTracker = DependencyManager::get(); ddeTracker->init(); @@ -1893,6 +1897,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo } return false; }); + // Keyboard focus handling for Web overlays. auto overlays = &(qApp->getOverlays()); connect(overlays, &Overlays::overlayDeleted, [=](const OverlayID& overlayID) { @@ -2151,6 +2156,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo // Make sure we don't time out during slow operations at startup updateHeartbeat(); + OctreeEditPacketSender* packetSender = entityScriptingInterface->getPacketSender(); EntityEditPacketSender* entityPacketSender = static_cast(packetSender); entityPacketSender->setMyAvatar(myAvatar.get()); @@ -2211,6 +2217,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo updateSystemTabletMode(); connect(&_myCamera, &Camera::modeUpdated, this, &Application::cameraModeChanged); + DependencyManager::get()->setShouldPickHUDOperator([&]() { return DependencyManager::get()->isHMDMode(); }); DependencyManager::get()->setCalculatePos2DFromHUDOperator([&](const glm::vec3& intersection) { const glm::vec2 MARGIN(25.0f); From 021905be9bebc70ee705a049f288e8ea2301a0c2 Mon Sep 17 00:00:00 2001 From: Cristian Luis Duarte Date: Thu, 19 Jul 2018 21:27:10 -0300 Subject: [PATCH 16/21] remove unneeded import --- .../main/java/io/highfidelity/hifiinterface/SplashActivity.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/android/app/src/main/java/io/highfidelity/hifiinterface/SplashActivity.java b/android/app/src/main/java/io/highfidelity/hifiinterface/SplashActivity.java index f8c9d0538f..e0aa967aaa 100644 --- a/android/app/src/main/java/io/highfidelity/hifiinterface/SplashActivity.java +++ b/android/app/src/main/java/io/highfidelity/hifiinterface/SplashActivity.java @@ -1,11 +1,9 @@ package io.highfidelity.hifiinterface; import android.app.Activity; -import android.app.Application; import android.content.Intent; import android.os.Bundle; import android.os.Handler; -import android.util.Log; import android.view.View; public class SplashActivity extends Activity { From 2dd09c140a79b0e00f810fb3a8c42714a3010fc0 Mon Sep 17 00:00:00 2001 From: Cristian Luis Duarte Date: Thu, 19 Jul 2018 23:20:51 -0300 Subject: [PATCH 17/21] Android - Show a loading indicator while loading domains (same that appears when refreshing with a swipe-down gesture) --- .../io/highfidelity/hifiinterface/fragment/HomeFragment.java | 1 + 1 file changed, 1 insertion(+) diff --git a/android/app/src/main/java/io/highfidelity/hifiinterface/fragment/HomeFragment.java b/android/app/src/main/java/io/highfidelity/hifiinterface/fragment/HomeFragment.java index 9ca6c7c4cc..7bd373cf1d 100644 --- a/android/app/src/main/java/io/highfidelity/hifiinterface/fragment/HomeFragment.java +++ b/android/app/src/main/java/io/highfidelity/hifiinterface/fragment/HomeFragment.java @@ -66,6 +66,7 @@ public class HomeFragment extends Fragment { GridLayoutManager gridLayoutMgr = new GridLayoutManager(getContext(), numberOfColumns); mDomainsView.setLayoutManager(gridLayoutMgr); mDomainAdapter = new DomainAdapter(getContext(), HifiUtils.getInstance().protocolVersionSignature(), nativeGetLastLocation()); + mSwipeRefreshLayout.setRefreshing(true); mDomainAdapter.setClickListener((view, position, domain) -> { new Handler(getActivity().getMainLooper()).postDelayed(() -> { if (mListener != null) { From ce3922a3c1e7bc52e8ea24ddda584235eea56709 Mon Sep 17 00:00:00 2001 From: danteruiz Date: Fri, 20 Jul 2018 11:23:02 -0700 Subject: [PATCH 18/21] fix avatarEntities undefined crash --- scripts/system/avatarapp.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/system/avatarapp.js b/scripts/system/avatarapp.js index f692128fa3..1f07813d46 100644 --- a/scripts/system/avatarapp.js +++ b/scripts/system/avatarapp.js @@ -159,13 +159,12 @@ function fromQml(message) { // messages are {method, params}, like json-rpc. See for(var bookmarkName in message.data.bookmarks) { var bookmark = message.data.bookmarks[bookmarkName]; - if (!bookmark.avatarEntites) { // ensure avatarEntites always exist - bookmark.avatarEntites = []; - } - bookmark.avatarEntites.forEach(function(avatarEntity) { - avatarEntity.properties.localRotationAngles = Quat.safeEulerAngles(avatarEntity.properties.localRotation) - }) + if (bookmark.avatarEntites) { + bookmark.avatarEntites.forEach(function(avatarEntity) { + avatarEntity.properties.localRotationAngles = Quat.safeEulerAngles(avatarEntity.properties.localRotation) + }); + } } sendToQml(message) From 32122a7c1f6908bbe7c383b80aa7be4292f32973 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 20 Jul 2018 11:37:42 -0700 Subject: [PATCH 19/21] Replace magic numbers with RAIL_AXIS_LENGTH --- scripts/system/libraries/entitySelectionTool.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/system/libraries/entitySelectionTool.js b/scripts/system/libraries/entitySelectionTool.js index 5656ba68af..0eac5e8a7e 100644 --- a/scripts/system/libraries/entitySelectionTool.js +++ b/scripts/system/libraries/entitySelectionTool.js @@ -381,6 +381,8 @@ SelectionDisplay = (function() { var CTRL_KEY_CODE = 16777249; + var RAIL_AXIS_LENGTH = 10000; + var TRANSLATE_DIRECTION = { X: 0, Y: 1, @@ -1834,24 +1836,24 @@ SelectionDisplay = (function() { } if (!isConstrained) { var xStart = Vec3.sum(startPosition, { - x: -10000, + x: -RAIL_AXIS_LENGTH, y: 0, z: 0 }); var xEnd = Vec3.sum(startPosition, { - x: 10000, + x: RAIL_AXIS_LENGTH, y: 0, z: 0 }); var zStart = Vec3.sum(startPosition, { x: 0, y: 0, - z: -10000 + z: -RAIL_AXIS_LENGTH }); var zEnd = Vec3.sum(startPosition, { x: 0, y: 0, - z: 10000 + z: RAIL_AXIS_LENGTH }); Overlays.editOverlay(xRailOverlay, { start: xStart, From ae26c5fe9a283d24c36061d45679d5da23132592 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 20 Jul 2018 11:38:02 -0700 Subject: [PATCH 20/21] Remove extraneous logging --- scripts/system/libraries/entitySelectionTool.js | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/system/libraries/entitySelectionTool.js b/scripts/system/libraries/entitySelectionTool.js index 0eac5e8a7e..6956c7010f 100644 --- a/scripts/system/libraries/entitySelectionTool.js +++ b/scripts/system/libraries/entitySelectionTool.js @@ -915,7 +915,6 @@ SelectionDisplay = (function() { // FUNCTION: MOUSE MOVE EVENT var lastMouseEvent = null; that.mouseMoveEvent = function(event) { - print("Got mouse move event", JSON.stringify(event)); var wantDebug = false; if (wantDebug) { print("=============== eST::MouseMoveEvent BEG ======================="); From 9bf6cff5cd9a2cdf31f8781c34b9a046eaafe361 Mon Sep 17 00:00:00 2001 From: danteruiz Date: Fri, 20 Jul 2018 12:27:51 -0700 Subject: [PATCH 21/21] fix indent isssues --- scripts/system/avatarapp.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/system/avatarapp.js b/scripts/system/avatarapp.js index 1f07813d46..2162b78721 100644 --- a/scripts/system/avatarapp.js +++ b/scripts/system/avatarapp.js @@ -160,11 +160,11 @@ function fromQml(message) { // messages are {method, params}, like json-rpc. See for(var bookmarkName in message.data.bookmarks) { var bookmark = message.data.bookmarks[bookmarkName]; - if (bookmark.avatarEntites) { - bookmark.avatarEntites.forEach(function(avatarEntity) { - avatarEntity.properties.localRotationAngles = Quat.safeEulerAngles(avatarEntity.properties.localRotation) - }); - } + if (bookmark.avatarEntites) { + bookmark.avatarEntites.forEach(function(avatarEntity) { + avatarEntity.properties.localRotationAngles = Quat.safeEulerAngles(avatarEntity.properties.localRotation); + }); + } } sendToQml(message)