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.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/linden/indra/newview/lltoolpie.cpp b/linden/indra/newview/lltoolpie.cpp
index 3eaa275..4b29303 100644
--- a/linden/indra/newview/lltoolpie.cpp
+++ b/linden/indra/newview/lltoolpie.cpp
@@ -63,6 +63,7 @@ LLToolPie *gToolPie = NULL;
63 63
64LLViewerObject* LLToolPie::sClickActionObject = NULL; 64LLViewerObject* LLToolPie::sClickActionObject = NULL;
65LLHandle<LLObjectSelection> LLToolPie::sLeftClickSelection = NULL; 65LLHandle<LLObjectSelection> LLToolPie::sLeftClickSelection = NULL;
66U8 LLToolPie::sClickAction = 0;
66 67
67extern void handle_buy(void*); 68extern void handle_buy(void*);
68 69
@@ -164,17 +165,17 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show)
164 // If it's a left-click, and we have a special action, do it. 165 // If it's a left-click, and we have a special action, do it.
165 if (useClickAction(always_show, mask, object, parent)) 166 if (useClickAction(always_show, mask, object, parent))
166 { 167 {
167 U8 click_action = 0; 168 sClickAction = 0;
168 if (object && object->getClickAction()) 169 if (object && object->getClickAction())
169 { 170 {
170 click_action = object->getClickAction(); 171 sClickAction = object->getClickAction();
171 } 172 }
172 else if (parent && parent->getClickAction()) 173 else if (parent && parent->getClickAction())
173 { 174 {
174 click_action = parent->getClickAction(); 175 sClickAction = parent->getClickAction();
175 } 176 }
176 177
177 switch(click_action) 178 switch(sClickAction)
178 { 179 {
179 case CLICK_ACTION_TOUCH: 180 case CLICK_ACTION_TOUCH:
180 default: 181 default:
@@ -187,8 +188,9 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show)
187 if (object && object->flagTakesMoney() 188 if (object && object->flagTakesMoney()
188 || parent && parent->flagTakesMoney()) 189 || parent && parent->flagTakesMoney())
189 { 190 {
190 sClickActionObject = parent; 191 // pay event goes to object actually clicked on
191 sLeftClickSelection = LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE); 192 sClickActionObject = object;
193 sLeftClickSelection = LLToolSelect::handleObjectSelection(object, MASK_NONE, FALSE, TRUE);
192 return TRUE; 194 return TRUE;
193 } 195 }
194 break; 196 break;
@@ -417,13 +419,12 @@ void LLToolPie::selectionPropertiesReceived()
417 419
418 if (!sLeftClickSelection->isEmpty()) 420 if (!sLeftClickSelection->isEmpty())
419 { 421 {
420 LLViewerObject* root = sLeftClickSelection->getFirstRootObject(); 422 LLViewerObject* selected_object = sLeftClickSelection->getPrimaryObject();
421 // since we don't currently have a way to lock a selection, it could have changed 423 // since we don't currently have a way to lock a selection, it could have changed
422 // after we initially clicked on the object 424 // after we initially clicked on the object
423 if (root == sClickActionObject) 425 if (selected_object == sClickActionObject)
424 { 426 {
425 U8 action = root->getClickAction(); 427 switch (sClickAction)
426 switch (action)
427 { 428 {
428 case CLICK_ACTION_BUY: 429 case CLICK_ACTION_BUY:
429 handle_buy(NULL); 430 handle_buy(NULL);
@@ -441,6 +442,7 @@ void LLToolPie::selectionPropertiesReceived()
441 } 442 }
442 sLeftClickSelection = NULL; 443 sLeftClickSelection = NULL;
443 sClickActionObject = NULL; 444 sClickActionObject = NULL;
445 sClickAction = 0;
444} 446}
445 447
446BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) 448BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)