Showing the changes to interface/src/Application.cpp (1 of 92 files). Show all
Unified · Split
| @@ -70,7 +70,7 @@ · 69 unmodified lines | ||
| 70 | 70 | #include <EntityScriptClient.h> |
| 71 | 71 | #include <EntityScriptServerLogClient.h> |
| 72 | 72 | #include <EntityScriptingInterface.h> |
| 73 | −#include <HoverOverlayInterface.h> | |
| 73 | +#include "ui/overlays/ContextOverlayInterface.h" | |
| 74 | 74 | #include <ErrorDialog.h> |
| 75 | 75 | #include <FileScriptingInterface.h> |
| 76 | 76 | #include <Finally.h> |
| @@ -595,7 +595,7 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 518 unmodified lines | ||
| 595 | 595 | DependencyManager::set<Snapshot>(); |
| 596 | 596 | DependencyManager::set<CloseEventSender>(); |
| 597 | 597 | DependencyManager::set<ResourceManager>(); |
| 598 | − DependencyManager::set<HoverOverlayInterface>(); | |
| 598 | + DependencyManager::set<ContextOverlayInterface>(); | |
| 599 | 599 | |
| 600 | 600 | return previousSessionCrashed; |
| 601 | 601 | } |
| @@ -1324,12 +1324,16 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 722 unmodified lines | ||
| 1324 | 1324 | // Keyboard focus handling for Web overlays. |
| 1325 | 1325 | auto overlays = &(qApp->getOverlays()); |
| 1326 | 1326 | |
| 1327 | − connect(overlays, &Overlays::mousePressOnOverlay, [=](OverlayID overlayID, const PointerEvent& event) { | |
| 1328 | − setKeyboardFocusEntity(UNKNOWN_ENTITY_ID); | |
| 1329 | − setKeyboardFocusOverlay(overlayID); | |
| 1327 | + connect(overlays, &Overlays::mousePressOnOverlay, [=](const OverlayID& overlayID, const PointerEvent& event) { | |
| 1328 | + auto thisOverlay = std::dynamic_pointer_cast<Web3DOverlay>(overlays->getOverlay(overlayID)); | |
| 1329 | + // Only Web overlays can have keyboard focus. | |
| 1330 | + if (thisOverlay) { | |
| 1331 | + setKeyboardFocusEntity(UNKNOWN_ENTITY_ID); | |
| 1332 | + setKeyboardFocusOverlay(overlayID); | |
| 1333 | + } | |
| 1330 | 1334 | }); |
| 1331 | 1335 | |
| 1332 | − connect(overlays, &Overlays::overlayDeleted, [=](OverlayID overlayID) { | |
| 1336 | + connect(overlays, &Overlays::overlayDeleted, [=](const OverlayID& overlayID) { | |
| 1333 | 1337 | if (overlayID == _keyboardFocusedOverlay.get()) { |
| 1334 | 1338 | setKeyboardFocusOverlay(UNKNOWN_OVERLAY_ID); |
| 1335 | 1339 | } |
| @@ -1344,6 +1348,21 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 8 unmodified lines | ||
| 1344 | 1348 | setKeyboardFocusEntity(UNKNOWN_ENTITY_ID); |
| 1345 | 1349 | }); |
| 1346 | 1350 | |
| 1351 | + connect(overlays, | |
| 1352 | + SIGNAL(mousePressOnOverlay(const OverlayID&, const PointerEvent&)), | |
| 1353 | + DependencyManager::get<ContextOverlayInterface>().data(), | |
| 1354 | + SLOT(contextOverlays_mousePressOnOverlay(const OverlayID&, const PointerEvent&))); | |
| 1355 | + | |
| 1356 | + connect(overlays, | |
| 1357 | + SIGNAL(hoverEnterOverlay(const OverlayID&, const PointerEvent&)), | |
| 1358 | + DependencyManager::get<ContextOverlayInterface>().data(), | |
| 1359 | + SLOT(contextOverlays_hoverEnterOverlay(const OverlayID&, const PointerEvent&))); | |
| 1360 | + | |
| 1361 | + connect(overlays, | |
| 1362 | + SIGNAL(hoverLeaveOverlay(const OverlayID&, const PointerEvent&)), | |
| 1363 | + DependencyManager::get<ContextOverlayInterface>().data(), | |
| 1364 | + SLOT(contextOverlays_hoverLeaveOverlay(const OverlayID&, const PointerEvent&))); | |
| 1365 | + | |
| 1347 | 1366 | // Add periodic checks to send user activity data |
| 1348 | 1367 | static int CHECK_NEARBY_AVATARS_INTERVAL_MS = 10000; |
| 1349 | 1368 | static int NEARBY_AVATAR_RADIUS_METERS = 10; |
| @@ -1470,7 +1489,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 120 unmodified lines | ||
| 1470 | 1489 | properties["atp_mapping_requests"] = atpMappingRequests; |
| 1471 | 1490 | |
| 1472 | 1491 | properties["throttled"] = _displayPlugin ? _displayPlugin->isThrottled() : false; |
| 1473 | − | |
| 1492 | + | |
| 1474 | 1493 | QJsonObject bytesDownloaded; |
| 1475 | 1494 | bytesDownloaded["atp"] = statTracker->getStat(STAT_ATP_RESOURCE_TOTAL_BYTES).toInt(); |
| 1476 | 1495 | bytesDownloaded["http"] = statTracker->getStat(STAT_HTTP_RESOURCE_TOTAL_BYTES).toInt(); |
| @@ -2131,7 +2150,7 @@ void Application::initializeUi() { · 654 unmodified lines | ||
| 2131 | 2150 | surfaceContext->setContextProperty("ApplicationCompositor", &getApplicationCompositor()); |
| 2132 | 2151 | |
| 2133 | 2152 | surfaceContext->setContextProperty("AvatarInputs", AvatarInputs::getInstance()); |
| 2134 | − surfaceContext->setContextProperty("HoverOverlay", DependencyManager::get<HoverOverlayInterface>().data()); | |
| 2153 | + surfaceContext->setContextProperty("ContextOverlay", DependencyManager::get<ContextOverlayInterface>().data()); | |
| 2135 | 2154 | |
| 2136 | 2155 | if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) { |
| 2137 | 2156 | surfaceContext->setContextProperty("Steam", new SteamScriptingInterface(engine, steamClient.get())); |
| @@ -2323,7 +2342,7 @@ void Application::paintGL() { · 185 unmodified lines | ||
| 2323 | 2342 | } |
| 2324 | 2343 | } else if (_myCamera.getMode() == CAMERA_MODE_MIRROR) { |
| 2325 | 2344 | if (isHMDMode()) { |
| 2326 | − auto mirrorBodyOrientation = myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI + _rotateMirror, 0.0f)); | |
| 2345 | + auto mirrorBodyOrientation = myAvatar->getOrientation() * glm::quat(glm::vec3(0.0f, PI + _rotateMirror, 0.0f)); | |
| 2327 | 2346 | |
| 2328 | 2347 | glm::quat hmdRotation = extractRotation(myAvatar->getHMDSensorMatrix()); |
| 2329 | 2348 | // Mirror HMD yaw and roll |
| @@ -2345,7 +2364,7 @@ void Application::paintGL() { · 15 unmodified lines | ||
| 2345 | 2364 | + mirrorBodyOrientation * glm::vec3(0.0f, 0.0f, 1.0f) * MIRROR_FULLSCREEN_DISTANCE * _scaleMirror |
| 2346 | 2365 | + mirrorBodyOrientation * hmdOffset); |
| 2347 | 2366 | } else { |
| 2348 | − _myCamera.setOrientation(myAvatar->getWorldAlignedOrientation() | |
| 2367 | + _myCamera.setOrientation(myAvatar->getOrientation() | |
| 2349 | 2368 | * glm::quat(glm::vec3(0.0f, PI + _rotateMirror, 0.0f))); |
| 2350 | 2369 | _myCamera.setPosition(myAvatar->getDefaultEyePosition() |
| 2351 | 2370 | + glm::vec3(0, _raiseMirror * myAvatar->getUniformScale(), 0) |
| @@ -4482,11 +4501,9 @@ void Application::cameraModeChanged() { · 2130 unmodified lines | ||
| 4482 | 4501 | void Application::cameraMenuChanged() { |
| 4483 | 4502 | auto menu = Menu::getInstance(); |
| 4484 | 4503 | if (menu->isOptionChecked(MenuOption::FullscreenMirror)) { |
| 4485 | − if (isHMDMode()) { | |
| 4486 | − menu->setIsOptionChecked(MenuOption::FullscreenMirror, false); | |
| 4487 | − menu->setIsOptionChecked(MenuOption::FirstPerson, true); | |
| 4488 | − } else if (_myCamera.getMode() != CAMERA_MODE_MIRROR) { | |
| 4504 | + if (_myCamera.getMode() != CAMERA_MODE_MIRROR) { | |
| 4489 | 4505 | _myCamera.setMode(CAMERA_MODE_MIRROR); |
| 4506 | + getMyAvatar()->reset(false, false, false); // to reset any active MyAvatar::FollowHelpers | |
| 4490 | 4507 | } |
| 4491 | 4508 | } else if (menu->isOptionChecked(MenuOption::FirstPerson)) { |
| 4492 | 4509 | if (_myCamera.getMode() != CAMERA_MODE_FIRST_PERSON) { |
| @@ -5422,6 +5439,17 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se · 929 unmodified lines | ||
| 5422 | 5439 | } |
| 5423 | 5440 | renderArgs->_debugFlags = renderDebugFlags; |
| 5424 | 5441 | //ViveControllerManager::getInstance().updateRendering(renderArgs, _main3DScene, transaction); |
| 5442 | + | |
| 5443 | + RenderArgs::OutlineFlags renderOutlineFlags = RenderArgs::RENDER_OUTLINE_NONE; | |
| 5444 | + auto contextOverlayInterface = DependencyManager::get<ContextOverlayInterface>(); | |
| 5445 | + if (contextOverlayInterface->getEnabled()) { | |
| 5446 | + if (DependencyManager::get<ContextOverlayInterface>()->getIsInMarketplaceInspectionMode()) { | |
| 5447 | + renderOutlineFlags = RenderArgs::RENDER_OUTLINE_MARKETPLACE_MODE; | |
| 5448 | + } else { | |
| 5449 | + renderOutlineFlags = RenderArgs::RENDER_OUTLINE_WIREFRAMES; | |
| 5450 | + } | |
| 5451 | + } | |
| 5452 | + renderArgs->_outlineFlags = renderOutlineFlags; | |
| 5425 | 5453 | } |
| 5426 | 5454 | } |
| 5427 | 5455 | |
| @@ -5885,7 +5913,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 457 unmodified lines | ||
| 5885 | 5913 | auto entityScriptServerLog = DependencyManager::get<EntityScriptServerLogClient>(); |
| 5886 | 5914 | scriptEngine->registerGlobalObject("EntityScriptServerLog", entityScriptServerLog.data()); |
| 5887 | 5915 | scriptEngine->registerGlobalObject("AvatarInputs", AvatarInputs::getInstance()); |
| 5888 | − scriptEngine->registerGlobalObject("HoverOverlay", DependencyManager::get<HoverOverlayInterface>().data()); | |
| 5916 | + scriptEngine->registerGlobalObject("ContextOverlay", DependencyManager::get<ContextOverlayInterface>().data()); | |
| 5889 | 5917 | |
| 5890 | 5918 | qScriptRegisterMetaType(scriptEngine, OverlayIDtoScriptValue, OverlayIDfromScriptValue); |
| 5891 | 5919 | |