Showing the changes to interface/src/Application.cpp (1 of 8 files). Show all
Unified · Split
| @@ -316,6 +316,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 315 unmodified lines | ||
| 316 | 316 | Particle::setVoxelEditPacketSender(&_voxelEditSender); |
| 317 | 317 | Particle::setParticleEditPacketSender(&_particleEditSender); |
| 318 | 318 | |
| 319 | + // when -url in command line, teleport to location | |
| 320 | + urlGoTo(argc, constArgv); | |
| 321 | + | |
| 319 | 322 | // For now we're going to set the PPS for outbound packets to be super high, this is |
| 320 | 323 | // probably not the right long term solution. But for now, we're going to do this to |
| 321 | 324 | // allow you to move a particle around in your hand |
| @@ -352,8 +355,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 30 unmodified lines | ||
| 352 | 355 | QMutexLocker locker(&_settingsMutex); |
| 353 | 356 | _previousScriptLocation = _settings->value("LastScriptLocation", QVariant("")).toString(); |
| 354 | 357 | } |
| 355 | − //When -url in command line, teleport to location | |
| 356 | − urlGoTo(argc, constArgv); | |
| 357 | 358 | } |
| 358 | 359 | |
| 359 | 360 | Application::~Application() { |
| @@ -3583,34 +3584,33 @@ void Application::takeSnapshot() { · 3223 unmodified lines | ||
| 3583 | 3584 | void Application::urlGoTo(int argc, const char * constArgv[]) { |
| 3584 | 3585 | //Gets the url (hifi://domain/destination/orientation) |
| 3585 | 3586 | QString customUrl = getCmdOption(argc, constArgv, "-url"); |
| 3586 | − | |
| 3587 | − if (customUrl.startsWith("hifi://")) { | |
| 3587 | + if(customUrl.startsWith(CUSTOM_URL_SCHEME + "//")) { | |
| 3588 | 3588 | QStringList urlParts = customUrl.remove(0, CUSTOM_URL_SCHEME.length() + 2).split('/', QString::SkipEmptyParts); |
| 3589 | − if (urlParts.count() > 1) { | |
| 3589 | + if (urlParts.count() == 1) { | |
| 3590 | + // location coordinates or place name | |
| 3591 | + QString domain = urlParts[0]; | |
| 3592 | + Menu::goToDomain(domain); | |
| 3593 | + } else if (urlParts.count() > 1) { | |
| 3590 | 3594 | // if url has 2 or more parts, the first one is domain name |
| 3591 | 3595 | QString domain = urlParts[0]; |
| 3592 | − | |
| 3596 | + | |
| 3593 | 3597 | // second part is either a destination coordinate or |
| 3594 | 3598 | // a place name |
| 3595 | 3599 | QString destination = urlParts[1]; |
| 3596 | − | |
| 3600 | + | |
| 3597 | 3601 | // any third part is an avatar orientation. |
| 3598 | 3602 | QString orientation = urlParts.count() > 2 ? urlParts[2] : QString(); |
| 3599 | − | |
| 3603 | + | |
| 3600 | 3604 | Menu::goToDomain(domain); |
| 3601 | − | |
| 3605 | + | |
| 3602 | 3606 | // goto either @user, #place, or x-xx,y-yy,z-zz |
| 3603 | 3607 | // style co-ordinate. |
| 3604 | 3608 | Menu::goTo(destination); |
| 3605 | − | |
| 3609 | + | |
| 3606 | 3610 | if (!orientation.isEmpty()) { |
| 3607 | 3611 | // location orientation |
| 3608 | 3612 | Menu::goToOrientation(orientation); |
| 3609 | 3613 | } |
| 3610 | − } else if (urlParts.count() == 1) { | |
| 3611 | − // location coordinates or place name | |
| 3612 | − QString destination = urlParts[0]; | |
| 3613 | − Menu::goTo(destination); | |
| 3614 | − } | |
| 3614 | + } | |
| 3615 | 3615 | } |
| 3616 | 3616 | } |