diff --git a/indra/newview/lltool.cpp b/indra/newview/lltool.cpp
index 0740fc38b..ca1939d67 100644
--- a/indra/newview/lltool.cpp
+++ b/indra/newview/lltool.cpp
@@ -89,7 +89,7 @@ BOOL LLTool::handleMouseDown(S32 x, S32 y, MASK mask)
llinfos << "LLTool left mouse down" << llendl;
}
// by default, didn't handle it
- // llinfos << "LLTool::handleMouseDown" << llendl;
+ // LL_INFOS() << "LLTool::handleMouseDown" << LL_ENDL;
gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_DOWN);
return TRUE;
}
@@ -101,7 +101,7 @@ BOOL LLTool::handleMouseUp(S32 x, S32 y, MASK mask)
llinfos << "LLTool left mouse up" << llendl;
}
// by default, didn't handle it
- // llinfos << "LLTool::handleMouseUp" << llendl;
+ // LL_INFOS() << "LLTool::handleMouseUp" << LL_ENDL;
gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_UP);
return TRUE;
}
@@ -117,13 +117,13 @@ BOOL LLTool::handleHover(S32 x, S32 y, MASK mask)
BOOL LLTool::handleScrollWheel(S32 x, S32 y, S32 clicks)
{
// by default, didn't handle it
- // llinfos << "LLTool::handleScrollWheel" << llendl;
+ // LL_INFOS() << "LLTool::handleScrollWheel" << LL_ENDL;
return FALSE;
}
BOOL LLTool::handleDoubleClick(S32 x,S32 y,MASK mask)
{
- // llinfos << "LLTool::handleDoubleClick" << llendl;
+ // LL_INFOS() << "LLTool::handleDoubleClick" << LL_ENDL;
// by default, pretend it's a left click
return FALSE;
}
@@ -131,35 +131,35 @@ BOOL LLTool::handleDoubleClick(S32 x,S32 y,MASK mask)
BOOL LLTool::handleRightMouseDown(S32 x,S32 y,MASK mask)
{
// by default, didn't handle it
- // llinfos << "LLTool::handleRightMouseDown" << llendl;
+ // LL_INFOS() << "LLTool::handleRightMouseDown" << LL_ENDL;
return FALSE;
}
BOOL LLTool::handleRightMouseUp(S32 x, S32 y, MASK mask)
{
// by default, didn't handle it
- // llinfos << "LLTool::handleRightMouseDown" << llendl;
+ // LL_INFOS() << "LLTool::handleRightMouseDown" << LL_ENDL;
return FALSE;
}
BOOL LLTool::handleMiddleMouseDown(S32 x,S32 y,MASK mask)
{
// by default, didn't handle it
- // llinfos << "LLTool::handleMiddleMouseDown" << llendl;
+ // LL_INFOS() << "LLTool::handleMiddleMouseDown" << LL_ENDL;
return FALSE;
}
BOOL LLTool::handleMiddleMouseUp(S32 x, S32 y, MASK mask)
{
// by default, didn't handle it
- // llinfos << "LLTool::handleMiddleMouseUp" << llendl;
+ // LL_INFOS() << "LLTool::handleMiddleMouseUp" << LL_ENDL;
return FALSE;
}
BOOL LLTool::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen)
{
// by default, didn't handle it
- // llinfos << "LLTool::handleToolTip" << llendl;
+ // LL_INFOS() << "LLTool::handleToolTip" << LL_ENDL;
return FALSE;
}
@@ -197,9 +197,11 @@ LLTool* LLTool::getOverrideTool(MASK mask)
{
return NULL;
}
- if (mask & MASK_ALT)
{
- return LLToolCamera::getInstance();
+ if (mask & MASK_ALT)
+ {
+ return LLToolCamera::getInstance();
+ }
}
return NULL;
}
diff --git a/indra/newview/lltool.h b/indra/newview/lltool.h
index 3fec2c8e8..d9f7af4db 100644
--- a/indra/newview/lltool.h
+++ b/indra/newview/lltool.h
@@ -45,7 +45,7 @@ class LLView;
class LLPanel;
class LLTool
-: public LLMouseHandler
+: public LLMouseHandler, public LLThreadSafeRefCount
{
public:
LLTool( const std::string& name, LLToolComposite* composite = NULL );
diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp
index c3f2593c4..5049b0644 100644
--- a/indra/newview/lltoolbrush.cpp
+++ b/indra/newview/lltoolbrush.cpp
@@ -59,7 +59,7 @@
#include "llworld.h"
#include "llappviewer.h"
#include "llparcel.h"
-
+#include "roles_constants.h"
#include "llglheaders.h"
const std::string REGION_BLOCKS_TERRAFORM_MSG = "This region does not allow terraforming.\n"
@@ -246,9 +246,9 @@ void LLToolBrushLand::modifyLandInSelectionGlobal()
iter != mLastAffectedRegions.end(); ++iter)
{
LLViewerRegion* regionp = *iter;
- if (!canTerraform(regionp))
+ if (!canTerraformRegion(regionp))
{
- alertNoTerraform(regionp);
+ alertNoTerraformRegion(regionp);
return;
}
}
@@ -383,12 +383,17 @@ BOOL LLToolBrushLand::handleMouseDown(S32 x, S32 y, MASK mask)
LLRegionPosition region_position( spot );
LLViewerRegion* regionp = region_position.getRegion();
- if (!canTerraform(regionp))
+ if (!canTerraformRegion(regionp))
{
- alertNoTerraform(regionp);
+ alertNoTerraformRegion(regionp);
return TRUE;
}
+ if (!canTerraformParcel(regionp))
+ {
+ alertNoTerraformParcel();
+ }
+
LLVector3 pos_region = region_position.getPositionRegion();
U32 grids = regionp->getLand().mGridsPerEdge;
S32 i = llclamp( (S32)pos_region.mV[VX], 0, (S32)grids );
@@ -408,13 +413,23 @@ BOOL LLToolBrushLand::handleMouseDown(S32 x, S32 y, MASK mask)
BOOL LLToolBrushLand::handleHover( S32 x, S32 y, MASK mask )
{
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolBrushLand ("
+ LL_DEBUGS("UserInput") << "hover handled by LLToolBrushLand ("
<< (hasMouseCapture() ? "active":"inactive")
- << ")" << llendl;
+ << ")" << LL_ENDL;
mMouseX = x;
mMouseY = y;
mGotHover = TRUE;
gViewerWindow->getWindow()->setCursor(UI_CURSOR_TOOLLAND);
+
+ LLVector3d spot;
+ if (gViewerWindow->mousePointOnLandGlobal(mMouseX, mMouseY, &spot))
+ {
+
+ spot.mdV[VX] = floor( spot.mdV[VX] + 0.5 );
+ spot.mdV[VY] = floor( spot.mdV[VY] + 0.5 );
+
+ LLViewerParcelMgr::getInstance()->setHoverParcel(spot);
+ }
return TRUE;
}
@@ -463,7 +478,7 @@ void LLToolBrushLand::render()
{
if(mGotHover)
{
- //llinfos << "LLToolBrushLand::render()" << llendl;
+ //LL_INFOS() << "LLToolBrushLand::render()" << LL_ENDL;
LLVector3d spot;
if(gViewerWindow->mousePointOnLandGlobal(mMouseX, mMouseY, &spot))
{
@@ -660,7 +675,7 @@ void LLToolBrushLand::redo()
}*/
// static
-bool LLToolBrushLand::canTerraform(LLViewerRegion* regionp) const
+bool LLToolBrushLand::canTerraformRegion(LLViewerRegion* regionp) const
{
if (!regionp) return false;
if (regionp->canManageEstate()) return true;
@@ -668,7 +683,22 @@ bool LLToolBrushLand::canTerraform(LLViewerRegion* regionp) const
}
// static
-void LLToolBrushLand::alertNoTerraform(LLViewerRegion* regionp)
+bool LLToolBrushLand::canTerraformParcel(LLViewerRegion* regionp) const
+{
+ LLParcel* selected_parcel = LLViewerParcelMgr::getInstance()->getHoverParcel();
+ bool is_terraform_allowed = false;
+ if (selected_parcel)
+ {
+ BOOL owner_release = LLViewerParcelMgr::isParcelOwnedByAgent(selected_parcel, GP_LAND_ALLOW_EDIT_LAND);
+ is_terraform_allowed = ( gAgent.canManageEstate() || (selected_parcel->getOwnerID() == regionp->getOwner()) || owner_release);
+ }
+
+ return is_terraform_allowed;
+}
+
+
+// static
+void LLToolBrushLand::alertNoTerraformRegion(LLViewerRegion* regionp)
{
if (!regionp) return;
@@ -678,6 +708,19 @@ void LLToolBrushLand::alertNoTerraform(LLViewerRegion* regionp)
}
+// static
+void LLToolBrushLand::alertNoTerraformParcel()
+{
+ LLParcel* selected_parcel = LLViewerParcelMgr::getInstance()->getHoverParcel();
+ if (selected_parcel)
+ {
+ LLSD args;
+ args["PARCEL"] = selected_parcel->getName();
+ LLNotificationsUtil::add("ParcelNoTerraforming", args);
+ }
+
+}
+
///============================================================================
/// Local function definitions
///============================================================================
diff --git a/indra/newview/lltoolbrush.h b/indra/newview/lltoolbrush.h
index fca275aa4..6aeea35b2 100644
--- a/indra/newview/lltoolbrush.h
+++ b/indra/newview/lltoolbrush.h
@@ -2,31 +2,25 @@
* @file lltoolbrush.h
* @brief toolbrush class header file
*
- * $LicenseInfo:firstyear=2002&license=viewergpl$
- *
- * Copyright (c) 2002-2009, Linden Research, Inc.
- *
+ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * Copyright (C) 2010, Linden Research, Inc.
*
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
*
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -87,10 +81,14 @@ protected:
const LLVector3& pos_world);
// Does region allow terraform, or are we a god?
- bool canTerraform(LLViewerRegion* regionp) const;
+ bool canTerraformRegion(LLViewerRegion* regionp) const;
+
+ bool canTerraformParcel(LLViewerRegion* regionp) const;
// Modal dialog that you can't terraform the region
- void alertNoTerraform(LLViewerRegion* regionp);
+ void alertNoTerraformRegion(LLViewerRegion* regionp);
+
+ void alertNoTerraformParcel();
protected:
F32 mStartingZ;
diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp
index 85cc032a3..f62cc8d0b 100644
--- a/indra/newview/lltoolcomp.cpp
+++ b/indra/newview/lltoolcomp.cpp
@@ -43,7 +43,6 @@
#include "lltoolmgr.h"
#include "lltoolselectrect.h"
#include "lltoolplacer.h"
-#include "llviewercamera.h" //
#include "llviewermenu.h"
#include "llviewerobject.h"
#include "llviewerwindow.h"
@@ -51,7 +50,7 @@
#include "llagentcamera.h"
#include "llfloatertools.h"
#include "llviewercontrol.h"
-
+#include "llviewercamera.h"
const S32 BUTTON_HEIGHT = 16;
const S32 BUTTON_WIDTH_SMALL = 32;
@@ -62,7 +61,7 @@ extern LLControlGroup gSavedSettings;
// we use this in various places instead of NULL
-static LLTool* sNullTool = new LLTool(std::string("null"), NULL);
+static LLPointer sNullTool(new LLTool(std::string("null"), NULL));
//-----------------------------------------------------------------------
// LLToolComposite
@@ -129,6 +128,13 @@ void LLToolComposite::handleSelect()
mSelected = TRUE;
}
+void LLToolComposite::handleDeselect()
+{
+ mCur->handleDeselect();
+ mCur = mDefault;
+ mSelected = FALSE;
+}
+
//----------------------------------------------------------------------------
// LLToolCompInspect
//----------------------------------------------------------------------------
@@ -400,6 +406,7 @@ LLTool* LLToolCompScale::getOverrideTool(MASK mask)
{
return LLToolCompRotate::getInstance();
}
+
return LLToolComposite::getOverrideTool(mask);
}
@@ -411,7 +418,6 @@ BOOL LLToolCompScale::handleDoubleClick(S32 x, S32 y, MASK mask)
// You should already have an object selected from the mousedown.
// If so, show its properties
gFloaterTools->showPanel(LLFloaterTools::PANEL_CONTENTS);
- //gBuildView->setPropertiesPanelOpen(TRUE);
return TRUE;
}
else
@@ -609,7 +615,6 @@ BOOL LLToolCompRotate::handleDoubleClick(S32 x, S32 y, MASK mask)
// You should already have an object selected from the mousedown.
// If so, show its properties
gFloaterTools->showPanel(LLFloaterTools::PANEL_CONTENTS);
- //gBuildView->setPropertiesPanelOpen(TRUE);
return TRUE;
}
else
@@ -638,7 +643,7 @@ void LLToolCompRotate::render()
LLToolCompGun::LLToolCompGun()
: LLToolComposite(std::string("Mouselook"))
- , mMenuShown(false), mTimerFOV(), mOriginalFOV(), mStartFOV(), mTargetFOV() //
+ , mMenuShown(false), mTimerFOV(), mOriginalFOV(), mStartFOV(), mTargetFOV()
{
mGun = new LLToolGun(this);
mGrab = new LLToolGrab(this);
@@ -647,11 +652,10 @@ LLToolCompGun::LLToolCompGun()
setCurrentTool(mGun);
mDefault = mGun;
- //
mTimerFOV.stop();
- //
}
+
LLToolCompGun::~LLToolCompGun()
{
delete mGun;
@@ -665,6 +669,45 @@ LLToolCompGun::~LLToolCompGun()
mNull = NULL;
}
+BOOL LLToolCompGun::handleMouseDown(S32 x, S32 y, MASK mask)
+{
+ // 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;
+ LLToolMgr::getInstance()->getCurrentToolset()->selectTool( (LLTool*) mGrab );
+
+ return LLToolGrab::getInstance()->handleMouseDown(x, y, mask);
+}
+
+BOOL LLToolCompGun::handleMouseUp(S32 x, S32 y, MASK mask)
+{
+ gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_UP);
+ setCurrentTool( (LLTool*) mGun );
+ return TRUE;
+}
+
+BOOL LLToolCompGun::handleDoubleClick(S32 x, S32 y, MASK mask)
+{
+ // 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;
+ LLToolMgr::getInstance()->getCurrentToolset()->selectTool( (LLTool*) mGrab );
+
+ return LLToolGrab::getInstance()->handleDoubleClick(x, y, mask);
+}
+
BOOL LLToolCompGun::handleHover(S32 x, S32 y, MASK mask)
{
// *NOTE: This hack is here to make mouselook kick in again after
@@ -700,48 +743,45 @@ BOOL LLToolCompGun::handleHover(S32 x, S32 y, MASK mask)
return TRUE;
}
-
-BOOL LLToolCompGun::handleMouseDown(S32 x, S32 y, MASK mask)
-{
- // 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;
- LLToolMgr::getInstance()->getCurrentToolset()->selectTool( (LLTool*) mGrab );
-
- return LLToolGrab::getInstance()->handleMouseDown(x, y, mask);
-}
-
-
-BOOL LLToolCompGun::handleDoubleClick(S32 x, S32 y, MASK mask)
-{
- // 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;
- LLToolMgr::getInstance()->getCurrentToolset()->selectTool( (LLTool*) mGrab );
-
- return LLToolGrab::getInstance()->handleDoubleClick(x, y, mask);
-}
-
-/* Singu Note: Moved to bottom, upstream is Exodus
BOOL LLToolCompGun::handleRightMouseDown(S32 x, S32 y, MASK mask)
-*/
-
-BOOL LLToolCompGun::handleMouseUp(S32 x, S32 y, MASK mask)
{
- gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_UP);
- setCurrentTool( (LLTool*) mGun );
+ // Singu Note: Beware the alt-click menu
+ if (gSavedSettings.getBOOL("LiruMouselookMenu") && mask & MASK_ALT)
+ {
+ mMenuShown = true;
+ return false;
+ }
+
+ LLViewerCamera& cam(LLViewerCamera::instance());
+ if (!mTimerFOV.getStarted())
+ {
+ mStartFOV = cam.getAndSaveDefaultFOV();
+ mOriginalFOV = mStartFOV;
+ }
+ else mStartFOV = cam.getDefaultFOV();
+
+ mTargetFOV = gSavedSettings.getF32("ExodusAlternativeFOV");
+ gSavedSettings.getBOOL("LiruMouselookInstantZoom") ? cam.setDefaultFOV(mTargetFOV) : mTimerFOV.start();
+ cam.mSavedFOVLoaded = false;
+
+ return TRUE;
+}
+
+BOOL LLToolCompGun::handleRightMouseUp(S32 x, S32 y, MASK mask)
+{
+ // Singu Note: Beware the alt-click menu
+ if (mMenuShown)
+ {
+ mMenuShown = false;
+ return LLToolComposite::handleRightMouseUp(x, y, mask);
+ }
+
+ LLViewerCamera& cam(LLViewerCamera::instance());
+ mStartFOV = cam.getDefaultFOV();
+ mTargetFOV = mOriginalFOV;
+ gSavedSettings.getBOOL("LiruMouselookInstantZoom") ? cam.setDefaultFOV(mTargetFOV) : mTimerFOV.start();
+ cam.mSavedFOVLoaded = false;
+
return TRUE;
}
@@ -771,49 +811,6 @@ void LLToolCompGun::handleDeselect()
setMouseCapture(FALSE);
}
-//
-
-BOOL LLToolCompGun::handleRightMouseUp(S32 x, S32 y, MASK mask)
-{
- // Singu Note: Beware the alt-click menu
- if (mMenuShown)
- {
- mMenuShown = false;
- return LLToolComposite::handleRightMouseUp(x, y, mask);
- }
-
- LLViewerCamera& cam(LLViewerCamera::instance());
- mStartFOV = cam.getDefaultFOV();
- mTargetFOV = mOriginalFOV;
- gSavedSettings.getBOOL("LiruMouselookInstantZoom") ? cam.setDefaultFOV(mTargetFOV) : mTimerFOV.start();
- cam.mSavedFOVLoaded = false;
-
- return TRUE;
-}
-
-BOOL LLToolCompGun::handleRightMouseDown(S32 x, S32 y, MASK mask)
-{
- // Singu Note: Beware the alt-click menu
- if (gSavedSettings.getBOOL("LiruMouselookMenu") && mask & MASK_ALT)
- {
- mMenuShown = true;
- return false;
- }
-
- LLViewerCamera& cam(LLViewerCamera::instance());
- if (!mTimerFOV.getStarted())
- {
- mStartFOV = cam.getAndSaveDefaultFOV();
- mOriginalFOV = mStartFOV;
- }
- else mStartFOV = cam.getDefaultFOV();
-
- mTargetFOV = gSavedSettings.getF32("ExodusAlternativeFOV");
- gSavedSettings.getBOOL("LiruMouselookInstantZoom") ? cam.setDefaultFOV(mTargetFOV) : mTimerFOV.start();
- cam.mSavedFOVLoaded = false;
-
- return TRUE;
-}
BOOL LLToolCompGun::handleScrollWheel(S32 x, S32 y, S32 clicks)
{
@@ -829,16 +826,19 @@ BOOL LLToolCompGun::handleScrollWheel(S32 x, S32 y, S32 clicks)
llclamp(mTargetFOV -= (0.05f * -clicks), 0.1f, 3.0f)
);
- gSavedSettings.getBOOL("LiruMouselookInstantZoom") ? cam.setDefaultFOV(mTargetFOV) : mTimerFOV.start();
+ if (gSavedSettings.getBOOL("LiruMouselookInstantZoom"))
+ cam.setDefaultFOV(mTargetFOV);
+ else
+ mTimerFOV.start();
cam.mSavedFOVLoaded = false;
}
- else if (clicks > 0) gAgentCamera.changeCameraToDefault();
-
+ else if (clicks > 0)
+ {
+ gAgentCamera.changeCameraToDefault();
+ }
return TRUE;
}
-// Zoom related stuff...
-
void LLToolCompGun::draw()
{
if (mTimerFOV.getStarted())
@@ -857,7 +857,5 @@ void LLToolCompGun::draw()
}
else mTimerFOV.stop();
}
- LLToolComposite::draw(); // Singu Note: We call parent here, instead of being clueless and adding to LLViewerWindow::draw for crosshairs and such
+ LLToolComposite::draw();
}
-
-//
diff --git a/indra/newview/lltoolcomp.h b/indra/newview/lltoolcomp.h
index c1169f0ec..bf4ec9b17 100644
--- a/indra/newview/lltoolcomp.h
+++ b/indra/newview/lltoolcomp.h
@@ -62,7 +62,7 @@ public:
virtual BOOL clipMouseWhenDown() { return mCur->clipMouseWhenDown(); }
virtual void handleSelect();
- virtual void handleDeselect() { mCur->handleDeselect(); mCur = mDefault; mSelected = FALSE; }
+ virtual void handleDeselect();
virtual void render() { mCur->render(); }
virtual void draw() { mCur->draw(); }
@@ -78,9 +78,10 @@ public:
{ mCur->localPointToScreen(local_x, local_y, screen_x, screen_y); }
BOOL isSelecting();
+ LLTool* getCurrentTool() { return mCur; }
+
protected:
void setCurrentTool( LLTool* new_tool );
- LLTool* getCurrentTool() { return mCur; }
// In hover handler, call this to auto-switch tools
void setToolFromMask( MASK mask, LLTool *normal );
@@ -213,15 +214,15 @@ public:
LLToolCompGun();
virtual ~LLToolCompGun();
- virtual void draw(); //
+ virtual void draw();
// Overridden from LLToolComposite
- virtual BOOL handleHover(S32 x, S32 y, MASK mask);
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
- virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
- virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask);
- virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
+ virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
+ virtual BOOL handleHover(S32 x, S32 y, MASK mask);
+ virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
+ virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask);
virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
virtual void onMouseCaptureLost();
virtual void handleSelect();
@@ -233,12 +234,12 @@ protected:
LLToolGrab* mGrab;
LLTool* mNull;
- //
private:
bool mMenuShown;
LLTimer mTimerFOV;
- F32 mOriginalFOV, mStartFOV, mTargetFOV;
- //
+ F32 mOriginalFOV,
+ mStartFOV,
+ mTargetFOV;
};
diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp
index 2cdfd172a..2f2a32149 100644
--- a/indra/newview/lltoolfocus.cpp
+++ b/indra/newview/lltoolfocus.cpp
@@ -313,6 +313,7 @@ BOOL LLToolCamera::handleMouseUp(S32 x, S32 y, MASK mask)
return TRUE;
}
+
BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
{
if (gViewerWindow->getRightMouseDown())
@@ -343,7 +344,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
{
if (!mValidClickPoint)
{
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolFocus [invalid point]" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolFocus [invalid point]" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_NO);
gViewerWindow->showCursor();
return TRUE;
@@ -370,7 +371,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
gViewerWindow->moveCursorToCenter();
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolFocus [active]" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolFocus [active]" << LL_ENDL;
}
else if ( gCameraBtnPan ||
mask == MASK_PAN ||
@@ -398,7 +399,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
gViewerWindow->moveCursorToCenter();
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPan" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolPan" << LL_ENDL;
}
else if (gCameraBtnZoom)
{
@@ -430,7 +431,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
gViewerWindow->moveCursorToCenter();
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolZoom" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolZoom" << LL_ENDL;
}
}
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index 8cafb2b35..1b112943f 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -128,9 +128,10 @@ BOOL LLToolPie::handleRightMouseDown(S32 x, S32 y, MASK mask)
mPick.mKeyMask = mask;
// claim not handled so UI focus stays same
-
- handleRightClickPick();
-
+ if (gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK || gSavedSettings.getBOOL("LiruMouselookMenu"))
+ {
+ handleRightClickPick();
+ }
return FALSE;
}
@@ -818,7 +819,8 @@ void LLToolPie::handleDeselect()
LLTool* LLToolPie::getOverrideTool(MASK mask)
{
- if (gSavedSettings.getBOOL("EnableGrab"))
+ static LLCachedControl enable_grab(gSavedSettings, "EnableGrab", true);
+ if (enable_grab)
{
if (mask == MASK_CONTROL)
{
@@ -956,7 +958,7 @@ bool LLToolPie::handleMediaHover(const LLPickInfo& pick)
LLPointer objectp = pick.getObject();
- // Early out cases. Must clear mouse over media focus flag
+ // Early out cases. Must clear media hover.
// did not hit an object or did not hit a valid face
if ( objectp.isNull() ||
pick.mObjectFace < 0 ||
@@ -1230,8 +1232,12 @@ BOOL LLToolPie::handleRightClickPick()
void LLToolPie::showVisualContextMenuEffect()
{
//
- if (gSavedSettings.getBOOL("DisablePointAtAndBeam")) return;
+ if (gSavedSettings.getBOOL("DisablePointAtAndBeam"))
+ {
+ return;
+ }
//
+
// VEFFECT: ShowPie
LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_SPHERE, TRUE);
effectp->setPositionGlobal(mPick.mPosGlobal);
diff --git a/indra/newview/lltoolselect.h b/indra/newview/lltoolselect.h
index 37f28ccc7..4d7606ec2 100644
--- a/indra/newview/lltoolselect.h
+++ b/indra/newview/lltoolselect.h
@@ -2,31 +2,25 @@
* @file lltoolselect.h
* @brief LLToolSelect class header file
*
- * $LicenseInfo:firstyear=2001&license=viewergpl$
- *
- * Copyright (c) 2001-2009, Linden Research, Inc.
- *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
*
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -40,7 +34,7 @@
class LLObjectSelection;
-class LLToolSelect : public LLTool, public LLSingleton
+class LLToolSelect : public LLTool
{
public:
LLToolSelect( LLToolComposite* composite );
diff --git a/indra/newview/lltoolselectrect.cpp b/indra/newview/lltoolselectrect.cpp
index f57820afd..07f0cae82 100644
--- a/indra/newview/lltoolselectrect.cpp
+++ b/indra/newview/lltoolselectrect.cpp
@@ -38,7 +38,6 @@
// Library includes
#include "llgl.h"
#include "llrender.h"
-#include "lldarray.h"
// Viewer includes
#include "llviewercontrol.h"
@@ -152,11 +151,11 @@ BOOL LLToolSelectRect::handleHover(S32 x, S32 y, MASK mask)
return LLToolSelect::handleHover(x, y, mask);
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolSelectRect (active)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolSelectRect (active)" << LL_ENDL;
}
else
{
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolSelectRect (inactive)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolSelectRect (inactive)" << LL_ENDL;
}
gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
diff --git a/indra/newview/lltoolselectrect.h b/indra/newview/lltoolselectrect.h
index e79489795..00d774b21 100644
--- a/indra/newview/lltoolselectrect.h
+++ b/indra/newview/lltoolselectrect.h
@@ -2,31 +2,25 @@
* @file lltoolselectrect.h
* @brief A tool to select multiple objects with a screen-space rectangle.
*
- * $LicenseInfo:firstyear=2001&license=viewergpl$
- *
- * Copyright (c) 2001-2009, Linden Research, Inc.
- *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
*
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/