diff options
-rwxr-xr-x | indra/newview/llviewerobject.cpp | 48 | ||||
-rwxr-xr-x | indra/newview/llviewerobject.h | 5 | ||||
-rwxr-xr-x | indra/newview/llviewerobjectlist.cpp | 2 |
3 files changed, 36 insertions, 19 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 2153754d3f..db50ea1d81 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -232,6 +232,8 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mRenderMedia(FALSE), mBestUpdatePrecision(0), mText(), + mHudText(""), + mHudTextColor(LLColor4::white), mLastInterpUpdateSecs(0.f), mLastMessageUpdateSecs(0.f), mLatestRecvPacketID(0), @@ -1413,12 +1415,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // Setup object text if (!mText) { - mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); - mText->setFont(LLFontGL::getFontSansSerif()); - mText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); - mText->setMaxLines(-1); - mText->setSourceObject(this); - mText->setOnHUDAttachment(isHUDAttachment()); + initHudText(); } std::string temp_string; @@ -1432,6 +1429,9 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, mText->setColor(LLColor4(coloru)); mText->setString(temp_string); + mHudText = temp_string; + mHudTextColor = LLColor4(coloru); + setChanged(MOVED | SILHOUETTE); } else if (mText.notNull()) @@ -1794,12 +1794,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // Setup object text if (!mText && (value & 0x4)) { - mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); - mText->setFont(LLFontGL::getFontSansSerif()); - mText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); - mText->setMaxLines(-1); // Set to match current agni behavior. - mText->setSourceObject(this); - mText->setOnHUDAttachment(isHUDAttachment()); + initHudText(); } if (value & 0x4) @@ -1812,6 +1807,9 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, mText->setColor(LLColor4(coloru)); mText->setString(temp_string); + mHudText = temp_string; + mHudTextColor = LLColor4(coloru); + setChanged(TEXTURE); } else if(mText.notNull()) @@ -4972,12 +4970,7 @@ void LLViewerObject::setDebugText(const std::string &utf8text) if (!mText) { - mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); - mText->setFont(LLFontGL::getFontSansSerif()); - mText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); - mText->setMaxLines(-1); - mText->setSourceObject(this); - mText->setOnHUDAttachment(isHUDAttachment()); + initHudText(); } mText->setColor(LLColor4::white); mText->setString(utf8text); @@ -4986,6 +4979,25 @@ void LLViewerObject::setDebugText(const std::string &utf8text) updateText(); } +void LLViewerObject::initHudText() +{ + mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); + mText->setFont(LLFontGL::getFontSansSerif()); + mText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); + mText->setMaxLines(-1); + mText->setSourceObject(this); + mText->setOnHUDAttachment(isHUDAttachment()); +} + +void LLViewerObject::restoreHudText() +{ + if(mText) + { + mText->setColor(mHudTextColor); + mText->setString(mHudText); + } +} + void LLViewerObject::setIcon(LLViewerTexture* icon_image) { if (!mIcon) diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 95654ae1ff..219a3ce22b 100755 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -404,6 +404,8 @@ public: void setCanSelect(BOOL canSelect); void setDebugText(const std::string &utf8text); + void initHudText(); + void restoreHudText(); void setIcon(LLViewerTexture* icon_image); void clearIcon(); @@ -674,6 +676,9 @@ public: LLPointer<LLHUDText> mText; LLPointer<class LLHUDIcon> mIcon; + std::string mHudText; + LLColor4 mHudTextColor; + static BOOL sUseSharedDrawables; protected: diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 75732a1e19..61e918215c 100755 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1282,7 +1282,7 @@ void LLViewerObjectList::clearDebugText() { for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) { - (*iter)->setDebugText(""); + (*iter)->restoreHudText(); } } |