diff options
Diffstat (limited to 'indra/newview/llhudtext.h')
-rw-r--r-- | indra/newview/llhudtext.h | 50 |
1 files changed, 21 insertions, 29 deletions
diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index 4f4ee55a61..f05ee4d594 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -28,18 +28,15 @@ #define LL_LLHUDTEXT_H #include "llpointer.h" -#include "lldarrayptr.h" #include "llhudobject.h" #include "v4color.h" #include "v4coloru.h" #include "v2math.h" #include "llrect.h" -#include "llframetimer.h" #include "llfontgl.h" #include <set> #include <vector> -#include "lldarray.h" // Renders a 2D text billboard floating at the location specified. class LLDrawable; @@ -56,14 +53,19 @@ protected: class LLHUDTextSegment { public: - LLHUDTextSegment(const LLWString& text, const LLFontGL::StyleFlags style, const LLColor4& color) - : mColor(color), mStyle(style), mText(text) {} + LLHUDTextSegment(const LLWString& text, const LLFontGL::StyleFlags style, const LLColor4& color, const LLFontGL* font) + : mColor(color), + mStyle(style), + mText(text), + mFont(font) + {} F32 getWidth(const LLFontGL* font); - const LLWString& getText() const { return mText; }; + const LLWString& getText() const { return mText; } void clearFontWidthMap() { mFontWidthMap.clear(); } LLColor4 mColor; LLFontGL::StyleFlags mStyle; + const LLFontGL* mFont; private: LLWString mText; std::map<const LLFontGL*, F32> mFontWidthMap; @@ -83,20 +85,21 @@ public: } EVertAlignment; public: - void setStringUTF8(const std::string &utf8string); - void setString(const LLWString &wstring); + // Set entire string, eliminating existing lines + void setString(const std::string& text_utf8); + void clearString(); - void addLine(const std::string &text, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL); - void addLine(const LLWString &wtext, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL); - void setLabel(const std::string &label); - void setLabel(const LLWString &label); - void setDropShadow(const BOOL do_shadow); + + // Add text a line at a time, allowing custom formatting + void addLine(const std::string &text_utf8, const LLColor4& color, const LLFontGL::StyleFlags style = LLFontGL::NORMAL, const LLFontGL* font = NULL); + + // Sets the default font for lines with no font specified void setFont(const LLFontGL* font); void setColor(const LLColor4 &color); - void setUsePixelSize(const BOOL use_pixel_size); + void setAlpha(F32 alpha); void setZCompare(const BOOL zcompare); void setDoFade(const BOOL do_fade); - void setVisibleOffScreen(BOOL visible) { mVisibleOffScreen = visible; } +// void setVisibleOffScreen(BOOL visible) { mVisibleOffScreen = visible; } // mMaxLines of -1 means unlimited lines. void setMaxLines(S32 max_lines) { mMaxLines = max_lines; } @@ -110,21 +113,17 @@ public: /*virtual*/ void markDead(); friend class LLHUDObject; /*virtual*/ F32 getDistance() const { return mLastDistance; } - void setUseBubble(BOOL use_bubble) { mUseBubble = use_bubble; } - S32 getLOD() { return mLOD; } BOOL getVisible() { return mVisible; } BOOL getHidden() const { return mHidden; } void setHidden( BOOL hide ) { mHidden = hide; } void setOnHUDAttachment(BOOL on_hud) { mOnHUDAttachment = on_hud; } void shift(const LLVector3& offset); - BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end, LLVector3& intersection, BOOL debug_render = FALSE); - static void shiftAll(const LLVector3& offset); static void renderAllHUD(); - static void addPickable(std::set<LLViewerObject*> &pick_list); static void reshape(); static void setDisplayText(BOOL flag) { sDisplayText = flag ; } + protected: LLHUDText(const U8 type); @@ -132,21 +131,17 @@ protected: /*virtual*/ void renderForSelect(); void renderText(BOOL for_select); static void updateAll(); - void setLOD(S32 lod); S32 getMaxLines(); private: ~LLHUDText(); - BOOL mOnHUD; - BOOL mUseBubble; - BOOL mDropShadow; + BOOL mOnHUDAttachment; BOOL mDoFade; F32 mFadeRange; F32 mFadeDistance; F32 mLastDistance; - BOOL mUsePixelSize; BOOL mZCompare; - BOOL mVisibleOffScreen; +// BOOL mVisibleOffScreen; BOOL mOffscreen; LLColor4 mColor; LLVector3 mScale; @@ -164,11 +159,8 @@ private: S32 mOffsetY; F32 mRadius; std::vector<LLHUDTextSegment> mTextSegments; - std::vector<LLHUDTextSegment> mLabelSegments; - LLFrameTimer mResizeTimer; ETextAlignment mTextAlignment; EVertAlignment mVertAlignment; - S32 mLOD; BOOL mHidden; static BOOL sDisplayText ; |