summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-06-25 22:35:30 +0300
committerAndrei Karas <akaras@inbox.ru>2012-06-25 22:35:30 +0300
commitdcfc97836830d4100a0a520b77d68d908314ee60 (patch)
treec35eccea345638b1abe2a3875065a36065bf8691 /src/gui/gui.cpp
parentf939a7bbbc19bb69726377eed7b36542d6a5cf3f (diff)
downloadmv-dcfc97836830d4100a0a520b77d68d908314ee60.tar.gz
mv-dcfc97836830d4100a0a520b77d68d908314ee60.tar.bz2
mv-dcfc97836830d4100a0a520b77d68d908314ee60.tar.xz
mv-dcfc97836830d4100a0a520b77d68d908314ee60.zip
Add npc font size with 13 pixels size.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index afced01b2..8dcaaafa1 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -201,6 +201,22 @@ Gui::Gui(Graphics *graphics):
std::string("': ") + e.getMessage());
}
+ // Set npc font
+ fontFile = config.getValue("npcFont", "");
+ const int npcFontSize = config.getIntValue("npcfontSize");
+ if (fontFile.empty())
+ fontFile = branding.getStringValue("npcFont");
+
+ try
+ {
+ mNpcFont = new SDLFont(fontFile, npcFontSize);
+ }
+ catch (const gcn::Exception &e)
+ {
+ logger->error(std::string("Unable to load '") + fontFile +
+ std::string("': ") + e.getMessage());
+ }
+
gcn::Widget::setGlobalFont(mGuiFont);
// Initialize mouse cursor and listen for changes to the option
@@ -463,11 +479,13 @@ void Gui::updateFonts()
boldFont->loadFont(fontFile, fontSize);
- fontFile = config.getValue("secureFont", "");
+ const int npcFontSize = config.getIntValue("npcfontSize");
+
+ fontFile = config.getValue("npcFont", "");
if (fontFile.empty())
- fontFile = branding.getStringValue("secureFont");
+ fontFile = branding.getStringValue("npcFont");
- mSecureFont->loadFont(fontFile, fontSize);
+ mNpcFont->loadFont(fontFile, npcFontSize);
}
void Gui::distributeMouseEvent(gcn::Widget* source, int type, int button,