mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-06 02:25:20 +02:00
Merge pull request #9442 from sethalves/tablet-ui
don't save tablet to Settings when logging out or switching domains
This commit is contained in:
commit
fc8b09d2b3
3 changed files with 8 additions and 2 deletions
|
@ -796,8 +796,14 @@ void MyAvatar::saveData() {
|
||||||
|
|
||||||
settings.beginWriteArray("avatarEntityData");
|
settings.beginWriteArray("avatarEntityData");
|
||||||
int avatarEntityIndex = 0;
|
int avatarEntityIndex = 0;
|
||||||
|
auto hmdInterface = DependencyManager::get<HMDScriptingInterface>();
|
||||||
_avatarEntitiesLock.withReadLock([&] {
|
_avatarEntitiesLock.withReadLock([&] {
|
||||||
for (auto entityID : _avatarEntityData.keys()) {
|
for (auto entityID : _avatarEntityData.keys()) {
|
||||||
|
if (hmdInterface->getCurrentTableUIID() == entityID) {
|
||||||
|
// don't persist the tablet between domains / sessions
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
settings.setArrayIndex(avatarEntityIndex);
|
settings.setArrayIndex(avatarEntityIndex);
|
||||||
settings.setValue("id", entityID);
|
settings.setValue("id", entityID);
|
||||||
settings.setValue("properties", _avatarEntityData.value(entityID));
|
settings.setValue("properties", _avatarEntityData.value(entityID));
|
||||||
|
|
|
@ -136,7 +136,7 @@ WebTablet = function (url, width, dpi, hand, clientOnly) {
|
||||||
this.state = "idle";
|
this.state = "idle";
|
||||||
|
|
||||||
this.getRoot = function() {
|
this.getRoot = function() {
|
||||||
return Entities.getWebViewRoot(_this.webEntityID);
|
return Entities.getWebViewRoot(_this.tabletEntityID);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getLocation = function() {
|
this.getLocation = function() {
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
print("show tablet-ui");
|
print("show tablet-ui");
|
||||||
UIWebTablet = new WebTablet("qml/hifi/tablet/TabletRoot.qml", null, null, activeHand, true);
|
UIWebTablet = new WebTablet("qml/hifi/tablet/TabletRoot.qml", null, null, activeHand, true);
|
||||||
UIWebTablet.register();
|
UIWebTablet.register();
|
||||||
HMD.tabletID = UIWebTablet.webEntityID;
|
HMD.tabletID = UIWebTablet.tabletEntityID;
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideTabletUI() {
|
function hideTabletUI() {
|
||||||
|
|
Loading…
Reference in a new issue