History

Merge remote-tracking branch 'upstream/master' into RunningScripts

Ryan Huffman committed 12 years ago

Commit edcff0b2 parents f889cef a934ffb45 files · +1654 −425Browse files

Showing the changes to interface/src/Application.cpp (1 of 45 files). Show all

Unified · Split

interface/src/Application.cpp+15−13
@@ -317,6 +317,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 316 unmodified lines
317317 Particle::setVoxelEditPacketSender(&_voxelEditSender);
318318 Particle::setParticleEditPacketSender(&_particleEditSender);
319319
320+ // when -url in command line, teleport to location
321+ urlGoTo(argc, constArgv);
322+
320323 // For now we're going to set the PPS for outbound packets to be super high, this is
321324 // probably not the right long term solution. But for now, we're going to do this to
322325 // allow you to move a particle around in your hand
@@ -865,7 +868,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 542 unmodified lines
865868
866869 case Qt::Key_G:
867870 if (isShifted) {
868− Menu::getInstance()->triggerOption(MenuOption::Gravity);
871+ Menu::getInstance()->triggerOption(MenuOption::ObeyEnvironmentalGravity);
869872 }
870873 break;
871874
@@ -3578,34 +3581,33 @@ void Application::takeSnapshot() { · 2706 unmodified lines
35783581 void Application::urlGoTo(int argc, const char * constArgv[]) {
35793582 //Gets the url (hifi://domain/destination/orientation)
35803583 QString customUrl = getCmdOption(argc, constArgv, "-url");
3581−
3582− if (customUrl.startsWith("hifi://")) {
3584+ if(customUrl.startsWith(CUSTOM_URL_SCHEME + "//")) {
35833585 QStringList urlParts = customUrl.remove(0, CUSTOM_URL_SCHEME.length() + 2).split('/', QString::SkipEmptyParts);
3584− if (urlParts.count() > 1) {
3586+ if (urlParts.count() == 1) {
3587+ // location coordinates or place name
3588+ QString domain = urlParts[0];
3589+ Menu::goToDomain(domain);
3590+ } else if (urlParts.count() > 1) {
35853591 // if url has 2 or more parts, the first one is domain name
35863592 QString domain = urlParts[0];
3587−
3593+
35883594 // second part is either a destination coordinate or
35893595 // a place name
35903596 QString destination = urlParts[1];
3591−
3597+
35923598 // any third part is an avatar orientation.
35933599 QString orientation = urlParts.count() > 2 ? urlParts[2] : QString();
3594−
3600+
35953601 Menu::goToDomain(domain);
35963602
35973603 // goto either @user, #place, or x-xx,y-yy,z-zz
35983604 // style co-ordinate.
35993605 Menu::goTo(destination);
3600−
3606+
36013607 if (!orientation.isEmpty()) {
36023608 // location orientation
36033609 Menu::goToOrientation(orientation);
36043610 }
3605− } else if (urlParts.count() == 1) {
3606− // location coordinates or place name
3607− QString destination = urlParts[0];
3608− Menu::goTo(destination);
3609− }
3611+ }
36103612 }
36113613 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t