mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 19:21:16 +02:00
Removed sounds for tablet in and out, added sounds for stylus instead. Added logging for testing semi-pressed laser and keyboard sounds
This commit is contained in:
parent
b5f0c4d940
commit
1a2d38e31f
5 changed files with 13 additions and 19 deletions
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import TabletScriptingInterface 1.0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: keyItem
|
id: keyItem
|
||||||
|
@ -32,8 +33,15 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onHoveredChanged: {
|
||||||
|
if (hovered) {
|
||||||
|
tabletInterface.playSound(TabletEnums.ButtonHover)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
mouse.accepted = true;
|
mouse.accepted = true;
|
||||||
|
tabletInterface.playSound(TabletEnums.ButtonClick)
|
||||||
|
|
||||||
webEntity.synthesizeKeyPress(glyph);
|
webEntity.synthesizeKeyPress(glyph);
|
||||||
webEntity.synthesizeKeyPress(glyph, mirrorText);
|
webEntity.synthesizeKeyPress(glyph, mirrorText);
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
import Hifi 1.0
|
import Hifi 1.0
|
||||||
import QtQuick.Controls 1.4
|
import QtQuick.Controls 1.4
|
||||||
import TabletScriptingInterface 1.0
|
|
||||||
|
|
||||||
import "../../dialogs"
|
import "../../dialogs"
|
||||||
import "../../controls"
|
import "../../controls"
|
||||||
|
@ -147,7 +146,7 @@ Item {
|
||||||
SoundEffect {
|
SoundEffect {
|
||||||
id: buttonClickSound
|
id: buttonClickSound
|
||||||
volume: 0.1
|
volume: 0.1
|
||||||
source: ""
|
source: "../../../sounds/Gamemaster-Audio-button-click.wav"
|
||||||
}
|
}
|
||||||
|
|
||||||
function playButtonClickSound() {
|
function playButtonClickSound() {
|
||||||
|
|
|
@ -167,10 +167,6 @@ void Web3DOverlay::buildWebSurface() {
|
||||||
if (!self) {
|
if (!self) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto tabletScreenID = DependencyManager::get<HMDScriptingInterface>()->getCurrentTabletScreenID();
|
|
||||||
if (overlayID == tabletScreenID) { //play only on Tablet border crossing
|
|
||||||
DependencyManager::get<TabletScriptingInterface>()->playSound(TabletScriptingInterface::TabletHandsOut);
|
|
||||||
}
|
|
||||||
if (overlayID == selfOverlayID && (self->_pressed || (!self->_activeTouchPoints.empty() && self->_touchBeginAccepted))) {
|
if (overlayID == selfOverlayID && (self->_pressed || (!self->_activeTouchPoints.empty() && self->_touchBeginAccepted))) {
|
||||||
PointerEvent endEvent(PointerEvent::Release, event.getID(), event.getPos2D(), event.getPos3D(), event.getNormal(), event.getDirection(),
|
PointerEvent endEvent(PointerEvent::Release, event.getID(), event.getPos2D(), event.getPos3D(), event.getNormal(), event.getDirection(),
|
||||||
event.getButton(), event.getButtons(), event.getKeyboardModifiers());
|
event.getButton(), event.getButtons(), event.getKeyboardModifiers());
|
||||||
|
@ -178,19 +174,6 @@ void Web3DOverlay::buildWebSurface() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
QObject::connect(overlays, &Overlays::hoverEnterOverlay, this, [=](OverlayID overlayID, const PointerEvent& event) {
|
|
||||||
Q_UNUSED(event)
|
|
||||||
auto self = weakSelf.lock();
|
|
||||||
if (!self) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto tabletScreenID = DependencyManager::get<HMDScriptingInterface>()->getCurrentTabletScreenID();
|
|
||||||
if (overlayID == tabletScreenID) { //play only on Tablet border crossing
|
|
||||||
DependencyManager::get<TabletScriptingInterface>()->playSound(TabletScriptingInterface::TabletHandsIn);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
QObject::connect(this, &Web3DOverlay::scriptEventReceived, _webSurface.data(), &OffscreenQmlSurface::emitScriptEvent);
|
QObject::connect(this, &Web3DOverlay::scriptEventReceived, _webSurface.data(), &OffscreenQmlSurface::emitScriptEvent);
|
||||||
QObject::connect(_webSurface.data(), &OffscreenQmlSurface::webEventReceived, this, &Web3DOverlay::webEventReceived);
|
QObject::connect(_webSurface.data(), &OffscreenQmlSurface::webEventReceived, this, &Web3DOverlay::webEventReceived);
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,6 +93,7 @@ void TabletScriptingInterface::playSound(TabletAudioEvents aEvent) {
|
||||||
options.localOnly = options.localOnly || sound->isAmbisonic(); // force localOnly when Ambisonic
|
options.localOnly = options.localOnly || sound->isAmbisonic(); // force localOnly when Ambisonic
|
||||||
|
|
||||||
AudioInjectorPointer injector = AudioInjector::playSoundAndDelete(sound->getByteArray(), options);
|
AudioInjectorPointer injector = AudioInjector::playSoundAndDelete(sound->getByteArray(), options);
|
||||||
|
qDebug() << "playing sound for event" << aEvent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,6 +157,8 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tabletInterface.playSound(3);//HandsIn
|
||||||
|
|
||||||
var X_ROT_NEG_90 = { x: -0.70710678, y: 0, z: 0, w: 0.70710678 };
|
var X_ROT_NEG_90 = { x: -0.70710678, y: 0, z: 0, w: 0.70710678 };
|
||||||
var modelOrientation = Quat.multiply(this.stylusTip.orientation, X_ROT_NEG_90);
|
var modelOrientation = Quat.multiply(this.stylusTip.orientation, X_ROT_NEG_90);
|
||||||
var modelPositionOffset = Vec3.multiplyQbyV(modelOrientation, { x: 0, y: 0, z: MyAvatar.sensorToWorldScale * -WEB_STYLUS_LENGTH / 2 });
|
var modelPositionOffset = Vec3.multiplyQbyV(modelOrientation, { x: 0, y: 0, z: MyAvatar.sensorToWorldScale * -WEB_STYLUS_LENGTH / 2 });
|
||||||
|
@ -184,6 +186,7 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
if (!this.stylus) {
|
if (!this.stylus) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
tabletInterface.playSound(4);//HandsOut
|
||||||
Overlays.deleteOverlay(this.stylus);
|
Overlays.deleteOverlay(this.stylus);
|
||||||
this.stylus = null;
|
this.stylus = null;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue