diff options
author | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
commit | ce28e056c20bf2723f565bbf464b87781ec248a2 (patch) | |
tree | ef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/llhoverview.cpp | |
parent | Second Life viewer sources 1.19.1.4b (diff) | |
download | meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2 meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz |
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/newview/llhoverview.cpp')
-rw-r--r-- | linden/indra/newview/llhoverview.cpp | 56 |
1 files changed, 20 insertions, 36 deletions
diff --git a/linden/indra/newview/llhoverview.cpp b/linden/indra/newview/llhoverview.cpp index 316ba0b..6cc3873 100644 --- a/linden/indra/newview/llhoverview.cpp +++ b/linden/indra/newview/llhoverview.cpp | |||
@@ -106,20 +106,10 @@ LLHoverView::~LLHoverView() | |||
106 | { | 106 | { |
107 | } | 107 | } |
108 | 108 | ||
109 | EWidgetType LLHoverView::getWidgetType() const | ||
110 | { | ||
111 | return WIDGET_TYPE_HOVER_VIEW; | ||
112 | } | ||
113 | |||
114 | LLString LLHoverView::getWidgetTag() const | ||
115 | { | ||
116 | return LL_HOVER_VIEW_TAG; | ||
117 | } | ||
118 | |||
119 | void LLHoverView::updateHover(LLTool* current_tool) | 109 | void LLHoverView::updateHover(LLTool* current_tool) |
120 | { | 110 | { |
121 | BOOL picking_tool = ( current_tool == gToolPie | 111 | BOOL picking_tool = ( current_tool == LLToolPie::getInstance() |
122 | || current_tool == gToolParcel ); | 112 | || current_tool == LLToolSelectLand::getInstance() ); |
123 | 113 | ||
124 | mUseHover = !gAgent.cameraMouselook() | 114 | mUseHover = !gAgent.cameraMouselook() |
125 | && picking_tool | 115 | && picking_tool |
@@ -127,8 +117,8 @@ void LLHoverView::updateHover(LLTool* current_tool) | |||
127 | if (mUseHover) | 117 | if (mUseHover) |
128 | { | 118 | { |
129 | if ((gViewerWindow->getMouseVelocityStat()->getPrev(0) < 0.01f) | 119 | if ((gViewerWindow->getMouseVelocityStat()->getPrev(0) < 0.01f) |
130 | && (gCamera->getAngularVelocityStat()->getPrev(0) < 0.01f) | 120 | && (LLViewerCamera::getInstance()->getAngularVelocityStat()->getPrev(0) < 0.01f) |
131 | && (gCamera->getVelocityStat()->getPrev(0) < 0.01f)) | 121 | && (LLViewerCamera::getInstance()->getVelocityStat()->getPrev(0) < 0.01f)) |
132 | { | 122 | { |
133 | if (!mStartHoverPickTimer) | 123 | if (!mStartHoverPickTimer) |
134 | { | 124 | { |
@@ -164,7 +154,7 @@ void LLHoverView::pickCallback(S32 x, S32 y, MASK mask) | |||
164 | if (hit_obj) | 154 | if (hit_obj) |
165 | { | 155 | { |
166 | gHoverView->setHoverActive(TRUE); | 156 | gHoverView->setHoverActive(TRUE); |
167 | gSelectMgr->setHoverObject(hit_obj); | 157 | LLSelectMgr::getInstance()->setHoverObject(hit_obj); |
168 | gHoverView->mLastHoverObject = hit_obj; | 158 | gHoverView->mLastHoverObject = hit_obj; |
169 | gHoverView->mHoverOffset = gViewerWindow->lastObjectHitOffset(); | 159 | gHoverView->mHoverOffset = gViewerWindow->lastObjectHitOffset(); |
170 | } | 160 | } |
@@ -178,7 +168,7 @@ void LLHoverView::pickCallback(S32 x, S32 y, MASK mask) | |||
178 | { | 168 | { |
179 | gHoverView->setHoverActive(TRUE); | 169 | gHoverView->setHoverActive(TRUE); |
180 | gHoverView->mHoverLandGlobal = gLastHitPosGlobal; | 170 | gHoverView->mHoverLandGlobal = gLastHitPosGlobal; |
181 | gParcelMgr->requestHoverParcelProperties( gHoverView->mHoverLandGlobal ); | 171 | LLViewerParcelMgr::getInstance()->requestHoverParcelProperties( gHoverView->mHoverLandGlobal ); |
182 | } | 172 | } |
183 | else | 173 | else |
184 | { | 174 | { |
@@ -200,7 +190,7 @@ void LLHoverView::cancelHover() | |||
200 | mDoneHoverPick = FALSE; | 190 | mDoneHoverPick = FALSE; |
201 | mStartHoverPickTimer = FALSE; | 191 | mStartHoverPickTimer = FALSE; |
202 | 192 | ||
203 | gSelectMgr->setHoverObject(NULL); | 193 | LLSelectMgr::getInstance()->setHoverObject(NULL); |
204 | // Can't do this, some code relies on hover object still being | 194 | // Can't do this, some code relies on hover object still being |
205 | // set after the hover is cancelled! Dammit. JC | 195 | // set after the hover is cancelled! Dammit. JC |
206 | // mLastHoverObject = NULL; | 196 | // mLastHoverObject = NULL; |
@@ -279,7 +269,7 @@ void LLHoverView::updateText() | |||
279 | // | 269 | // |
280 | BOOL suppressObjectHoverDisplay = !gSavedSettings.getBOOL("ShowAllObjectHoverTip"); | 270 | BOOL suppressObjectHoverDisplay = !gSavedSettings.getBOOL("ShowAllObjectHoverTip"); |
281 | 271 | ||
282 | LLSelectNode *nodep = gSelectMgr->getHoverNode();; | 272 | LLSelectNode *nodep = LLSelectMgr::getInstance()->getHoverNode();; |
283 | if (nodep) | 273 | if (nodep) |
284 | { | 274 | { |
285 | line.clear(); | 275 | line.clear(); |
@@ -455,7 +445,7 @@ void LLHoverView::updateText() | |||
455 | // Didn't hit an object, but since we have a land point we | 445 | // Didn't hit an object, but since we have a land point we |
456 | // must be hovering over land. | 446 | // must be hovering over land. |
457 | 447 | ||
458 | LLParcel* hover_parcel = gParcelMgr->getHoverParcel(); | 448 | LLParcel* hover_parcel = LLViewerParcelMgr::getInstance()->getHoverParcel(); |
459 | LLUUID owner; | 449 | LLUUID owner; |
460 | S32 width = 0; | 450 | S32 width = 0; |
461 | S32 height = 0; | 451 | S32 height = 0; |
@@ -463,8 +453,8 @@ void LLHoverView::updateText() | |||
463 | if ( hover_parcel ) | 453 | if ( hover_parcel ) |
464 | { | 454 | { |
465 | owner = hover_parcel->getOwnerID(); | 455 | owner = hover_parcel->getOwnerID(); |
466 | width = S32(gParcelMgr->getHoverParcelWidth()); | 456 | width = S32(LLViewerParcelMgr::getInstance()->getHoverParcelWidth()); |
467 | height = S32(gParcelMgr->getHoverParcelHeight()); | 457 | height = S32(LLViewerParcelMgr::getInstance()->getHoverParcelHeight()); |
468 | } | 458 | } |
469 | 459 | ||
470 | // Line: "Land" | 460 | // Line: "Land" |
@@ -602,11 +592,6 @@ void LLHoverView::updateText() | |||
602 | 592 | ||
603 | void LLHoverView::draw() | 593 | void LLHoverView::draw() |
604 | { | 594 | { |
605 | if( !getVisible() ) | ||
606 | { | ||
607 | return; | ||
608 | } | ||
609 | |||
610 | if ( !isHovering() ) | 595 | if ( !isHovering() ) |
611 | { | 596 | { |
612 | return; | 597 | return; |
@@ -615,7 +600,10 @@ void LLHoverView::draw() | |||
615 | // To toggle off hover tips, you have to just suppress the draw. | 600 | // To toggle off hover tips, you have to just suppress the draw. |
616 | // The picking is still needed to do cursor changes over physical | 601 | // The picking is still needed to do cursor changes over physical |
617 | // and scripted objects. JC | 602 | // and scripted objects. JC |
618 | if (!sShowHoverTips) return; | 603 | if (!sShowHoverTips) |
604 | { | ||
605 | return; | ||
606 | } | ||
619 | 607 | ||
620 | const F32 MAX_HOVER_DISPLAY_SECS = 5.f; | 608 | const F32 MAX_HOVER_DISPLAY_SECS = 5.f; |
621 | if (mHoverTimer.getElapsedTimeF32() > MAX_HOVER_DISPLAY_SECS) | 609 | if (mHoverTimer.getElapsedTimeF32() > MAX_HOVER_DISPLAY_SECS) |
@@ -662,10 +650,10 @@ void LLHoverView::draw() | |||
662 | return; | 650 | return; |
663 | } | 651 | } |
664 | 652 | ||
665 | LLViewerImage* box_imagep = gImageList.getImage(LLUUID(gViewerArt.getString("rounded_square.tga")), MIPMAP_FALSE, TRUE); | 653 | LLUIImagePtr box_imagep = LLUI::getUIImage("rounded_square.tga"); |
666 | LLViewerImage* shadow_imagep = gImageList.getImage(LLUUID(gViewerArt.getString("rounded_square_soft.tga")), MIPMAP_FALSE, TRUE); | 654 | LLUIImagePtr shadow_imagep = LLUI::getUIImage("rounded_square_soft.tga"); |
667 | 655 | ||
668 | const LLFontGL* fontp = gResMgr->getRes(LLFONT_SANSSERIF_SMALL); | 656 | const LLFontGL* fontp = LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF_SMALL); |
669 | 657 | ||
670 | // Render text. | 658 | // Render text. |
671 | LLColor4 text_color = gColors.getColor("ToolTipTextColor"); | 659 | LLColor4 text_color = gColors.getColor("ToolTipTextColor"); |
@@ -714,14 +702,10 @@ void LLHoverView::draw() | |||
714 | 702 | ||
715 | shadow_color.mV[VALPHA] = 0.7f * alpha; | 703 | shadow_color.mV[VALPHA] = 0.7f * alpha; |
716 | S32 shadow_offset = gSavedSettings.getS32("DropShadowTooltip"); | 704 | S32 shadow_offset = gSavedSettings.getS32("DropShadowTooltip"); |
717 | gGL.color4fv(shadow_color.mV); | 705 | shadow_imagep->draw(LLRect(left + shadow_offset, top - shadow_offset, right + shadow_offset, bottom - shadow_offset), shadow_color); |
718 | LLViewerImage::bindTexture(shadow_imagep); | ||
719 | gl_segmented_rect_2d_tex(left + shadow_offset, top - shadow_offset, right + shadow_offset, bottom - shadow_offset, shadow_imagep->getWidth(), shadow_imagep->getHeight(), 16); | ||
720 | 706 | ||
721 | bg_color.mV[VALPHA] = alpha; | 707 | bg_color.mV[VALPHA] = alpha; |
722 | gGL.color4fv(bg_color.mV); | 708 | box_imagep->draw(LLRect(left, top, right, bottom), bg_color); |
723 | LLViewerImage::bindTexture(box_imagep); | ||
724 | gl_segmented_rect_2d_tex(left, top, right, bottom, box_imagep->getWidth(), box_imagep->getHeight(), 16); | ||
725 | 709 | ||
726 | S32 cur_offset = top - 4; | 710 | S32 cur_offset = top - 4; |
727 | for (text_list_t::iterator iter = mText.begin(); iter != mText.end(); ++iter) | 711 | for (text_list_t::iterator iter = mText.begin(); iter != mText.end(); ++iter) |