mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 17:01:18 +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
|
// touch begin here is a big begin -> begins both pads? maybe it does nothing
|
||||||
debugPoints(event, " BEGIN ++++++++++++++++");
|
debugPoints(event, " BEGIN ++++++++++++++++");
|
||||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||||
if (!virtualPadManager.isEnabled()) {
|
if (!virtualPadManager.isEnabled() && !virtualPadManager.isHidden()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
KeyboardMouseDevice::enableTouch(false);
|
KeyboardMouseDevice::enableTouch(false);
|
||||||
|
@ -236,7 +236,7 @@ void TouchscreenVirtualPadDevice::touchBeginEvent(const QTouchEvent* event) {
|
||||||
|
|
||||||
void TouchscreenVirtualPadDevice::touchEndEvent(const QTouchEvent* event) {
|
void TouchscreenVirtualPadDevice::touchEndEvent(const QTouchEvent* event) {
|
||||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||||
if (!virtualPadManager.isEnabled()) {
|
if (!virtualPadManager.isEnabled() && !virtualPadManager.isHidden()) {
|
||||||
touchLeftEnd();
|
touchLeftEnd();
|
||||||
touchRightEnd();
|
touchRightEnd();
|
||||||
return;
|
return;
|
||||||
|
@ -252,7 +252,7 @@ void TouchscreenVirtualPadDevice::touchEndEvent(const QTouchEvent* event) {
|
||||||
|
|
||||||
void TouchscreenVirtualPadDevice::touchUpdateEvent(const QTouchEvent* event) {
|
void TouchscreenVirtualPadDevice::touchUpdateEvent(const QTouchEvent* event) {
|
||||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||||
if (!virtualPadManager.isEnabled()) {
|
if (!virtualPadManager.isEnabled() && !virtualPadManager.isHidden()) {
|
||||||
touchLeftEnd();
|
touchLeftEnd();
|
||||||
touchRightEnd();
|
touchRightEnd();
|
||||||
return;
|
return;
|
||||||
|
@ -309,7 +309,7 @@ bool TouchscreenVirtualPadDevice::touchLeftBeginPointIsValid(glm::vec2 touchPoin
|
||||||
|
|
||||||
void TouchscreenVirtualPadDevice::touchLeftBegin(glm::vec2 touchPoint) {
|
void TouchscreenVirtualPadDevice::touchLeftBegin(glm::vec2 touchPoint) {
|
||||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||||
if (virtualPadManager.isEnabled()) {
|
if (virtualPadManager.isEnabled() && !virtualPadManager.isHidden()) {
|
||||||
if (_fixedPosition) {
|
if (_fixedPosition) {
|
||||||
_firstTouchLeftPoint = _fixedCenterPosition;
|
_firstTouchLeftPoint = _fixedCenterPosition;
|
||||||
} else {
|
} else {
|
||||||
|
@ -333,7 +333,7 @@ void TouchscreenVirtualPadDevice::touchLeftEnd() {
|
||||||
|
|
||||||
void TouchscreenVirtualPadDevice::touchRightBegin(glm::vec2 touchPoint) {
|
void TouchscreenVirtualPadDevice::touchRightBegin(glm::vec2 touchPoint) {
|
||||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||||
if (virtualPadManager.isEnabled()) {
|
if (virtualPadManager.isEnabled() && !virtualPadManager.isHidden()) {
|
||||||
_firstTouchRightPoint = touchPoint;
|
_firstTouchRightPoint = touchPoint;
|
||||||
_validTouchRight = true;
|
_validTouchRight = true;
|
||||||
}
|
}
|
||||||
|
@ -353,7 +353,7 @@ void TouchscreenVirtualPadDevice::touchRightEnd() {
|
||||||
|
|
||||||
void TouchscreenVirtualPadDevice::touchGestureEvent(const QGestureEvent* event) {
|
void TouchscreenVirtualPadDevice::touchGestureEvent(const QGestureEvent* event) {
|
||||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||||
if (!virtualPadManager.isEnabled()) {
|
if (!virtualPadManager.isEnabled() && !virtualPadManager.isHidden()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (QGesture* gesture = event->gesture(Qt::PinchGesture)) {
|
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");
|
App.openUrl("https://metaverse.highfidelity.com/marketplace?category=avatars");
|
||||||
break;
|
break;
|
||||||
case 'hide':
|
case 'hide':
|
||||||
|
Controller.setVPadHidden(false);
|
||||||
module.exports.onHidden();
|
module.exports.onHidden();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -122,18 +123,21 @@ module.exports = {
|
||||||
init();
|
init();
|
||||||
},
|
},
|
||||||
show: function() {
|
show: function() {
|
||||||
|
Controller.setVPadHidden(true);
|
||||||
if (window) {
|
if (window) {
|
||||||
window.setVisible(true);
|
window.setVisible(true);
|
||||||
isVisible = true;
|
isVisible = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hide: function() {
|
hide: function() {
|
||||||
|
Controller.setVPadHidden(false);
|
||||||
if (window) {
|
if (window) {
|
||||||
window.setVisible(false);
|
window.setVisible(false);
|
||||||
}
|
}
|
||||||
isVisible = false;
|
isVisible = false;
|
||||||
},
|
},
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
|
Controller.setVPadHidden(false);
|
||||||
if (window) {
|
if (window) {
|
||||||
window.fromQml.disconnect(fromQml);
|
window.fromQml.disconnect(fromQml);
|
||||||
window.close();
|
window.close();
|
||||||
|
@ -155,5 +159,7 @@ module.exports = {
|
||||||
refreshSelectedAvatar: function(currentAvatarURL) {
|
refreshSelectedAvatar: function(currentAvatarURL) {
|
||||||
refreshSelected(currentAvatarURL);
|
refreshSelected(currentAvatarURL);
|
||||||
},
|
},
|
||||||
onHidden: function() { }
|
onHidden: function() {
|
||||||
|
Controller.setVPadHidden(false);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue