mirror of
https://github.com/overte-org/overte.git
synced 2025-04-15 08:48:43 +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 columnIndex: 0
|
||||
property int count: (flowMain.children.length - 1)
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
// called by C++ code to keep audio bar updated
|
||||
function setMicLevel(newMicLevel) {
|
||||
|
|
|
@ -204,7 +204,7 @@ void TabletProxy::gotoMenuScreen() {
|
|||
if (_qmlTabletRoot) {
|
||||
if (_state != State::Menu) {
|
||||
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)));
|
||||
_state = State::Menu;
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ void TabletProxy::gotoHomeScreen() {
|
|||
if (_qmlTabletRoot) {
|
||||
if (_state != State::Home) {
|
||||
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, "playButtonClickSound");
|
||||
_state = State::Home;
|
||||
|
|
|
@ -196,6 +196,7 @@ var toolBar = (function () {
|
|||
|
||||
function cleanup() {
|
||||
that.setActive(false);
|
||||
tablet.removeButton(activeButton);
|
||||
}
|
||||
|
||||
function addButton(name, image, handler) {
|
||||
|
@ -696,7 +697,9 @@ function mouseClickEvent(event) {
|
|||
toolBar.setActive(true);
|
||||
var pickRay = result.pickRay;
|
||||
var foundEntity = result.entityID;
|
||||
|
||||
if (foundEntity === HMD.tabletID) {
|
||||
return;
|
||||
}
|
||||
properties = Entities.getEntityProperties(foundEntity);
|
||||
if (isLocked(properties)) {
|
||||
if (wantDebug) {
|
||||
|
|
|
@ -104,4 +104,10 @@
|
|||
}
|
||||
return micLevel;
|
||||
}
|
||||
|
||||
Script.scriptEnding.connect(function () {
|
||||
Entities.deleteEntity(HMD.tabletID);
|
||||
HMD.tabletID = null;
|
||||
HDM.homeButtonID = null;
|
||||
});
|
||||
}()); // END LOCAL_SCOPE
|
||||
|
|
Loading…
Reference in a new issue