aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lltoolpie.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/lltoolpie.cpp')
-rw-r--r--linden/indra/newview/lltoolpie.cpp41
1 files changed, 29 insertions, 12 deletions
diff --git a/linden/indra/newview/lltoolpie.cpp b/linden/indra/newview/lltoolpie.cpp
index e4be8ce..3eaa275 100644
--- a/linden/indra/newview/lltoolpie.cpp
+++ b/linden/indra/newview/lltoolpie.cpp
@@ -62,6 +62,7 @@
62LLToolPie *gToolPie = NULL; 62LLToolPie *gToolPie = NULL;
63 63
64LLViewerObject* LLToolPie::sClickActionObject = NULL; 64LLViewerObject* LLToolPie::sClickActionObject = NULL;
65LLHandle<LLObjectSelection> LLToolPie::sLeftClickSelection = NULL;
65 66
66extern void handle_buy(void*); 67extern void handle_buy(void*);
67 68
@@ -79,8 +80,7 @@ LLToolPie::LLToolPie()
79 80
80BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) 81BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask)
81{ 82{
82 // if buttons swapped, don't pick transparent so users can't "pay" 83 //left mouse down always picks transparent
83 // transparent objects
84 gViewerWindow->hitObjectOrLandGlobalAsync(x, y, mask, leftMouseCallback, 84 gViewerWindow->hitObjectOrLandGlobalAsync(x, y, mask, leftMouseCallback,
85 TRUE, TRUE); 85 TRUE, TRUE);
86 mGrabMouseButtonDown = TRUE; 86 mGrabMouseButtonDown = TRUE;
@@ -188,19 +188,19 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show)
188 || parent && parent->flagTakesMoney()) 188 || parent && parent->flagTakesMoney())
189 { 189 {
190 sClickActionObject = parent; 190 sClickActionObject = parent;
191 LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE); 191 sLeftClickSelection = LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE);
192 return TRUE; 192 return TRUE;
193 } 193 }
194 break; 194 break;
195 case CLICK_ACTION_BUY: 195 case CLICK_ACTION_BUY:
196 sClickActionObject = parent; 196 sClickActionObject = parent;
197 LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE); 197 sLeftClickSelection = LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE);
198 return TRUE; 198 return TRUE;
199 case CLICK_ACTION_OPEN: 199 case CLICK_ACTION_OPEN:
200 if (parent && parent->allowOpen()) 200 if (parent && parent->allowOpen())
201 { 201 {
202 sClickActionObject = parent; 202 sClickActionObject = parent;
203 LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE); 203 sLeftClickSelection = LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE);
204 } 204 }
205 return TRUE; 205 return TRUE;
206 } 206 }
@@ -213,7 +213,7 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show)
213 !always_show) 213 !always_show)
214 { 214 {
215 gGrabTransientTool = this; 215 gGrabTransientTool = this;
216 gCurrentToolset->selectTool( gToolGrab ); 216 gToolMgr->getCurrentToolset()->selectTool( gToolGrab );
217 return gToolGrab->handleObjectHit( object, x, y, mask); 217 return gToolGrab->handleObjectHit( object, x, y, mask);
218 } 218 }
219 219
@@ -272,8 +272,8 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show)
272 // Spawn pie menu 272 // Spawn pie menu
273 if (mHitLand) 273 if (mHitLand)
274 { 274 {
275 gParcelMgr->selectParcelAt( gLastHitPosGlobal ); 275 LLParcelSelectionHandle selection = gParcelMgr->selectParcelAt( gLastHitPosGlobal );
276 276 gMenuHolder->setParcelSelection(selection);
277 gPieLand->show(x, y, mPieMouseButtonDown); 277 gPieLand->show(x, y, mPieMouseButtonDown);
278 278
279 // VEFFECT: ShowPie 279 // VEFFECT: ShowPie
@@ -288,6 +288,8 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show)
288 } 288 }
289 else if (object) 289 else if (object)
290 { 290 {
291 gMenuHolder->setObjectSelection(gSelectMgr->getSelection());
292
291 if (object->isAvatar() 293 if (object->isAvatar()
292 || (object->isAttachment() && !object->isHUDAttachment() && !object->permYouOwner())) 294 || (object->isAttachment() && !object->isHUDAttachment() && !object->permYouOwner()))
293 { 295 {
@@ -321,7 +323,7 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show)
321 { 323 {
322 // BUG: What about chatting child objects? 324 // BUG: What about chatting child objects?
323 LLString name; 325 LLString name;
324 LLSelectNode* node = gSelectMgr->getFirstRootNode(); 326 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode();
325 if (node) 327 if (node)
326 { 328 {
327 name = node->mName; 329 name = node->mName;
@@ -413,10 +415,11 @@ void LLToolPie::selectionPropertiesReceived()
413 return; 415 return;
414 } 416 }
415 417
416 if (sClickActionObject 418 if (!sLeftClickSelection->isEmpty())
417 && !sClickActionObject->isDead())
418 { 419 {
419 LLViewerObject* root = gSelectMgr->getFirstRootObject(); 420 LLViewerObject* root = sLeftClickSelection->getFirstRootObject();
421 // since we don't currently have a way to lock a selection, it could have changed
422 // after we initially clicked on the object
420 if (root == sClickActionObject) 423 if (root == sClickActionObject)
421 { 424 {
422 U8 action = root->getClickAction(); 425 U8 action = root->getClickAction();
@@ -436,6 +439,7 @@ void LLToolPie::selectionPropertiesReceived()
436 } 439 }
437 } 440 }
438 } 441 }
442 sLeftClickSelection = NULL;
439 sClickActionObject = NULL; 443 sClickActionObject = NULL;
440} 444}
441 445
@@ -622,6 +626,19 @@ void LLToolPie::handleDeselect()
622 gSelectMgr->validateSelection(); 626 gSelectMgr->validateSelection();
623} 627}
624 628
629LLTool* LLToolPie::getOverrideTool(MASK mask)
630{
631 if (mask == MASK_CONTROL)
632 {
633 return gToolGrab;
634 }
635 else if (mask == (MASK_CONTROL | MASK_SHIFT))
636 {
637 return gToolGrab;
638 }
639
640 return LLTool::getOverrideTool(mask);
641}
625 642
626void LLToolPie::stopEditing() 643void LLToolPie::stopEditing()
627{ 644{