Skip to content
Snippets Groups Projects
Commit f1fd558d authored by Paul Guslisty's avatar Paul Guslisty
Browse files

STORM-714 FIXED Webprim's control bar doesn't dissapear after switching to mouselook mode

- After switching to the mouse look mode hide control bar immediately, not fading it with timer

- Added signal for switching mouse look mode out just for convenience. It's not used in this fix.
parent 76e70a0d
No related branches found
No related tags found
No related merge requests found
......@@ -218,7 +218,10 @@ LLAgent::LLAgent() :
mFirstLogin(FALSE),
mGenderChosen(FALSE),
mAppearanceSerialNum(0)
mAppearanceSerialNum(0),
mMouselookModeInSignal(NULL),
mMouselookModeOutSignal(NULL)
{
for (U32 i = 0; i < TOTAL_CONTROLS; i++)
{
......@@ -269,6 +272,9 @@ LLAgent::~LLAgent()
{
cleanup();
delete mMouselookModeInSignal;
delete mMouselookModeOutSignal;
// *Note: this is where LLViewerCamera::getInstance() used to be deleted.
}
......@@ -1735,6 +1741,11 @@ void LLAgent::endAnimationUpdateUI()
LLFloaterCamera::onLeavingMouseLook();
if (mMouselookModeOutSignal)
{
(*mMouselookModeOutSignal)();
}
// Only pop if we have pushed...
if (TRUE == mViewsPushed)
{
......@@ -1840,6 +1851,11 @@ void LLAgent::endAnimationUpdateUI()
mViewsPushed = TRUE;
if (mMouselookModeInSignal)
{
(*mMouselookModeInSignal)();
}
// hide all floaters except the mini map
#if 0 // Use this once all floaters are registered
......@@ -1899,7 +1915,6 @@ void LLAgent::endAnimationUpdateUI()
}
}
}
}
else if (gAgentCamera.getCameraMode() == CAMERA_MODE_CUSTOMIZE_AVATAR)
{
......@@ -1931,6 +1946,18 @@ void LLAgent::endAnimationUpdateUI()
gAgentCamera.updateLastCamera();
}
boost::signals2::connection LLAgent::setMouselookModeInCallback( const camera_signal_t::slot_type& cb )
{
if (!mMouselookModeInSignal) mMouselookModeInSignal = new camera_signal_t();
return mMouselookModeInSignal->connect(cb);
}
boost::signals2::connection LLAgent::setMouselookModeOutCallback( const camera_signal_t::slot_type& cb )
{
if (!mMouselookModeOutSignal) mMouselookModeOutSignal = new camera_signal_t();
return mMouselookModeOutSignal->connect(cb);
}
//-----------------------------------------------------------------------------
// heardChat()
//-----------------------------------------------------------------------------
......
......@@ -39,6 +39,8 @@
#include "llvoavatardefines.h"
#include "llslurl.h"
#include <boost/signals2.hpp>
extern const BOOL ANIMATE;
extern const U8 AGENT_STATE_TYPING; // Typing indication
extern const U8 AGENT_STATE_EDITING; // Set when agent has objects selected
......@@ -410,7 +412,13 @@ class LLAgent : public LLOldEvents::LLObservable
BOOL getCustomAnim() const { return mCustomAnim; }
void setCustomAnim(BOOL anim) { mCustomAnim = anim; }
typedef boost::signals2::signal<void ()> camera_signal_t;
boost::signals2::connection setMouselookModeInCallback( const camera_signal_t::slot_type& cb );
boost::signals2::connection setMouselookModeOutCallback( const camera_signal_t::slot_type& cb );
private:
camera_signal_t* mMouselookModeInSignal;
camera_signal_t* mMouselookModeOutSignal;
BOOL mCustomAnim; // Current animation is ANIM_AGENT_CUSTOMIZE ?
LLAnimPauseRequest mPauseRequest;
BOOL mViewsPushed; // Keep track of whether or not we have pushed views
......
......@@ -92,7 +92,8 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() :
mZoomObjectID(LLUUID::null),
mZoomObjectFace(0),
mVolumeSliderVisible(0),
mWindowShade(NULL)
mWindowShade(NULL),
mHideImmediately(false)
{
mCommitCallbackRegistrar.add("MediaCtrl.Close", boost::bind(&LLPanelPrimMediaControls::onClickClose, this));
mCommitCallbackRegistrar.add("MediaCtrl.Back", boost::bind(&LLPanelPrimMediaControls::onClickBack, this));
......@@ -207,6 +208,8 @@ BOOL LLPanelPrimMediaControls::postBuild()
mMediaAddress->setFocusReceivedCallback(boost::bind(&LLPanelPrimMediaControls::onInputURL, _1, this ));
gAgent.setMouselookModeInCallback(boost::bind(&LLPanelPrimMediaControls::onMouselookModeIn, this));
LLWindowShade::Params window_shade_params;
window_shade_params.name = "window_shade";
......@@ -722,26 +725,22 @@ void LLPanelPrimMediaControls::draw()
}
F32 alpha = getDrawContext().mAlpha;
if(mFadeTimer.getStarted())
if(mHideImmediately)
{
//hide this panel
clearFaceOnFade();
mHideImmediately = false;
}
else if(mFadeTimer.getStarted())
{
F32 time = mFadeTimer.getElapsedTimeF32();
alpha *= llmax(lerp(1.0, 0.0, time / mControlFadeTime), 0.0f);
if(time >= mControlFadeTime)
{
if(mClearFaceOnFade)
{
// Hiding this object makes scroll events go missing after it fades out
// (see DEV-41755 for a full description of the train wreck).
// Only hide the controls when we're untargeting.
setVisible(FALSE);
mClearFaceOnFade = false;
mVolumeSliderVisible = 0;
mTargetImplID = LLUUID::null;
mTargetObjectID = LLUUID::null;
mTargetObjectFace = 0;
}
//hide this panel
clearFaceOnFade();
}
}
......@@ -1319,6 +1318,30 @@ bool LLPanelPrimMediaControls::shouldVolumeSliderBeVisible()
return mVolumeSliderVisible > 0;
}
void LLPanelPrimMediaControls::clearFaceOnFade()
{
if(mClearFaceOnFade)
{
// Hiding this object makes scroll events go missing after it fades out
// (see DEV-41755 for a full description of the train wreck).
// Only hide the controls when we're untargeting.
setVisible(FALSE);
mClearFaceOnFade = false;
mVolumeSliderVisible = 0;
mTargetImplID = LLUUID::null;
mTargetObjectID = LLUUID::null;
mTargetObjectFace = 0;
}
}
void LLPanelPrimMediaControls::onMouselookModeIn()
{
LLViewerMediaFocus::getInstance()->clearHover();
mHideImmediately = true;
}
void LLPanelPrimMediaControls::showNotification(LLNotificationPtr notify)
{
delete mWindowShade;
......
......@@ -59,6 +59,7 @@ class LLPanelPrimMediaControls : public LLPanel
void showNotification(LLNotificationPtr notify);
void hideNotification();
enum EZoomLevel
{
ZOOM_NONE = 0,
......@@ -136,7 +137,11 @@ class LLPanelPrimMediaControls : public LLPanel
LLPluginClassMedia* getTargetMediaPlugin();
private:
void clearFaceOnFade();
void onMouselookModeIn();
LLView *mMediaRegion;
LLUICtrl *mBackCtrl;
LLUICtrl *mFwdCtrl;
......@@ -185,6 +190,7 @@ class LLPanelPrimMediaControls : public LLPanel
bool mPauseFadeout;
bool mUpdateSlider;
bool mClearFaceOnFade;
bool mHideImmediately;
LLMatrix4 mLastCameraMat;
EZoomLevel mCurrentZoom;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment