summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolpie.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltoolpie.cpp')
-rw-r--r--indra/newview/lltoolpie.cpp26
1 files changed, 21 insertions, 5 deletions
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index 5525c359fc..beb16c267e 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -70,6 +70,7 @@
#include "llworld.h"
#include "llui.h"
#include "llweb.h"
+#include "pipeline.h" // setHighlightObject
extern BOOL gDebugClicks;
@@ -391,24 +392,24 @@ ECursorType cursor_from_object(LLViewerObject* object)
case CLICK_ACTION_SIT:
if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->isSitting())) // not already sitting?
{
- cursor = UI_CURSOR_TOOLSIT;
+ cursor = UI_CURSOR_HAND;
}
break;
case CLICK_ACTION_BUY:
- cursor = UI_CURSOR_TOOLBUY;
+ cursor = UI_CURSOR_HAND;
break;
case CLICK_ACTION_OPEN:
// Open always opens the parent.
if (parent && parent->allowOpen())
{
- cursor = UI_CURSOR_TOOLOPEN;
+ cursor = UI_CURSOR_HAND;
}
break;
case CLICK_ACTION_PAY:
if ((object && object->flagTakesMoney())
|| (parent && parent->flagTakesMoney()))
{
- cursor = UI_CURSOR_TOOLPAY;
+ cursor = UI_CURSOR_HAND;
}
break;
case CLICK_ACTION_PLAY:
@@ -472,7 +473,9 @@ void LLToolPie::selectionPropertiesReceived()
BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
{
mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE);
-
+
+ // Show screen-space highlight glow effect
+ bool show_highlight = false;
LLViewerObject *parent = NULL;
LLViewerObject *object = mHoverPick.getObject();
@@ -483,24 +486,28 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
if (object && useClickAction(mask, object, parent))
{
+ show_highlight = true;
ECursorType cursor = cursor_from_object(object);
gViewerWindow->setCursor(cursor);
lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
}
else if (handleMediaHover(mHoverPick))
{
+ show_highlight = true;
// cursor set by media object
lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
}
else if ((object && !object->isAvatar() && object->usePhysics())
|| (parent && !parent->isAvatar() && parent->usePhysics()))
{
+ show_highlight = true;
gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB);
lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
}
else if ( (object && object->flagHandleTouch())
|| (parent && parent->flagHandleTouch()))
{
+ show_highlight = true;
gViewerWindow->setCursor(UI_CURSOR_HAND);
lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
}
@@ -519,6 +526,15 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
}
}
+ static LLCachedControl<bool> enable_highlight(
+ gSavedSettings, "RenderHighlightEnable", false);
+ LLDrawable* drawable = NULL;
+ if (enable_highlight && show_highlight && object)
+ {
+ drawable = object->mDrawable;
+ }
+ gPipeline.setHighlightObject(drawable);
+
return TRUE;
}