aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lltoolpie.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2010-10-09 03:27:47 -0700
committerMcCabe Maxsted2010-10-09 03:27:47 -0700
commit1866bc2af39189c17b636970d4df7edc983c1830 (patch)
treee60963a49832280cf3d2d9b5a8b589853469caee /linden/indra/newview/lltoolpie.cpp
parentUse all those cores for compile (diff)
downloadmeta-impy-1866bc2af39189c17b636970d4df7edc983c1830.zip
meta-impy-1866bc2af39189c17b636970d4df7edc983c1830.tar.gz
meta-impy-1866bc2af39189c17b636970d4df7edc983c1830.tar.bz2
meta-impy-1866bc2af39189c17b636970d4df7edc983c1830.tar.xz
Applied RLVa-1.1.2-Imprudence.patch by Kitty Barnett
Diffstat (limited to 'linden/indra/newview/lltoolpie.cpp')
-rw-r--r--linden/indra/newview/lltoolpie.cpp117
1 files changed, 74 insertions, 43 deletions
diff --git a/linden/indra/newview/lltoolpie.cpp b/linden/indra/newview/lltoolpie.cpp
index 2b63a24..02ad008 100644
--- a/linden/indra/newview/lltoolpie.cpp
+++ b/linden/indra/newview/lltoolpie.cpp
@@ -68,6 +68,10 @@
68#include "llui.h" 68#include "llui.h"
69#include "llweb.h" 69#include "llweb.h"
70 70
71// [RLVa:KB]
72#include "rlvhandler.h"
73// [/RLVa:KB]
74
71extern void handle_buy(void*); 75extern void handle_buy(void*);
72 76
73extern BOOL gDebugClicks; 77extern BOOL gDebugClicks;
@@ -167,10 +171,10 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show)
167 // If it's a left-click, and we have a special action, do it. 171 // If it's a left-click, and we have a special action, do it.
168 if (useClickAction(always_show, mask, object, parent)) 172 if (useClickAction(always_show, mask, object, parent))
169 { 173 {
170// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f 174// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l
171 // Block left-click special actions (fallback code really since LLToolSelect::handleObjectSelection() wouldn't select it anyway) 175 // Block left-click special actions when fartouch restricted
172 if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && 176 if ( (rlv_handler_t::isEnabled()) &&
173 (dist_vec_squared(gAgent.getPositionAgent(), mPick.mIntersection) > 1.5f * 1.5f) ) 177 (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (!gRlvHandler.canTouch(object, mPick.mObjectOffset)) )
174 { 178 {
175 return TRUE; 179 return TRUE;
176 } 180 }
@@ -253,6 +257,14 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show)
253 ((object->usePhysics() || (parent && !parent->isAvatar() && parent->usePhysics())) || touchable) && 257 ((object->usePhysics() || (parent && !parent->isAvatar() && parent->usePhysics())) || touchable) &&
254 !always_show) 258 !always_show)
255 { 259 {
260// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l
261 // Triggered by left-clicking on a touchable object
262 if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(object, mPick.mObjectOffset)) )
263 {
264 return LLTool::handleMouseDown(x, y, mask);
265 }
266// [/RLVa:KB]
267
256 gGrabTransientTool = this; 268 gGrabTransientTool = this;
257 LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolGrab::getInstance() ); 269 LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolGrab::getInstance() );
258 return LLToolGrab::getInstance()->handleObjectHit( mPick ); 270 return LLToolGrab::getInstance()->handleObjectHit( mPick );
@@ -377,20 +389,17 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show)
377 } 389 }
378 390
379// gPieAvatar->show(x, y, mPieMouseButtonDown); 391// gPieAvatar->show(x, y, mPieMouseButtonDown);
380// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f 392// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l
381 #ifdef RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK 393 // Don't show the pie menu on empty selection when fartouch/interaction restricted [see LLToolSelect::handleObjectSelection()]
382 // If we have an empty selection under @fartouch=n don't show the pie menu but play the "operation block" sound 394 if ( (!rlv_handler_t::isEnabled()) || (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) ||
383 if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) || (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) ) 395 (!gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) )
384 { 396 {
385 #endif // RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK 397 gPieAvatar->show(x, y, mPieMouseButtonDown);
386 gPieAvatar->show(x, y, mPieMouseButtonDown); 398 }
387 #ifdef RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK 399 else
388 } 400 {
389 else 401 make_ui_sound("UISndInvalidOp");
390 { 402 }
391 make_ui_sound("UISndInvalidOp");
392 }
393 #endif // RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK
394// [/RLVa:KB] 403// [/RLVa:KB]
395 } 404 }
396 else if (object->isAttachment() && !object->isHUDAttachment()) 405 else if (object->isAttachment() && !object->isHUDAttachment())
@@ -421,31 +430,28 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show)
421 //gMuteObjectPieMenu->setLabel("Mute"); 430 //gMuteObjectPieMenu->setLabel("Mute");
422 } 431 }
423 432
424// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f 433// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l
425 #ifdef RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK 434 // Don't show the pie menu on empty selection when fartouch/interaction restricted
426 // If we have an empty selection under @fartouch=n don't show the pie menu but play the "operation block" sound 435 // (not entirely accurate in case of Tools / Select Only XXX [see LLToolSelect::handleObjectSelection()]
427 // (not entirely accurate in case of Tools / Select Only XXX [see LLToolSelect::handleObjectSelection()] 436 if ( (!rlv_handler_t::isEnabled()) || (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) ||
428 if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) || (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) ) 437 (!gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) )
429 { 438 {
430 #endif // RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK
431// [/RLVa:KB] 439// [/RLVa:KB]
432 gPieObject->show(x, y, mPieMouseButtonDown); 440 gPieObject->show(x, y, mPieMouseButtonDown);
433 441
434 // VEFFECT: ShowPie object 442 // VEFFECT: ShowPie object
435 // Don't show when you click on someone else, it freaks them 443 // Don't show when you click on someone else, it freaks them
436 // out. 444 // out.
437 LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_SPHERE, TRUE); 445 LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_SPHERE, TRUE);
438 effectp->setPositionGlobal(mPick.mPosGlobal); 446 effectp->setPositionGlobal(mPick.mPosGlobal);
439 effectp->setColor(LLColor4U(gAgent.getEffectColor())); 447 effectp->setColor(LLColor4U(gAgent.getEffectColor()));
440 effectp->setDuration(0.25f); 448 effectp->setDuration(0.25f);
441// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f 449// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f
442 #ifdef RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK 450 }
443 } 451 else
444 else 452 {
445 { 453 make_ui_sound("UISndInvalidOp");
446 make_ui_sound("UISndInvalidOp"); 454 }
447 }
448 #endif // RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK
449// [/RLVa:KB] 455// [/RLVa:KB]
450 } 456 }
451 } 457 }
@@ -514,7 +520,11 @@ ECursorType cursor_from_object(LLViewerObject* object)
514 switch(click_action) 520 switch(click_action)
515 { 521 {
516 case CLICK_ACTION_SIT: 522 case CLICK_ACTION_SIT:
517 if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->mIsSitting)) // not already sitting? 523// if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->mIsSitting)) // not already sitting?
524// [RLVa:KB] - Checked: 2009-12-22 (RLVa-1.1.0k) | Added: RLVa-1.1.0j
525 if ( ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->mIsSitting)) && // not already sitting?
526 ((!rlv_handler_t::isEnabled()) || (gRlvHandler.canSit(object, gViewerWindow->getHoverPick().mObjectOffset))) )
527// [/RLVa:KB]
518 { 528 {
519 cursor = UI_CURSOR_TOOLSIT; 529 cursor = UI_CURSOR_TOOLSIT;
520 } 530 }
@@ -619,7 +629,21 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
619 LLViewerObject *parent = NULL; 629 LLViewerObject *parent = NULL;
620 if (gHoverView) 630 if (gHoverView)
621 { 631 {
622 object = gViewerWindow->getHoverPick().getObject(); 632// object = gViewerWindow->getHoverPick().getObject();
633// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l
634 // Block all special click action cursors when:
635 // - @fartouch=n restricted and the object is out of range
636 // - @interact=n restricted and the object isn't a HUD attachment
637 const LLPickInfo& pick = gViewerWindow->getHoverPick();
638 object = pick.getObject();
639 if ( (object) && (rlv_handler_t::isEnabled()) &&
640 ( ((gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH))) && (!gRlvHandler.canTouch(object, pick.mObjectOffset)) ||
641 ((gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) && (!object->isHUDAttachment())) ) )
642 {
643 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
644 return TRUE;
645 }
646// [/RLVa:KB]
623 } 647 }
624 648
625 if (object) 649 if (object)
@@ -633,6 +657,13 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
633 gViewerWindow->getWindow()->setCursor(cursor); 657 gViewerWindow->getWindow()->setCursor(cursor);
634 lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; 658 lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
635 } 659 }
660// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Added: RLVa-1.1.0l
661 else if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(object)) )
662 {
663 // Block showing the "grab" or "touch" cursor if we can't touch the object (@fartouch=n is handled above)
664 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
665 }
666// [/RLVa:KB]
636 else if ((object && !object->isAvatar() && object->usePhysics()) 667 else if ((object && !object->isAvatar() && object->usePhysics())
637 || (parent && !parent->isAvatar() && parent->usePhysics())) 668 || (parent && !parent->isAvatar() && parent->usePhysics()))
638 { 669 {