From 2b1c0dcf269d617de1f6c203df547166661f089e Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Wed, 28 Jul 2010 19:57:31 +0200 Subject: Centralized configuration default values using the VariableData system. Please note that I didn't turned all the getValue() call into new ones, simply because I have to have config object initiated which is not forcefully the case the branding file. Resolves: Manasource Mantis #170. --- src/gui/gui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gui/gui.cpp') diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index df2ddadf..0fff3496 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -61,7 +61,7 @@ class GuiConfigListener : public ConfigListener { if (name == "customcursor") { - bool bCustomCursor = config.getValue("customcursor", 1) == 1; + bool bCustomCursor = config.getBoolValue("customcursor"); mGui->setUseCustomCursor(bCustomCursor); } } @@ -104,7 +104,7 @@ Gui::Gui(Graphics *graphics): ResourceManager *resman = ResourceManager::getInstance(); // Set global font - const int fontSize = (int) config.getValue("fontSize", 11); + const int fontSize = config.getValue("fontSize", 11); std::string fontFile = branding.getValue("font", "fonts/dejavusans.ttf"); std::string path = resman->getPath(fontFile); @@ -135,7 +135,7 @@ Gui::Gui(Graphics *graphics): gcn::Widget::setGlobalFont(mGuiFont); // Initialize mouse cursor and listen for changes to the option - setUseCustomCursor(config.getValue("customcursor", 1) == 1); + setUseCustomCursor(config.getBoolValue("customcursor")); mConfigListener = new GuiConfigListener(this); config.addListener("customcursor", mConfigListener); } -- cgit v1.2.3-60-g2f50