diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-01-30 01:34:16 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-09 20:00:07 +0100 |
commit | 1b1050da1c7b84cc72b7efbb2229294975be9e10 (patch) | |
tree | 68d15ccb015d58aeb5797ffd06efca3e55997c24 /src/gui/gui.cpp | |
parent | 0d4142a891cd228da24ee3aa3bbd7dc622da5b75 (diff) | |
parent | 955a7613d1fe116fe5e1da07a222b6849b3c885c (diff) | |
download | mana-1b1050da1c7b84cc72b7efbb2229294975be9e10.tar.gz mana-1b1050da1c7b84cc72b7efbb2229294975be9e10.tar.bz2 mana-1b1050da1c7b84cc72b7efbb2229294975be9e10.tar.xz mana-1b1050da1c7b84cc72b7efbb2229294975be9e10.zip |
Merged with Aethyra master as of 2009-01-27
Conflicts:
Almost everywhere.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 2da451a3..642e916b 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -19,13 +19,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "gui.h" - #include <guichan/exception.hpp> #include <guichan/image.hpp> #include <guichan/imagefont.hpp> #include "focushandler.h" +#include "gui.h" #include "sdlinput.h" #include "truetypefont.h" #include "viewport.h" @@ -39,12 +38,12 @@ #include "../resources/image.h" #include "../resources/imageset.h" -#include "../resources/resourcemanager.h" #include "../resources/imageloader.h" +#include "../resources/resourcemanager.h" // Guichan stuff Gui *gui = 0; -Viewport *viewport = 0; /**< Viewport on the map. */ +Viewport *viewport = 0; /**< Viewport on the map. */ SDLInput *guiInput = 0; // Fonts used in showing hits @@ -52,6 +51,9 @@ gcn::Font *hitRedFont = 0; gcn::Font *hitBlueFont = 0; gcn::Font *hitYellowFont = 0; +// Bolded font +gcn::Font *boldFont = 0; + class GuiConfigListener : public ConfigListener { public: @@ -115,14 +117,26 @@ Gui::Gui(Graphics *graphics): + e.getMessage()); } + // Set bold font + path = resman->getPath("fonts/dejavusans-bold.ttf"); + try { + const int fontSize = config.getValue("fontSize", 11); + boldFont = new TrueTypeFont(path, fontSize); + } + catch (gcn::Exception e) + { + logger->error(std::string("Unable to load dejavusans-bold.ttf: ") + + e.getMessage()); + } + gcn::Widget::setGlobalFont(mGuiFont); // Load hits' colourful fonts try { hitRedFont = new gcn::ImageFont("graphics/gui/hits_red.png", - "0123456789"); + "0123456789crit! "); hitBlueFont = new gcn::ImageFont("graphics/gui/hits_blue.png", - "0123456789"); + "0123456789crit! "); hitYellowFont = new gcn::ImageFont("graphics/gui/hits_yellow.png", "0123456789misxp "); } @@ -158,6 +172,7 @@ Gui::~Gui() mMouseCursors->decRef(); delete mGuiFont; + delete boldFont; delete viewport; delete getTop(); |