Backed out changeset: 6d631b9d02a0 for maint-6242

master
andreykproductengine 2016-08-22 20:57:22 +03:00
parent 6c280f9d2b
commit f69e82b584
5 changed files with 21 additions and 54 deletions

View File

@ -3191,7 +3191,7 @@ void LLAgent::initOriginGlobal(const LLVector3d &origin_global)
}
BOOL LLAgent::leftButtonGrabbed() const
{
{
const BOOL camera_mouse_look = gAgentCamera.cameraMouselook();
return (!camera_mouse_look && mControlsTakenCount[CONTROL_LBUTTON_DOWN_INDEX] > 0)
|| (camera_mouse_look && mControlsTakenCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0)
@ -3199,13 +3199,6 @@ BOOL LLAgent::leftButtonGrabbed() const
|| (camera_mouse_look && mControlsTakenPassedOnCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0);
}
BOOL LLAgent::leftButtonBlocked() const
{
const BOOL camera_mouse_look = gAgentCamera.cameraMouselook();
return (!camera_mouse_look && mControlsTakenCount[CONTROL_LBUTTON_DOWN_INDEX] > 0)
|| (camera_mouse_look && mControlsTakenCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0);
}
BOOL LLAgent::rotateGrabbed() const
{
return (mControlsTakenCount[CONTROL_YAW_POS_INDEX] > 0)
@ -3663,14 +3656,7 @@ BOOL LLAgent::anyControlGrabbed() const
BOOL LLAgent::isControlGrabbed(S32 control_index) const
{
if (gAgent.mControlsTakenCount[control_index] > 0)
return TRUE;
return gAgent.mControlsTakenPassedOnCount[control_index] > 0;
}
BOOL LLAgent::isControlBlocked(S32 control_index) const
{
return mControlsTakenCount[control_index] > 0;
return mControlsTakenCount[control_index] > 0;
}
void LLAgent::forceReleaseControls()

View File

@ -444,8 +444,7 @@ private:
// Grab
//--------------------------------------------------------------------
public:
BOOL leftButtonGrabbed() const;
BOOL leftButtonBlocked() const;
BOOL leftButtonGrabbed() const;
BOOL rotateGrabbed() const;
BOOL forwardGrabbed() const;
BOOL backwardGrabbed() const;
@ -462,9 +461,8 @@ public:
BOOL controlFlagsDirty() const;
void enableControlFlagReset();
void resetControlFlags();
BOOL anyControlGrabbed() const; // True if a script has taken over any control
BOOL isControlGrabbed(S32 control_index) const; // True if a script has taken over a control
BOOL isControlBlocked(S32 control_index) const; // Control should be ignored or won't be passed
BOOL anyControlGrabbed() const; // True iff a script has taken over a control
BOOL isControlGrabbed(S32 control_index) const;
// Send message to simulator to force grabbed controls to be
// released, in case of a poorly written script.
void forceReleaseControls();

View File

@ -38,7 +38,6 @@
#include "lltoolfocus.h"
#include "llfocusmgr.h"
#include "llagent.h"
#include "llagentcamera.h"
#include "llviewerjoystick.h"
extern BOOL gDebugClicks;
@ -85,14 +84,7 @@ BOOL LLTool::handleMouseDown(S32 x, S32 y, MASK mask)
}
// by default, didn't handle it
// LL_INFOS() << "LLTool::handleMouseDown" << LL_ENDL;
if (gAgentCamera.cameraMouselook())
{
gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN);
}
else
{
gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_DOWN);
}
gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_DOWN);
return TRUE;
}
@ -103,15 +95,8 @@ BOOL LLTool::handleMouseUp(S32 x, S32 y, MASK mask)
LL_INFOS() << "LLTool left mouse up" << LL_ENDL;
}
// by default, didn't handle it
// LL_INFOS() << "LLTool::handleMouseUp" << LL_ENDL;
if (gAgentCamera.cameraMouselook())
{
gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_UP);
}
else
{
gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_UP);
}
// LL_INFOS() << "LLTool::handleMouseUp" << LL_ENDL;
gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_UP);
return TRUE;
}

View File

@ -742,13 +742,12 @@ BOOL LLToolCompGun::handleHover(S32 x, S32 y, MASK mask)
BOOL LLToolCompGun::handleMouseDown(S32 x, S32 y, MASK mask)
{
// if the left button is blocked, don't put up the pie menu
if (gAgent.leftButtonBlocked())
{
// in case of "grabbed" control flag will be set later
gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN);
return FALSE;
}
// if the left button is grabbed, don't put up the pie menu
if (gAgent.leftButtonGrabbed())
{
gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN);
return FALSE;
}
// On mousedown, start grabbing
gGrabTransientTool = this;
@ -760,13 +759,12 @@ BOOL LLToolCompGun::handleMouseDown(S32 x, S32 y, MASK mask)
BOOL LLToolCompGun::handleDoubleClick(S32 x, S32 y, MASK mask)
{
// if the left button is blocked, don't put up the pie menu
if (gAgent.leftButtonBlocked())
{
// in case of "grabbed" control flag will be set later
gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN);
return FALSE;
}
// if the left button is grabbed, don't put up the pie menu
if (gAgent.leftButtonGrabbed())
{
gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN);
return FALSE;
}
// On mousedown, start grabbing
gGrabTransientTool = this;

View File

@ -143,7 +143,7 @@ BOOL LLToolGrab::handleMouseDown(S32 x, S32 y, MASK mask)
// call the base class to propogate info to sim
LLTool::handleMouseDown(x, y, mask);
if (!gAgent.leftButtonBlocked())
if (!gAgent.leftButtonGrabbed())
{
// can grab transparent objects (how touch event propagates, scripters rely on this)
gViewerWindow->pickAsync(x, y, mask, pickCallback, /*BOOL pick_transparent*/ TRUE);