Showing the changes to interface/src/Application.cpp (1 of 59 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() { |
| @@ -1679,8 +1681,12 @@ void Application::init() { · 1317 unmodified lines | ||
| 1679 | 1681 | _audioReflector.setMyAvatar(getAvatar()); |
| 1680 | 1682 | _audioReflector.setVoxels(_voxels.getTree()); |
| 1681 | 1683 | _audioReflector.setAudio(getAudio()); |
| 1684 | + _audioReflector.setAvatarManager(&_avatarManager); | |
| 1685 | + | |
| 1682 | 1686 | connect(getAudio(), &Audio::processInboundAudio, &_audioReflector, &AudioReflector::processInboundAudio,Qt::DirectConnection); |
| 1683 | 1687 | connect(getAudio(), &Audio::processLocalAudio, &_audioReflector, &AudioReflector::processLocalAudio,Qt::DirectConnection); |
| 1688 | + connect(getAudio(), &Audio::preProcessOriginalInboundAudio, &_audioReflector, | |
| 1689 | + &AudioReflector::preProcessOriginalInboundAudio,Qt::DirectConnection); | |
| 1684 | 1690 | |
| 1685 | 1691 | // save settings when avatar changes |
| 1686 | 1692 | connect(_myAvatar, &MyAvatar::transformChanged, this, &Application::bumpSettings); |
| @@ -2728,7 +2734,7 @@ void Application::displayOverlay() { · 1041 unmodified lines | ||
| 2728 | 2734 | (Menu::getInstance()->isOptionChecked(MenuOption::Stats) && |
| 2729 | 2735 | Menu::getInstance()->isOptionChecked(MenuOption::Bandwidth)) |
| 2730 | 2736 | ? 80 : 20; |
| 2731 | − drawText(_glWidget->width() - 100, _glWidget->height() - timerBottom, 0.30f, 1.0f, 0.f, frameTimer, WHITE_TEXT); | |
| 2737 | + drawText(_glWidget->width() - 100, _glWidget->height() - timerBottom, 0.30f, 0.0f, 0, frameTimer, WHITE_TEXT); | |
| 2732 | 2738 | } |
| 2733 | 2739 | |
| 2734 | 2740 | _overlays.render2D(); |
| @@ -3020,6 +3026,7 @@ void Application::resetSensors() { · 285 unmodified lines | ||
| 3020 | 3026 | _mouseX = _glWidget->width() / 2; |
| 3021 | 3027 | _mouseY = _glWidget->height() / 2; |
| 3022 | 3028 | |
| 3029 | + _faceplus.reset(); | |
| 3023 | 3030 | _faceshift.reset(); |
| 3024 | 3031 | _visage.reset(); |
| 3025 | 3032 | |
| @@ -3397,6 +3404,7 @@ void Application::loadScript(const QString& scriptName) { · 371 unmodified lines | ||
| 3397 | 3404 | scriptEngine->registerGlobalObject("Menu", MenuScriptingInterface::getInstance()); |
| 3398 | 3405 | scriptEngine->registerGlobalObject("Settings", SettingsScriptingInterface::getInstance()); |
| 3399 | 3406 | scriptEngine->registerGlobalObject("AudioDevice", AudioDeviceScriptingInterface::getInstance()); |
| 3407 | + scriptEngine->registerGlobalObject("AnimationCache", &_animationCache); | |
| 3400 | 3408 | scriptEngine->registerGlobalObject("AudioReflector", &_audioReflector); |
| 3401 | 3409 | |
| 3402 | 3410 | QThread* workerThread = new QThread(this); |
| @@ -3570,3 +3578,38 @@ void Application::takeSnapshot() { · 167 unmodified lines | ||
| 3570 | 3578 | } |
| 3571 | 3579 | _snapshotShareDialog->exec(); |
| 3572 | 3580 | } |
| 3581 | + | |
| 3582 | +void Application::urlGoTo(int argc, const char * constArgv[]) { | |
| 3583 | + //Gets the url (hifi://domain/destination/orientation) | |
| 3584 | + QString customUrl = getCmdOption(argc, constArgv, "-url"); | |
| 3585 | + | |
| 3586 | + if (customUrl.startsWith("hifi://")) { | |
| 3587 | + QStringList urlParts = customUrl.remove(0, CUSTOM_URL_SCHEME.length() + 2).split('/', QString::SkipEmptyParts); | |
| 3588 | + if (urlParts.count() > 1) { | |
| 3589 | + // if url has 2 or more parts, the first one is domain name | |
| 3590 | + QString domain = urlParts[0]; | |
| 3591 | + | |
| 3592 | + // second part is either a destination coordinate or | |
| 3593 | + // a place name | |
| 3594 | + QString destination = urlParts[1]; | |
| 3595 | + | |
| 3596 | + // any third part is an avatar orientation. | |
| 3597 | + QString orientation = urlParts.count() > 2 ? urlParts[2] : QString(); | |
| 3598 | + | |
| 3599 | + Menu::goToDomain(domain); | |
| 3600 | + | |
| 3601 | + // goto either @user, #place, or x-xx,y-yy,z-zz | |
| 3602 | + // style co-ordinate. | |
| 3603 | + Menu::goTo(destination); | |
| 3604 | + | |
| 3605 | + if (!orientation.isEmpty()) { | |
| 3606 | + // location orientation | |
| 3607 | + Menu::goToOrientation(orientation); | |
| 3608 | + } | |
| 3609 | + } else if (urlParts.count() == 1) { | |
| 3610 | + // location coordinates or place name | |
| 3611 | + QString destination = urlParts[0]; | |
| 3612 | + Menu::goTo(destination); | |
| 3613 | + } | |
| 3614 | + } | |
| 3615 | +} | |