From 28fd1380df2b5dffa14a488f1426a52ae75a0b4d Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Mon, 17 Dec 2018 13:37:28 -0800 Subject: [PATCH 1/4] adding target scale and default avatar to login state --- interface/src/Application.cpp | 15 +++++++++++++-- interface/src/Application.h | 2 ++ interface/src/avatar/MyAvatar.cpp | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 4b0724a556..36fb666f69 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5176,7 +5176,13 @@ void Application::pauseUntilLoginDetermined() { return; } - getMyAvatar()->setEnableMeshVisible(false); + auto myAvatar = getMyAvatar(); + _previousAvatarTargetScale = myAvatar->getTargetScale(); + _previousAvatarSkeletonModel = myAvatar->getSkeletonModelURL().toString(); + myAvatar->setTargetScale(1.0f); + myAvatar->setSkeletonModelURLFromScript(myAvatar->defaultFullAvatarModelUrl().toString()); + myAvatar->setEnableMeshVisible(false); + _controllerScriptingInterface->disableMapping(STANDARD_TO_ACTION_MAPPING_NAME); { @@ -5231,7 +5237,12 @@ void Application::resumeAfterLoginDialogActionTaken() { userInputMapper->unloadMapping(NO_MOVEMENT_MAPPING_JSON); _controllerScriptingInterface->disableMapping(NO_MOVEMENT_MAPPING_NAME); } - getMyAvatar()->setEnableMeshVisible(true); + + auto myAvatar = getMyAvatar(); + myAvatar->setTargetScale(_previousAvatarTargetScale); + myAvatar->setSkeletonModelURLFromScript(_previousAvatarSkeletonModel); + myAvatar->setEnableMeshVisible(true); + _controllerScriptingInterface->enableMapping(STANDARD_TO_ACTION_MAPPING_NAME); const auto& nodeList = DependencyManager::get(); diff --git a/interface/src/Application.h b/interface/src/Application.h index e75854a1a4..fd45a594b5 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -691,6 +691,8 @@ private: bool _loginDialogPoppedUp = false; bool _developerMenuVisible{ false }; + QString _previousAvatarSkeletonModel; + float _previousAvatarTargetScale; CameraMode _previousCameraMode; OverlayID _loginDialogOverlayID; LoginStateManager _loginStateManager; diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 97014550a8..0224e5687a 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1479,6 +1479,7 @@ void MyAvatar::loadData() { setSnapTurn(_useSnapTurnSetting.get()); setDominantHand(_dominantHandSetting.get(DOMINANT_RIGHT_HAND).toLower()); setUserHeight(_userHeightSetting.get(DEFAULT_AVATAR_HEIGHT)); + setTargetScale(_scaleSetting.get()); setEnableMeshVisible(Menu::getInstance()->isOptionChecked(MenuOption::MeshVisible)); _follow.setToggleHipsFollowing (Menu::getInstance()->isOptionChecked(MenuOption::ToggleHipsFollowing)); From 5d89ed2a815b89a34256ebcbdd2b96445b83dec0 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Mon, 17 Dec 2018 13:46:55 -0800 Subject: [PATCH 2/4] matching master --- interface/src/Application.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 36fb666f69..7663f51fbd 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5272,12 +5272,7 @@ void Application::resumeAfterLoginDialogActionTaken() { nodeList->getDomainHandler().resetting(); if (!accountManager->isLoggedIn()) { - if (arguments().contains("--url")) { - auto reply = SandboxUtils::getStatus(); - connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); }); - } else { - addressManager->goToEntry(); - } + addressManager->goToEntry(); } else { QVariant testProperty = property(hifi::properties::TEST); if (testProperty.isValid()) { @@ -5290,8 +5285,7 @@ void Application::resumeAfterLoginDialogActionTaken() { connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); }); } } else { - auto reply = SandboxUtils::getStatus(); - connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); }); + addressManager->loadSettings(); } } From 816733b55fe48fbc79e4d4e5e112aadc657ac090 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Mon, 17 Dec 2018 16:47:11 -0800 Subject: [PATCH 3/4] reverting to master --- interface/src/Application.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 7663f51fbd..447770b608 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5272,7 +5272,14 @@ void Application::resumeAfterLoginDialogActionTaken() { nodeList->getDomainHandler().resetting(); if (!accountManager->isLoggedIn()) { - addressManager->goToEntry(); + if (arguments().contains("--url")) { + addressManager->goToEntry(); + auto reply = SandboxUtils::getStatus(); + connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); }); + } + else { + addressManager->goToEntry(); + } } else { QVariant testProperty = property(hifi::properties::TEST); if (testProperty.isValid()) { @@ -5285,7 +5292,8 @@ void Application::resumeAfterLoginDialogActionTaken() { connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); }); } } else { - addressManager->loadSettings(); + auto reply = SandboxUtils::getStatus(); + connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); });; } } From 50902080ce9bfeb28bee9e7a3769cc017d7adef0 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Mon, 17 Dec 2018 16:48:02 -0800 Subject: [PATCH 4/4] fixing typos --- interface/src/Application.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 447770b608..36fb666f69 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5273,11 +5273,9 @@ void Application::resumeAfterLoginDialogActionTaken() { if (!accountManager->isLoggedIn()) { if (arguments().contains("--url")) { - addressManager->goToEntry(); auto reply = SandboxUtils::getStatus(); connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); }); - } - else { + } else { addressManager->goToEntry(); } } else { @@ -5293,7 +5291,7 @@ void Application::resumeAfterLoginDialogActionTaken() { } } else { auto reply = SandboxUtils::getStatus(); - connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); });; + connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); }); } }