aboutsummaryrefslogtreecommitdiff
path: root/src/irrlicht_changes/static_text.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/irrlicht_changes/static_text.h')
-rw-r--r--src/irrlicht_changes/static_text.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/irrlicht_changes/static_text.h b/src/irrlicht_changes/static_text.h
index 43c587284..1f111ea56 100644
--- a/src/irrlicht_changes/static_text.h
+++ b/src/irrlicht_changes/static_text.h
@@ -34,7 +34,8 @@ namespace gui
{
public:
- //! constructor
+ // StaticText is translated by EnrichedString.
+ // No need to use translate_string()
StaticText(const EnrichedString &text, bool border, IGUIEnvironment* environment,
IGUIElement* parent, s32 id, const core::rect<s32>& rectangle,
bool background = false);
@@ -201,23 +202,20 @@ namespace gui
private:
//! Breaks the single text line.
- void breakText();
+ void updateText();
EGUI_ALIGNMENT HAlign, VAlign;
bool Border;
- bool OverrideColorEnabled;
- bool OverrideBGColorEnabled;
bool WordWrap;
bool Background;
bool RestrainTextInside;
bool RightToLeft;
- video::SColor OverrideColor, BGColor;
gui::IGUIFont* OverrideFont;
gui::IGUIFont* LastBreakFont; // stored because: if skin changes, line break must be recalculated.
- EnrichedString cText;
- core::array< EnrichedString > BrokenText;
+ EnrichedString ColoredText;
+ std::vector<EnrichedString> BrokenText;
};
@@ -274,10 +272,7 @@ inline void setStaticText(irr::gui::IGUIStaticText *static_text, const EnrichedS
inline void setStaticText(irr::gui::IGUIStaticText *static_text, const wchar_t *text)
{
- auto color = static_text->isOverrideColorEnabled()
- ? static_text->getOverrideColor()
- : irr::video::SColor(255, 255, 255, 255);
- setStaticText(static_text, EnrichedString(text, color));
+ setStaticText(static_text, EnrichedString(text, static_text->getOverrideColor()));
}
#endif // _IRR_COMPILE_WITH_GUI_