Showing the changes to interface/src/Application.cpp (1 of 11 files). Show all
Unified · Split
| @@ -47,6 +47,7 @@ · 46 unmodified lines | ||
| 47 | 47 | #include <QDesktopServices> |
| 48 | 48 | #include <QXmlStreamReader> |
| 49 | 49 | #include <QXmlStreamAttributes> |
| 50 | +#include <QMediaPlayer> | |
| 50 | 51 | |
| 51 | 52 | #include <AudioInjector.h> |
| 52 | 53 | #include <NodeTypes.h> |
| @@ -70,6 +71,7 @@ · 17 unmodified lines | ||
| 70 | 71 | #include "renderer/ProgramObject.h" |
| 71 | 72 | #include "ui/TextRenderer.h" |
| 72 | 73 | #include "InfoView.h" |
| 74 | +#include "ui/Snapshot.h" | |
| 73 | 75 | |
| 74 | 76 | using namespace std; |
| 75 | 77 | |
| @@ -773,6 +775,8 @@ void Application::keyPressEvent(QKeyEvent* event) { · 697 unmodified lines | ||
| 773 | 775 | _voxels.collectStatsForTreesAndVBOs(); |
| 774 | 776 | } else if (isShifted && isMeta) { |
| 775 | 777 | Menu::getInstance()->triggerOption(MenuOption::SuppressShortTimings); |
| 778 | + } else if (!isShifted && isMeta) { | |
| 779 | + takeSnapshot(); | |
| 776 | 780 | } else if (_nudgeStarted) { |
| 777 | 781 | if (_lookingAlongX) { |
| 778 | 782 | if (_lookingAwayFromOrigin) { |
| @@ -4346,3 +4350,14 @@ void Application::skipVersion(QString latestVersion) { · 3567 unmodified lines | ||
| 4346 | 4350 | skipFile.seek(0); |
| 4347 | 4351 | skipFile.write(latestVersion.toStdString().c_str()); |
| 4348 | 4352 | } |
| 4353 | + | |
| 4354 | +void Application::takeSnapshot() { | |
| 4355 | + switchToResourcesParentIfRequired(); | |
| 4356 | + QMediaPlayer* player = new QMediaPlayer(); | |
| 4357 | + QFileInfo inf = QFileInfo("resources/sounds/snap.wav"); | |
| 4358 | + player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath())); | |
| 4359 | + player->play(); | |
| 4360 | + | |
| 4361 | + Snapshot::saveSnapshot(_glWidget, _profile.getUsername(), _myAvatar.getPosition()); | |
| 4362 | +} | |
| 4363 | + | |