History

Merge branch 'master' of https://github.com/highfidelity/hifi into 19561

Thijs Wenker committed 12 years ago

Commit 23068b02 parents c016d65 b9dd27623 files · +880 −595Browse files

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

Unified · Split

interface/src/Application.cpp+43−1
@@ -356,6 +356,8 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 355 unmodified lines
356 QMutexLocker locker(&_settingsMutex);356 QMutexLocker locker(&_settingsMutex);
357 _previousScriptLocation = _settings->value("LastScriptLocation", QVariant("")).toString();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
361Application::~Application() {363Application::~Application() {
@@ -821,6 +823,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 459 unmodified lines
821 break;823 break;
822 824
823 case Qt::Key_E:825 case Qt::Key_E:
826 case Qt::Key_PageUp:
824 if (!_myAvatar->getDriveKeys(UP)) {827 if (!_myAvatar->getDriveKeys(UP)) {
825 _myAvatar->jump();828 _myAvatar->jump();
826 }829 }
@@ -832,6 +835,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 5 unmodified lines
832 break;835 break;
833 836
834 case Qt::Key_C:837 case Qt::Key_C:
838 case Qt::Key_PageDown:
835 _myAvatar->setDriveKeys(DOWN, 1.f);839 _myAvatar->setDriveKeys(DOWN, 1.f);
836 break;840 break;
837 841
@@ -1020,10 +1024,12 @@ void Application::keyReleaseEvent(QKeyEvent* event) { · 182 unmodified lines
1020 1024
1021 switch (event->key()) {1025 switch (event->key()) {
1022 case Qt::Key_E:1026 case Qt::Key_E:
1027 case Qt::Key_PageUp:
1023 _myAvatar->setDriveKeys(UP, 0.f);1028 _myAvatar->setDriveKeys(UP, 0.f);
1024 break;1029 break;
1025 1030
1026 case Qt::Key_C:1031 case Qt::Key_C:
1032 case Qt::Key_PageDown:
1027 _myAvatar->setDriveKeys(DOWN, 0.f);1033 _myAvatar->setDriveKeys(DOWN, 0.f);
1028 break;1034 break;
1029 1035
@@ -2735,7 +2741,7 @@ void Application::displayOverlay() { · 1705 unmodified lines
2735 (Menu::getInstance()->isOptionChecked(MenuOption::Stats) &&2741 (Menu::getInstance()->isOptionChecked(MenuOption::Stats) &&
2736 Menu::getInstance()->isOptionChecked(MenuOption::Bandwidth))2742 Menu::getInstance()->isOptionChecked(MenuOption::Bandwidth))
2737 ? 80 : 20;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 _overlays.render2D();2747 _overlays.render2D();
@@ -3027,6 +3033,7 @@ void Application::resetSensors() { · 285 unmodified lines
3027 _mouseX = _glWidget->width() / 2;3033 _mouseX = _glWidget->width() / 2;
3028 _mouseY = _glWidget->height() / 2;3034 _mouseY = _glWidget->height() / 2;
3029 3035
3036 _faceplus.reset();
3030 _faceshift.reset();3037 _faceshift.reset();
3031 _visage.reset();3038 _visage.reset();
3032 3039
@@ -3576,3 +3583,38 @@ void Application::takeSnapshot() { · 543 unmodified lines
3576 3583
3577 Snapshot::saveSnapshot(_glWidget, _myAvatar);3584 Snapshot::saveSnapshot(_glWidget, _myAvatar);
3578}3585}
3586
3587void 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}

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