mirror of
https://github.com/overte-org/overte.git
synced 2025-04-09 10:45:24 +02:00
Android - hide joystick when opening the Avatar window and disable it in cases is hidden (it was working with ui windows in front).
This commit is contained in:
parent
321896142c
commit
4c3ee195de
2 changed files with 13 additions and 7 deletions
|
@ -228,7 +228,7 @@ void TouchscreenVirtualPadDevice::touchBeginEvent(const QTouchEvent* event) {
|
|||
// touch begin here is a big begin -> begins both pads? maybe it does nothing
|
||||
debugPoints(event, " BEGIN ++++++++++++++++");
|
||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||
if (!virtualPadManager.isEnabled()) {
|
||||
if (!virtualPadManager.isEnabled() && !virtualPadManager.isHidden()) {
|
||||
return;
|
||||
}
|
||||
KeyboardMouseDevice::enableTouch(false);
|
||||
|
@ -236,7 +236,7 @@ void TouchscreenVirtualPadDevice::touchBeginEvent(const QTouchEvent* event) {
|
|||
|
||||
void TouchscreenVirtualPadDevice::touchEndEvent(const QTouchEvent* event) {
|
||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||
if (!virtualPadManager.isEnabled()) {
|
||||
if (!virtualPadManager.isEnabled() && !virtualPadManager.isHidden()) {
|
||||
touchLeftEnd();
|
||||
touchRightEnd();
|
||||
return;
|
||||
|
@ -252,7 +252,7 @@ void TouchscreenVirtualPadDevice::touchEndEvent(const QTouchEvent* event) {
|
|||
|
||||
void TouchscreenVirtualPadDevice::touchUpdateEvent(const QTouchEvent* event) {
|
||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||
if (!virtualPadManager.isEnabled()) {
|
||||
if (!virtualPadManager.isEnabled() && !virtualPadManager.isHidden()) {
|
||||
touchLeftEnd();
|
||||
touchRightEnd();
|
||||
return;
|
||||
|
@ -309,7 +309,7 @@ bool TouchscreenVirtualPadDevice::touchLeftBeginPointIsValid(glm::vec2 touchPoin
|
|||
|
||||
void TouchscreenVirtualPadDevice::touchLeftBegin(glm::vec2 touchPoint) {
|
||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||
if (virtualPadManager.isEnabled()) {
|
||||
if (virtualPadManager.isEnabled() && !virtualPadManager.isHidden()) {
|
||||
if (_fixedPosition) {
|
||||
_firstTouchLeftPoint = _fixedCenterPosition;
|
||||
} else {
|
||||
|
@ -333,7 +333,7 @@ void TouchscreenVirtualPadDevice::touchLeftEnd() {
|
|||
|
||||
void TouchscreenVirtualPadDevice::touchRightBegin(glm::vec2 touchPoint) {
|
||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||
if (virtualPadManager.isEnabled()) {
|
||||
if (virtualPadManager.isEnabled() && !virtualPadManager.isHidden()) {
|
||||
_firstTouchRightPoint = touchPoint;
|
||||
_validTouchRight = true;
|
||||
}
|
||||
|
@ -353,7 +353,7 @@ void TouchscreenVirtualPadDevice::touchRightEnd() {
|
|||
|
||||
void TouchscreenVirtualPadDevice::touchGestureEvent(const QGestureEvent* event) {
|
||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||
if (!virtualPadManager.isEnabled()) {
|
||||
if (!virtualPadManager.isEnabled() && !virtualPadManager.isHidden()) {
|
||||
return;
|
||||
}
|
||||
if (QGesture* gesture = event->gesture(Qt::PinchGesture)) {
|
||||
|
|
|
@ -34,6 +34,7 @@ function fromQml(message) { // messages are {method, params}, like json-rpc. See
|
|||
App.openUrl("https://metaverse.highfidelity.com/marketplace?category=avatars");
|
||||
break;
|
||||
case 'hide':
|
||||
Controller.setVPadHidden(false);
|
||||
module.exports.onHidden();
|
||||
break;
|
||||
default:
|
||||
|
@ -122,18 +123,21 @@ module.exports = {
|
|||
init();
|
||||
},
|
||||
show: function() {
|
||||
Controller.setVPadHidden(true);
|
||||
if (window) {
|
||||
window.setVisible(true);
|
||||
isVisible = true;
|
||||
}
|
||||
},
|
||||
hide: function() {
|
||||
Controller.setVPadHidden(false);
|
||||
if (window) {
|
||||
window.setVisible(false);
|
||||
}
|
||||
isVisible = false;
|
||||
},
|
||||
destroy: function() {
|
||||
Controller.setVPadHidden(false);
|
||||
if (window) {
|
||||
window.fromQml.disconnect(fromQml);
|
||||
window.close();
|
||||
|
@ -155,5 +159,7 @@ module.exports = {
|
|||
refreshSelectedAvatar: function(currentAvatarURL) {
|
||||
refreshSelected(currentAvatarURL);
|
||||
},
|
||||
onHidden: function() { }
|
||||
onHidden: function() {
|
||||
Controller.setVPadHidden(false);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue