Showing the changes to interface/src/Application.cpp (1 of 23 files). Show all
Unified · Split
| @@ -356,6 +356,8 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 355 unmodified lines | ||
| 356 | 356 | QMutexLocker locker(&_settingsMutex); |
| 357 | 357 | _previousScriptLocation = _settings->value("LastScriptLocation", QVariant("")).toString(); |
| 358 | 358 | } |
| 359 | + //When -url in command line, teleport to location | |
| 360 | + urlGoTo(argc, constArgv); | |
| 359 | 361 | } |
| 360 | 362 | |
| 361 | 363 | Application::~Application() { |
| @@ -821,6 +823,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 459 unmodified lines | ||
| 821 | 823 | break; |
| 822 | 824 | |
| 823 | 825 | case Qt::Key_E: |
| 826 | + case Qt::Key_PageUp: | |
| 824 | 827 | if (!_myAvatar->getDriveKeys(UP)) { |
| 825 | 828 | _myAvatar->jump(); |
| 826 | 829 | } |
| @@ -832,6 +835,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 5 unmodified lines | ||
| 832 | 835 | break; |
| 833 | 836 | |
| 834 | 837 | case Qt::Key_C: |
| 838 | + case Qt::Key_PageDown: | |
| 835 | 839 | _myAvatar->setDriveKeys(DOWN, 1.f); |
| 836 | 840 | break; |
| 837 | 841 | |
| @@ -1020,10 +1024,12 @@ void Application::keyReleaseEvent(QKeyEvent* event) { · 182 unmodified lines | ||
| 1020 | 1024 | |
| 1021 | 1025 | switch (event->key()) { |
| 1022 | 1026 | case Qt::Key_E: |
| 1027 | + case Qt::Key_PageUp: | |
| 1023 | 1028 | _myAvatar->setDriveKeys(UP, 0.f); |
| 1024 | 1029 | break; |
| 1025 | 1030 | |
| 1026 | 1031 | case Qt::Key_C: |
| 1032 | + case Qt::Key_PageDown: | |
| 1027 | 1033 | _myAvatar->setDriveKeys(DOWN, 0.f); |
| 1028 | 1034 | break; |
| 1029 | 1035 | |
| @@ -2735,7 +2741,7 @@ void Application::displayOverlay() { · 1705 unmodified lines | ||
| 2735 | 2741 | (Menu::getInstance()->isOptionChecked(MenuOption::Stats) && |
| 2736 | 2742 | Menu::getInstance()->isOptionChecked(MenuOption::Bandwidth)) |
| 2737 | 2743 | ? 80 : 20; |
| 2738 | − drawText(_glWidget->width() - 100, _glWidget->height() - timerBottom, 0.30f, 1.0f, 0.f, frameTimer, WHITE_TEXT); | |
| 2744 | + drawText(_glWidget->width() - 100, _glWidget->height() - timerBottom, 0.30f, 0.0f, 0, frameTimer, WHITE_TEXT); | |
| 2739 | 2745 | } |
| 2740 | 2746 | |
| 2741 | 2747 | _overlays.render2D(); |
| @@ -3027,6 +3033,7 @@ void Application::resetSensors() { · 285 unmodified lines | ||
| 3027 | 3033 | _mouseX = _glWidget->width() / 2; |
| 3028 | 3034 | _mouseY = _glWidget->height() / 2; |
| 3029 | 3035 | |
| 3036 | + _faceplus.reset(); | |
| 3030 | 3037 | _faceshift.reset(); |
| 3031 | 3038 | _visage.reset(); |
| 3032 | 3039 | |
| @@ -3576,3 +3583,38 @@ void Application::takeSnapshot() { · 543 unmodified lines | ||
| 3576 | 3583 | |
| 3577 | 3584 | Snapshot::saveSnapshot(_glWidget, _myAvatar); |
| 3578 | 3585 | } |
| 3586 | + | |
| 3587 | +void Application::urlGoTo(int argc, const char * constArgv[]) { | |
| 3588 | + //Gets the url (hifi://domain/destination/orientation) | |
| 3589 | + QString customUrl = getCmdOption(argc, constArgv, "-url"); | |
| 3590 | + | |
| 3591 | + if (customUrl.startsWith("hifi://")) { | |
| 3592 | + QStringList urlParts = customUrl.remove(0, CUSTOM_URL_SCHEME.length() + 2).split('/', QString::SkipEmptyParts); | |
| 3593 | + if (urlParts.count() > 1) { | |
| 3594 | + // if url has 2 or more parts, the first one is domain name | |
| 3595 | + QString domain = urlParts[0]; | |
| 3596 | + | |
| 3597 | + // second part is either a destination coordinate or | |
| 3598 | + // a place name | |
| 3599 | + QString destination = urlParts[1]; | |
| 3600 | + | |
| 3601 | + // any third part is an avatar orientation. | |
| 3602 | + QString orientation = urlParts.count() > 2 ? urlParts[2] : QString(); | |
| 3603 | + | |
| 3604 | + Menu::goToDomain(domain); | |
| 3605 | + | |
| 3606 | + // goto either @user, #place, or x-xx,y-yy,z-zz | |
| 3607 | + // style co-ordinate. | |
| 3608 | + Menu::goTo(destination); | |
| 3609 | + | |
| 3610 | + if (!orientation.isEmpty()) { | |
| 3611 | + // location orientation | |
| 3612 | + Menu::goToOrientation(orientation); | |
| 3613 | + } | |
| 3614 | + } else if (urlParts.count() == 1) { | |
| 3615 | + // location coordinates or place name | |
| 3616 | + QString destination = urlParts[0]; | |
| 3617 | + Menu::goTo(destination); | |
| 3618 | + } | |
| 3619 | + } | |
| 3620 | +} | |