diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 5f26fda674..40431737a2 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6861,3 +6861,13 @@ void Application::toggleMuteAudio() { auto menu = Menu::getInstance(); menu->setIsOptionChecked(MenuOption::MuteAudio, !menu->isOptionChecked(MenuOption::MuteAudio)); } + +OverlayID Application::getTabletScreenID() { + auto HMD = DependencyManager::get(); + return HMD->getCurrentTabletScreenID(); +} + +OverlayID Application::getTabletHomeButtonID() { + auto HMD = DependencyManager::get(); + return HMD->getCurrentHomeButtonUUID(); +} diff --git a/interface/src/Application.h b/interface/src/Application.h index 7dcb35babc..cc3e603a82 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -293,6 +293,9 @@ public: Q_INVOKABLE void sendHoverOverEntity(QUuid id, PointerEvent event); Q_INVOKABLE void sendHoverLeaveEntity(QUuid id, PointerEvent event); + OverlayID getTabletScreenID(); + OverlayID getTabletHomeButtonID(); + signals: void svoImportRequested(const QString& url); diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 29f41c89fd..e39b7e1e50 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -808,7 +808,7 @@ void MyAvatar::saveData() { auto hmdInterface = DependencyManager::get(); _avatarEntitiesLock.withReadLock([&] { for (auto entityID : _avatarEntityData.keys()) { - if (hmdInterface->getCurrentTableUIID() == entityID) { + if (hmdInterface->getCurrentTabletUIID() == entityID) { // don't persist the tablet between domains / sessions continue; } diff --git a/interface/src/scripting/HMDScriptingInterface.h b/interface/src/scripting/HMDScriptingInterface.h index 643fac02fc..463a21ded8 100644 --- a/interface/src/scripting/HMDScriptingInterface.h +++ b/interface/src/scripting/HMDScriptingInterface.h @@ -29,9 +29,9 @@ class HMDScriptingInterface : public AbstractHMDScriptingInterface, public Depen Q_PROPERTY(glm::quat orientation READ getOrientation) Q_PROPERTY(bool mounted READ isMounted) Q_PROPERTY(bool showTablet READ getShouldShowTablet) - Q_PROPERTY(QUuid tabletID READ getCurrentTableUIID WRITE setCurrentTabletUIID) + Q_PROPERTY(QUuid tabletID READ getCurrentTabletUIID WRITE setCurrentTabletUIID) Q_PROPERTY(QUuid homeButtonID READ getCurrentHomeButtonUUID WRITE setCurrentHomeButtonUUID) - + Q_PROPERTY(QUuid tabletScreenID READ getCurrentTabletScreenID WRITE setCurrentTabletScreenID) public: Q_INVOKABLE glm::vec3 calculateRayUICollisionPoint(const glm::vec3& position, const glm::vec3& direction) const; @@ -91,14 +91,18 @@ public: bool getShouldShowTablet() const { return _showTablet; } void setCurrentTabletUIID(QUuid tabletID) { _tabletUIID = tabletID; } - QUuid getCurrentTableUIID() const { return _tabletUIID; } + QUuid getCurrentTabletUIID() const { return _tabletUIID; } void setCurrentHomeButtonUUID(QUuid homeButtonID) { _homeButtonID = homeButtonID; } QUuid getCurrentHomeButtonUUID() const { return _homeButtonID; } + void setCurrentTabletScreenID(QUuid tabletID) { _tabletScreenID = tabletID; } + QUuid getCurrentTabletScreenID() const { return _tabletScreenID; } + private: bool _showTablet { false }; - QUuid _tabletUIID; // this is the entityID of the WebEntity which is part of (a child of) the tablet-ui. + QUuid _tabletUIID; // this is the entityID of the tablet frame + QUuid _tabletScreenID; // this is the overlayID which is part of (a child of) the tablet-ui. QUuid _homeButtonID; QUuid _tabletEntityID; diff --git a/interface/src/ui/overlays/Overlay.h b/interface/src/ui/overlays/Overlay.h index 320cd532c4..0c96af1a99 100644 --- a/interface/src/ui/overlays/Overlay.h +++ b/interface/src/ui/overlays/Overlay.h @@ -128,8 +128,7 @@ namespace render { Q_DECLARE_METATYPE(OverlayID); Q_DECLARE_METATYPE(QVector); QScriptValue OverlayIDtoScriptValue(QScriptEngine* engine, const OverlayID& id); -void OverlayIDfromScriptValue(const QScriptValue &object, OverlayID& id); +void OverlayIDfromScriptValue(const QScriptValue& object, OverlayID& id); QVector qVectorOverlayIDFromScriptValue(const QScriptValue& array); - #endif // hifi_Overlay_h