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
356356 QMutexLocker locker(&_settingsMutex);
357357 _previousScriptLocation = _settings->value("LastScriptLocation", QVariant("")).toString();
358358 }
359+ //When -url in command line, teleport to location
360+ urlGoTo(argc, constArgv);
359361 }
360362
361363 Application::~Application() {
@@ -821,6 +823,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 459 unmodified lines
821823 break;
822824
823825 case Qt::Key_E:
826+ case Qt::Key_PageUp:
824827 if (!_myAvatar->getDriveKeys(UP)) {
825828 _myAvatar->jump();
826829 }
@@ -832,6 +835,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 5 unmodified lines
832835 break;
833836
834837 case Qt::Key_C:
838+ case Qt::Key_PageDown:
835839 _myAvatar->setDriveKeys(DOWN, 1.f);
836840 break;
837841
@@ -1020,10 +1024,12 @@ void Application::keyReleaseEvent(QKeyEvent* event) { · 182 unmodified lines
10201024
10211025 switch (event->key()) {
10221026 case Qt::Key_E:
1027+ case Qt::Key_PageUp:
10231028 _myAvatar->setDriveKeys(UP, 0.f);
10241029 break;
10251030
10261031 case Qt::Key_C:
1032+ case Qt::Key_PageDown:
10271033 _myAvatar->setDriveKeys(DOWN, 0.f);
10281034 break;
10291035
@@ -2735,7 +2741,7 @@ void Application::displayOverlay() { · 1705 unmodified lines
27352741 (Menu::getInstance()->isOptionChecked(MenuOption::Stats) &&
27362742 Menu::getInstance()->isOptionChecked(MenuOption::Bandwidth))
27372743 ? 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);
27392745 }
27402746
27412747 _overlays.render2D();
@@ -3027,6 +3033,7 @@ void Application::resetSensors() { · 285 unmodified lines
30273033 _mouseX = _glWidget->width() / 2;
30283034 _mouseY = _glWidget->height() / 2;
30293035
3036+ _faceplus.reset();
30303037 _faceshift.reset();
30313038 _visage.reset();
30323039
@@ -3576,3 +3583,38 @@ void Application::takeSnapshot() { · 543 unmodified lines
35763583
35773584 Snapshot::saveSnapshot(_glWidget, _myAvatar);
35783585 }
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+}

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