]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/irrlicht_changes/static_text.cpp
Inventory: Make addList() consistent (#11382)
[dragonfireclient.git] / src / irrlicht_changes / static_text.cpp
index 39b34d17cf4bf4834d9bab6e1ddc1d06fa2df304..8908a91f78aea080b2c6106b178e2833d3b59cd6 100644 (file)
@@ -108,16 +108,11 @@ void StaticText::draw()
                                        font->getDimension(str.c_str()).Width;
                        }
 
-                       //str = colorizeText(BrokenText[i].c_str(), colors, previous_color);
-                       //if (!colors.empty())
-                       //      previous_color = colors[colors.size() - 1];
-
 #if USE_FREETYPE
                        if (font->getType() == irr::gui::EGFT_CUSTOM) {
                                irr::gui::CGUITTFont *tmp = static_cast<irr::gui::CGUITTFont*>(font);
                                tmp->draw(str,
-                                       r, previous_color, // FIXME
-                                       HAlign == EGUIA_CENTER, VAlign == EGUIA_CENTER,
+                                       r, HAlign == EGUIA_CENTER, VAlign == EGUIA_CENTER,
                                        (RestrainTextInside ? &AbsoluteClippingRect : NULL));
                        } else
 #endif
@@ -246,15 +241,17 @@ void StaticText::setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vert
 }
 
 
-#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR <= 7
-const video::SColor& StaticText::getOverrideColor() const
-#else
 video::SColor StaticText::getOverrideColor() const
-#endif
 {
        return ColoredText.getDefaultColor();
 }
 
+#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR > 8
+video::SColor StaticText::getActiveColor() const
+{
+       return getOverrideColor();
+}
+#endif
 
 //! Sets if the static text should use the overide color or the
 //! color in the gui skin.
@@ -308,9 +305,10 @@ void StaticText::updateText()
        const EnrichedString &cText = ColoredText;
        BrokenText.clear();
 
-       if (cText.hasBackground()) {
+       if (cText.hasBackground())
                setBackgroundColor(cText.getBackground());
-       }
+       else
+               setDrawBackground(false);
 
        if (!WordWrap) {
                BrokenText.push_back(cText);