diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-07-28 19:57:31 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-07-28 19:57:31 +0200 |
commit | 2b1c0dcf269d617de1f6c203df547166661f089e (patch) | |
tree | 5d247d694f28ddbeb6e2da26b9db02eeab5c7480 /src/gui/gui.cpp | |
parent | 44d8856c777790449df46e3b5348a6a7433a75d8 (diff) | |
download | mana-2b1c0dcf269d617de1f6c203df547166661f089e.tar.gz mana-2b1c0dcf269d617de1f6c203df547166661f089e.tar.bz2 mana-2b1c0dcf269d617de1f6c203df547166661f089e.tar.xz mana-2b1c0dcf269d617de1f6c203df547166661f089e.zip |
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.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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); } |