mirror of
https://github.com/JulianGro/overte.git
synced 2025-05-07 12:39:55 +02:00
commit
8e1577d3d3
3 changed files with 18 additions and 15 deletions
|
@ -2830,6 +2830,17 @@ void Application::keyPressEvent(QKeyEvent* event) {
|
||||||
if (isShifted && isMeta && !isOption) {
|
if (isShifted && isMeta && !isOption) {
|
||||||
Menu::getInstance()->triggerOption(MenuOption::SuppressShortTimings);
|
Menu::getInstance()->triggerOption(MenuOption::SuppressShortTimings);
|
||||||
} else if (!isOption && !isShifted && isMeta) {
|
} else if (!isOption && !isShifted && isMeta) {
|
||||||
|
AudioInjectorOptions options;
|
||||||
|
options.localOnly = true;
|
||||||
|
options.stereo = true;
|
||||||
|
|
||||||
|
if (_snapshotSoundInjector) {
|
||||||
|
_snapshotSoundInjector->setOptions(options);
|
||||||
|
_snapshotSoundInjector->restart();
|
||||||
|
} else {
|
||||||
|
QByteArray samples = _snapshotSound->getByteArray();
|
||||||
|
_snapshotSoundInjector = AudioInjector::playSound(samples, options);
|
||||||
|
}
|
||||||
takeSnapshot(true);
|
takeSnapshot(true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -6362,21 +6373,6 @@ void Application::loadAddAvatarBookmarkDialog() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio) {
|
void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRatio) {
|
||||||
|
|
||||||
//keep sound thread out of event loop scope
|
|
||||||
|
|
||||||
AudioInjectorOptions options;
|
|
||||||
options.localOnly = true;
|
|
||||||
options.stereo = true;
|
|
||||||
|
|
||||||
if (_snapshotSoundInjector) {
|
|
||||||
_snapshotSoundInjector->setOptions(options);
|
|
||||||
_snapshotSoundInjector->restart();
|
|
||||||
} else {
|
|
||||||
QByteArray samples = _snapshotSound->getByteArray();
|
|
||||||
_snapshotSoundInjector = AudioInjector::playSound(samples, options);
|
|
||||||
}
|
|
||||||
|
|
||||||
postLambdaEvent([notify, includeAnimated, aspectRatio, this] {
|
postLambdaEvent([notify, includeAnimated, aspectRatio, this] {
|
||||||
// Get a screenshot and save it
|
// Get a screenshot and save it
|
||||||
QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio));
|
QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio));
|
||||||
|
|
Binary file not shown.
|
@ -410,8 +410,15 @@ function takeSnapshot() {
|
||||||
Menu.setIsOptionChecked("Overlays", false);
|
Menu.setIsOptionChecked("Overlays", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var snapActivateSound = SoundCache.getSound(Script.resolvePath("../../resources/sounds/snap.wav"));
|
||||||
|
|
||||||
// take snapshot (with no notification)
|
// take snapshot (with no notification)
|
||||||
Script.setTimeout(function () {
|
Script.setTimeout(function () {
|
||||||
|
Audio.playSound(snapActivateSound, {
|
||||||
|
position: { x: MyAvatar.position.x, y: MyAvatar.position.y, z: MyAvatar.position.z },
|
||||||
|
localOnly: true,
|
||||||
|
volume: 1.0
|
||||||
|
});
|
||||||
HMD.closeTablet();
|
HMD.closeTablet();
|
||||||
Script.setTimeout(function () {
|
Script.setTimeout(function () {
|
||||||
Window.takeSnapshot(false, includeAnimated, 1.91);
|
Window.takeSnapshot(false, includeAnimated, 1.91);
|
||||||
|
|
Loading…
Reference in a new issue