diff options
Diffstat (limited to 'indra/newview/lltoolpie.cpp')
-rwxr-xr-x | indra/newview/lltoolpie.cpp | 51 |
1 files changed, 31 insertions, 20 deletions
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 1c362c18e0..e4353aafaa 100755 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -42,6 +42,7 @@ #include "llfloaterscriptdebug.h" #include "lltooltip.h" #include "llhudeffecttrail.h" +#include "llhudicon.h" #include "llhudmanager.h" #include "llkeyboard.h" #include "llmediaentry.h" @@ -438,8 +439,12 @@ ECursorType LLToolPie::cursorFromObject(LLViewerObject* object) break; case CLICK_ACTION_BUY: if ( mClickActionBuyEnabled ) - { - cursor = UI_CURSOR_TOOLBUY; + { + LLSelectNode* node = LLSelectMgr::getInstance()->getHoverNode(); + if (!node || node->mSaleInfo.isForSale()) + { + cursor = UI_CURSOR_TOOLBUY; + } } break; case CLICK_ACTION_OPEN: @@ -543,6 +548,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE); LLViewerObject *parent = NULL; LLViewerObject *object = mHoverPick.getObject(); + LLSelectMgr::getInstance()->setHoverObject(object, mHoverPick.mObjectFace); if (object) { parent = object->getRootEdit(); @@ -557,7 +563,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) // could disable it here. show_highlight = true; // cursor set by media object - lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL; } else if (!mMouseOutsideSlop && mMouseButtonDown @@ -594,7 +600,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) show_highlight = true; ECursorType cursor = cursorFromObject(click_action_object); gViewerWindow->setCursor(cursor); - lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL; } else if ((object && !object->isAvatar() && object->flagUsePhysics()) @@ -602,19 +608,19 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) { show_highlight = true; gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB); - lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL; } 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; + LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL; } else { gViewerWindow->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; + LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL; } } @@ -706,7 +712,7 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) { if (gDebugClicks) { - llinfos << "LLToolPie handleDoubleClick (becoming mouseDown)" << llendl; + LL_INFOS() << "LLToolPie handleDoubleClick (becoming mouseDown)" << LL_ENDL; } if (gSavedSettings.getBOOL("DoubleClickAutoPilot")) @@ -1305,7 +1311,16 @@ void LLToolPie::handleDeselect() } // remove temporary selection for pie menu LLSelectMgr::getInstance()->setHoverObject(NULL); - LLSelectMgr::getInstance()->validateSelection(); + + // Menu may be still up during transfer to different tool. + // toolfocus and toolgrab should retain menu, they will clear it if needed + MASK override_mask = gKeyboard ? gKeyboard->currentMask(TRUE) : 0; + if (gMenuHolder && (!gMenuHolder->getVisible() || (override_mask & (MASK_ALT | MASK_CONTROL)) == 0)) + { + // in most cases menu is useless without correct selection, so either keep both or discard both + gMenuHolder->hideMenus(); + LLSelectMgr::getInstance()->validateSelection(); + } } LLTool* LLToolPie::getOverrideTool(MASK mask) @@ -1671,17 +1686,7 @@ BOOL LLToolPie::handleRightClickPick() { name = node->mName; } - std::string mute_msg; - if (LLMuteList::getInstance()->isMuted(object->getID(), name)) - { - mute_msg = LLTrans::getString("UnmuteObject"); - } - else - { - mute_msg = LLTrans::getString("MuteObject2"); - } - - gMenuHolder->getChild<LLUICtrl>("Object Mute")->setValue(mute_msg); + gMenuObject->show(x, y); showVisualContextMenuEffect(); @@ -1695,6 +1700,12 @@ BOOL LLToolPie::handleRightClickPick() } } + // non UI object - put focus back "in world" + if (gFocusMgr.getKeyboardFocus()) + { + gFocusMgr.setKeyboardFocus(NULL); + } + LLTool::handleRightMouseDown(x, y, mask); // We handled the event. return TRUE; |