mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 05:37:13 +02:00
Merge pull request #9508 from druiz17/tabletBug
fixed tablet bug when reloading scripts
This commit is contained in:
commit
4c8e90533b
4 changed files with 12 additions and 5 deletions
|
@ -9,8 +9,6 @@ Item {
|
||||||
property int rowIndex: 0
|
property int rowIndex: 0
|
||||||
property int columnIndex: 0
|
property int columnIndex: 0
|
||||||
property int count: (flowMain.children.length - 1)
|
property int count: (flowMain.children.length - 1)
|
||||||
width: parent.width
|
|
||||||
height: parent.height
|
|
||||||
|
|
||||||
// called by C++ code to keep audio bar updated
|
// called by C++ code to keep audio bar updated
|
||||||
function setMicLevel(newMicLevel) {
|
function setMicLevel(newMicLevel) {
|
||||||
|
|
|
@ -204,7 +204,7 @@ void TabletProxy::gotoMenuScreen() {
|
||||||
if (_qmlTabletRoot) {
|
if (_qmlTabletRoot) {
|
||||||
if (_state != State::Menu) {
|
if (_state != State::Menu) {
|
||||||
auto loader = _qmlTabletRoot->findChild<QQuickItem*>("loader");
|
auto loader = _qmlTabletRoot->findChild<QQuickItem*>("loader");
|
||||||
QObject::connect(loader, SIGNAL(loaded()), this, SLOT(addButtonsToMenuScreen()));
|
QObject::connect(loader, SIGNAL(loaded()), this, SLOT(addButtonsToMenuScreen()), Qt::DirectConnection);
|
||||||
QMetaObject::invokeMethod(_qmlTabletRoot, "loadSource", Q_ARG(const QVariant&, QVariant(VRMENU_SOURCE_URL)));
|
QMetaObject::invokeMethod(_qmlTabletRoot, "loadSource", Q_ARG(const QVariant&, QVariant(VRMENU_SOURCE_URL)));
|
||||||
_state = State::Menu;
|
_state = State::Menu;
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ void TabletProxy::gotoHomeScreen() {
|
||||||
if (_qmlTabletRoot) {
|
if (_qmlTabletRoot) {
|
||||||
if (_state != State::Home) {
|
if (_state != State::Home) {
|
||||||
auto loader = _qmlTabletRoot->findChild<QQuickItem*>("loader");
|
auto loader = _qmlTabletRoot->findChild<QQuickItem*>("loader");
|
||||||
QObject::connect(loader, SIGNAL(loaded()), this, SLOT(addButtonsToHomeScreen()));
|
QObject::connect(loader, SIGNAL(loaded()), this, SLOT(addButtonsToHomeScreen()), Qt::DirectConnection);
|
||||||
QMetaObject::invokeMethod(_qmlTabletRoot, "loadSource", Q_ARG(const QVariant&, QVariant(TABLET_SOURCE_URL)));
|
QMetaObject::invokeMethod(_qmlTabletRoot, "loadSource", Q_ARG(const QVariant&, QVariant(TABLET_SOURCE_URL)));
|
||||||
QMetaObject::invokeMethod(_qmlTabletRoot, "playButtonClickSound");
|
QMetaObject::invokeMethod(_qmlTabletRoot, "playButtonClickSound");
|
||||||
_state = State::Home;
|
_state = State::Home;
|
||||||
|
|
|
@ -196,6 +196,7 @@ var toolBar = (function () {
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
that.setActive(false);
|
that.setActive(false);
|
||||||
|
tablet.removeButton(activeButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addButton(name, image, handler) {
|
function addButton(name, image, handler) {
|
||||||
|
@ -696,7 +697,9 @@ function mouseClickEvent(event) {
|
||||||
toolBar.setActive(true);
|
toolBar.setActive(true);
|
||||||
var pickRay = result.pickRay;
|
var pickRay = result.pickRay;
|
||||||
var foundEntity = result.entityID;
|
var foundEntity = result.entityID;
|
||||||
|
if (foundEntity === HMD.tabletID) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
properties = Entities.getEntityProperties(foundEntity);
|
properties = Entities.getEntityProperties(foundEntity);
|
||||||
if (isLocked(properties)) {
|
if (isLocked(properties)) {
|
||||||
if (wantDebug) {
|
if (wantDebug) {
|
||||||
|
|
|
@ -104,4 +104,10 @@
|
||||||
}
|
}
|
||||||
return micLevel;
|
return micLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Script.scriptEnding.connect(function () {
|
||||||
|
Entities.deleteEntity(HMD.tabletID);
|
||||||
|
HMD.tabletID = null;
|
||||||
|
HDM.homeButtonID = null;
|
||||||
|
});
|
||||||
}()); // END LOCAL_SCOPE
|
}()); // END LOCAL_SCOPE
|
||||||
|
|
Loading…
Reference in a new issue