summaryrefslogtreecommitdiff
path: root/src/text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/text.cpp')
-rw-r--r--src/text.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/text.cpp b/src/text.cpp
index f6c71dba..53b21e79 100644
--- a/src/text.cpp
+++ b/src/text.cpp
@@ -27,11 +27,9 @@
#include "textrenderer.h"
#include "gui/gui.h"
-#include "gui/palette.h"
-#include "gui/theme.h"
-#include "resources/resourcemanager.h"
#include "resources/image.h"
+#include "resources/theme.h"
#include <guichan/font.hpp>
@@ -41,17 +39,22 @@ Image *Text::mBubbleArrow;
Text::Text(const std::string &text, int x, int y,
gcn::Graphics::Alignment alignment,
- const gcn::Color* color, bool isSpeech) :
+ const gcn::Color* color, bool isSpeech,
+ gcn::Font *font) :
mText(text),
mColor(color),
- mFont(gui->getFont()),
mIsSpeech(isSpeech)
{
+ if (!font)
+ mFont = gui->getFont();
+ else
+ mFont = font;
+
if (textManager == 0)
{
textManager = new TextManager;
Image *sbImage = Theme::getImageFromTheme("bubble.png|W:#"
- + config.getValue("speechBubblecolor", "000000"));
+ + config.getStringValue("speechBubblecolor"));
mBubble.grid[0] = sbImage->getSubImage(0, 0, 5, 5);
mBubble.grid[1] = sbImage->getSubImage(5, 0, 5, 5);
mBubble.grid[2] = sbImage->getSubImage(10, 0, 5, 5);
@@ -62,7 +65,7 @@ Text::Text(const std::string &text, int x, int y,
mBubble.grid[7] = sbImage->getSubImage(5, 10, 5, 5);
mBubble.grid[8] = sbImage->getSubImage(10, 10, 5, 5);
mBubbleArrow = sbImage->getSubImage(0, 15, 15, 10);
- const float bubbleAlpha = config.getValue("speechBubbleAlpha", 1.0);
+ const float bubbleAlpha = config.getFloatValue("speechBubbleAlpha");
for (int i = 0; i < 9; i++)
{
mBubble.grid[i]->setAlpha(bubbleAlpha);
@@ -145,8 +148,8 @@ void Text::draw(gcn::Graphics *graphics, int xOff, int yOff)
FlashText::FlashText(const std::string &text, int x, int y,
gcn::Graphics::Alignment alignment,
- const gcn::Color *color) :
- Text(text, x, y, alignment, color),
+ const gcn::Color *color, gcn::Font *font) :
+ Text(text, x, y, alignment, color, false, font),
mTime(0)
{
}