From 7da854d98c70cf4272c4d68c84f898789e6f28e3 Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Fri, 24 Jun 2016 13:35:47 -0700 Subject: [PATCH 1/3] do not reset hud from button --- interface/src/ui/OverlayConductor.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/interface/src/ui/OverlayConductor.cpp b/interface/src/ui/OverlayConductor.cpp index 6a99641ce4..7d0dc6c650 100644 --- a/interface/src/ui/OverlayConductor.cpp +++ b/interface/src/ui/OverlayConductor.cpp @@ -118,10 +118,12 @@ void OverlayConductor::update(float dt) { bool isDriving = updateAvatarHasDriveInput(); bool drivingChanged = prevDriving != isDriving; bool isAtRest = updateAvatarIsAtRest(); + bool shouldRecenter = false; if (_flags & SuppressedByDrive) { if (!isDriving) { _flags &= ~SuppressedByDrive; + shouldRecenter = true; } } else { if (myAvatar->getClearOverlayWhenMoving() && drivingChanged && isDriving) { @@ -132,6 +134,7 @@ void OverlayConductor::update(float dt) { if (_flags & SuppressedByHead) { if (isAtRest) { _flags &= ~SuppressedByHead; + shouldRecenter = true; } } else { if (_hmdMode && headOutsideOverlay()) { @@ -143,8 +146,8 @@ void OverlayConductor::update(float dt) { bool targetVisible = Menu::getInstance()->isOptionChecked(MenuOption::Overlays) && (0 == (_flags & SuppressMask)); if (targetVisible != currentVisible) { offscreenUi->setPinned(!targetVisible); - if (targetVisible && _hmdMode) { - centerUI(); - } + } + if (shouldRecenter) { + centerUI(); } } From 2ae0a7defc2bfbcdb4fc030d56153e1736363d37 Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Fri, 24 Jun 2016 14:46:46 -0700 Subject: [PATCH 2/3] If there are TWO conditions holding things back, weight for them both to clear. --- interface/src/ui/OverlayConductor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/interface/src/ui/OverlayConductor.cpp b/interface/src/ui/OverlayConductor.cpp index 7d0dc6c650..e18522cb2f 100644 --- a/interface/src/ui/OverlayConductor.cpp +++ b/interface/src/ui/OverlayConductor.cpp @@ -123,7 +123,9 @@ void OverlayConductor::update(float dt) { if (_flags & SuppressedByDrive) { if (!isDriving) { _flags &= ~SuppressedByDrive; - shouldRecenter = true; + if (_flags & SuppressMask) { + shouldRecenter = true; + } } } else { if (myAvatar->getClearOverlayWhenMoving() && drivingChanged && isDriving) { @@ -134,7 +136,9 @@ void OverlayConductor::update(float dt) { if (_flags & SuppressedByHead) { if (isAtRest) { _flags &= ~SuppressedByHead; - shouldRecenter = true; + if (_flags & SuppressMask) { + shouldRecenter = true; + } } } else { if (_hmdMode && headOutsideOverlay()) { From 9ae3c386166a6834c8c571324189c65d1fe51b69 Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Fri, 24 Jun 2016 15:26:24 -0700 Subject: [PATCH 3/3] doh! --- interface/src/ui/OverlayConductor.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/interface/src/ui/OverlayConductor.cpp b/interface/src/ui/OverlayConductor.cpp index e18522cb2f..2ee106b6b3 100644 --- a/interface/src/ui/OverlayConductor.cpp +++ b/interface/src/ui/OverlayConductor.cpp @@ -123,9 +123,7 @@ void OverlayConductor::update(float dt) { if (_flags & SuppressedByDrive) { if (!isDriving) { _flags &= ~SuppressedByDrive; - if (_flags & SuppressMask) { - shouldRecenter = true; - } + shouldRecenter = true; } } else { if (myAvatar->getClearOverlayWhenMoving() && drivingChanged && isDriving) { @@ -136,9 +134,7 @@ void OverlayConductor::update(float dt) { if (_flags & SuppressedByHead) { if (isAtRest) { _flags &= ~SuppressedByHead; - if (_flags & SuppressMask) { - shouldRecenter = true; - } + shouldRecenter = true; } } else { if (_hmdMode && headOutsideOverlay()) { @@ -151,7 +147,7 @@ void OverlayConductor::update(float dt) { if (targetVisible != currentVisible) { offscreenUi->setPinned(!targetVisible); } - if (shouldRecenter) { + if (shouldRecenter && !_flags) { centerUI(); } }