diff options
Diffstat (limited to 'linden/indra/newview/lltoolcomp.cpp')
-rw-r--r-- | linden/indra/newview/lltoolcomp.cpp | 83 |
1 files changed, 32 insertions, 51 deletions
diff --git a/linden/indra/newview/lltoolcomp.cpp b/linden/indra/newview/lltoolcomp.cpp index 7bf99f0..2ec1d8e 100644 --- a/linden/indra/newview/lltoolcomp.cpp +++ b/linden/indra/newview/lltoolcomp.cpp | |||
@@ -43,6 +43,7 @@ | |||
43 | #include "llmaniptranslate.h" | 43 | #include "llmaniptranslate.h" |
44 | #include "llmenugl.h" // for right-click menu hack | 44 | #include "llmenugl.h" // for right-click menu hack |
45 | #include "llselectmgr.h" | 45 | #include "llselectmgr.h" |
46 | #include "lltoolface.h" | ||
46 | #include "lltoolfocus.h" | 47 | #include "lltoolfocus.h" |
47 | #include "lltoolgrab.h" | 48 | #include "lltoolgrab.h" |
48 | #include "lltoolgun.h" | 49 | #include "lltoolgun.h" |
@@ -131,6 +132,36 @@ void LLToolComposite::handleSelect() | |||
131 | mSelected = TRUE; | 132 | mSelected = TRUE; |
132 | } | 133 | } |
133 | 134 | ||
135 | |||
136 | LLTool* LLToolComposite::getOverrideTool(MASK mask) | ||
137 | { | ||
138 | if (gKeyboard->getKeyDown('M') && | ||
139 | ((mask == (MASK_ALT | MASK_CONTROL)) || (mask == (MASK_ALT | MASK_CONTROL | MASK_SHIFT)))) | ||
140 | { | ||
141 | return QToolAlign::getInstance(); | ||
142 | } | ||
143 | else if (gKeyboard->getKeyDown('P') && | ||
144 | (mask == (MASK_CONTROL | MASK_SHIFT))) | ||
145 | { | ||
146 | return LLToolCompTranslate::getInstance(); | ||
147 | } | ||
148 | else if (gKeyboard->getKeyDown('F') && | ||
149 | (mask == (MASK_ALT | MASK_CONTROL))) | ||
150 | { | ||
151 | return LLToolFace::getInstance(); | ||
152 | } | ||
153 | else if (mask == (MASK_CONTROL | MASK_SHIFT)) | ||
154 | { | ||
155 | return LLToolCompScale::getInstance(); | ||
156 | } | ||
157 | else if (mask == MASK_CONTROL) | ||
158 | { | ||
159 | return LLToolCompRotate::getInstance(); | ||
160 | } | ||
161 | return LLTool::getOverrideTool(mask); | ||
162 | } | ||
163 | |||
164 | |||
134 | //---------------------------------------------------------------------------- | 165 | //---------------------------------------------------------------------------- |
135 | // LLToolCompInspect | 166 | // LLToolCompInspect |
136 | //---------------------------------------------------------------------------- | 167 | //---------------------------------------------------------------------------- |
@@ -277,24 +308,6 @@ BOOL LLToolCompTranslate::handleMouseUp(S32 x, S32 y, MASK mask) | |||
277 | return LLToolComposite::handleMouseUp(x, y, mask); | 308 | return LLToolComposite::handleMouseUp(x, y, mask); |
278 | } | 309 | } |
279 | 310 | ||
280 | LLTool* LLToolCompTranslate::getOverrideTool(MASK mask) | ||
281 | { | ||
282 | if (gKeyboard->getKeyDown('A') && | ||
283 | ((mask & MASK_CONTROL) || (mask == (MASK_CONTROL | MASK_SHIFT)))) | ||
284 | { | ||
285 | return QToolAlign::getInstance(); | ||
286 | } | ||
287 | else if (mask == MASK_CONTROL) | ||
288 | { | ||
289 | return LLToolCompRotate::getInstance(); | ||
290 | } | ||
291 | else if (mask == (MASK_CONTROL | MASK_SHIFT)) | ||
292 | { | ||
293 | return LLToolCompScale::getInstance(); | ||
294 | } | ||
295 | return LLToolComposite::getOverrideTool(mask); | ||
296 | } | ||
297 | |||
298 | BOOL LLToolCompTranslate::handleDoubleClick(S32 x, S32 y, MASK mask) | 311 | BOOL LLToolCompTranslate::handleDoubleClick(S32 x, S32 y, MASK mask) |
299 | { | 312 | { |
300 | if (mManip->getSelection()->isEmpty() && mManip->getHighlightedPart() == LLManip::LL_NO_PART) | 313 | if (mManip->getSelection()->isEmpty() && mManip->getHighlightedPart() == LLManip::LL_NO_PART) |
@@ -401,22 +414,6 @@ BOOL LLToolCompScale::handleMouseUp(S32 x, S32 y, MASK mask) | |||
401 | return LLToolComposite::handleMouseUp(x, y, mask); | 414 | return LLToolComposite::handleMouseUp(x, y, mask); |
402 | } | 415 | } |
403 | 416 | ||
404 | LLTool* LLToolCompScale::getOverrideTool(MASK mask) | ||
405 | { | ||
406 | if (gKeyboard->getKeyDown('A') && | ||
407 | ((mask & MASK_CONTROL) || (mask == (MASK_CONTROL | MASK_SHIFT)))) | ||
408 | { | ||
409 | return QToolAlign::getInstance(); | ||
410 | } | ||
411 | else if (mask == MASK_CONTROL) | ||
412 | { | ||
413 | return LLToolCompRotate::getInstance(); | ||
414 | } | ||
415 | |||
416 | return LLToolComposite::getOverrideTool(mask); | ||
417 | } | ||
418 | |||
419 | |||
420 | BOOL LLToolCompScale::handleDoubleClick(S32 x, S32 y, MASK mask) | 417 | BOOL LLToolCompScale::handleDoubleClick(S32 x, S32 y, MASK mask) |
421 | { | 418 | { |
422 | if (!mManip->getSelection()->isEmpty() && mManip->getHighlightedPart() == LLManip::LL_NO_PART) | 419 | if (!mManip->getSelection()->isEmpty() && mManip->getHighlightedPart() == LLManip::LL_NO_PART) |
@@ -471,18 +468,16 @@ LLToolCompCreate::~LLToolCompCreate() | |||
471 | 468 | ||
472 | BOOL LLToolCompCreate::handleMouseDown(S32 x, S32 y, MASK mask) | 469 | BOOL LLToolCompCreate::handleMouseDown(S32 x, S32 y, MASK mask) |
473 | { | 470 | { |
474 | BOOL handled = FALSE; | ||
475 | mMouseDown = TRUE; | 471 | mMouseDown = TRUE; |
476 | 472 | ||
477 | if ( (mask == MASK_SHIFT) || (mask == MASK_CONTROL) ) | 473 | if ( (mask == MASK_SHIFT) || (mask == MASK_CONTROL) ) |
478 | { | 474 | { |
479 | gViewerWindow->pickAsync(x, y, mask, pickCallback); | 475 | gViewerWindow->pickAsync(x, y, mask, pickCallback); |
480 | handled = TRUE; | ||
481 | } | 476 | } |
482 | else | 477 | else |
483 | { | 478 | { |
484 | setCurrentTool( mPlacer ); | 479 | setCurrentTool( mPlacer ); |
485 | handled = mPlacer->placeObject( x, y, mask ); | 480 | mPlacer->placeObject( x, y, mask ); |
486 | } | 481 | } |
487 | 482 | ||
488 | mObjectPlacedOnMouseDown = TRUE; | 483 | mObjectPlacedOnMouseDown = TRUE; |
@@ -606,20 +601,6 @@ BOOL LLToolCompRotate::handleMouseUp(S32 x, S32 y, MASK mask) | |||
606 | return LLToolComposite::handleMouseUp(x, y, mask); | 601 | return LLToolComposite::handleMouseUp(x, y, mask); |
607 | } | 602 | } |
608 | 603 | ||
609 | LLTool* LLToolCompRotate::getOverrideTool(MASK mask) | ||
610 | { | ||
611 | if (gKeyboard->getKeyDown('A') && | ||
612 | ((mask & MASK_CONTROL) || (mask == (MASK_CONTROL | MASK_SHIFT)))) | ||
613 | { | ||
614 | return QToolAlign::getInstance(); | ||
615 | } | ||
616 | else if (mask == (MASK_CONTROL | MASK_SHIFT)) | ||
617 | { | ||
618 | return LLToolCompScale::getInstance(); | ||
619 | } | ||
620 | return LLToolComposite::getOverrideTool(mask); | ||
621 | } | ||
622 | |||
623 | BOOL LLToolCompRotate::handleDoubleClick(S32 x, S32 y, MASK mask) | 604 | BOOL LLToolCompRotate::handleDoubleClick(S32 x, S32 y, MASK mask) |
624 | { | 605 | { |
625 | if (!mManip->getSelection()->isEmpty() && mManip->getHighlightedPart() == LLManip::LL_NO_PART) | 606 | if (!mManip->getSelection()->isEmpty() && mManip->getHighlightedPart() == LLManip::LL_NO_PART) |