From 2e168e49be41607bd865c97e6667ba1a2db150ed Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 22 Jan 2012 20:09:45 +0300 Subject: Replace particle font to japan font if need. --- src/gui/gui.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/gui/gui.cpp') diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index bd855a598..3d79f0cdf 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -105,14 +105,14 @@ Gui::Gui(Graphics *graphics): Window::setWindowContainer(guiTop); setTop(guiTop); + const std::vector langs = getLang(); + const bool isJapan = (!langs.empty() && langs[0].size() > 3 + && langs[0].substr(0, 3) == "ja_"); + // Set global font const int fontSize = config.getIntValue("fontSize"); - std::string fontFile = config.getValue("font", ""); - - std::vector langs = getLang(); - if (!langs.empty() && langs[0].size() > 3 - && langs[0].substr(0, 3) == "ja_") + if (isJapan) { fontFile = config.getValue("japanFont", ""); if (fontFile.empty()) @@ -134,6 +134,15 @@ Gui::Gui(Graphics *graphics): // Set particle font fontFile = config.getValue("particleFont", ""); + + if (isJapan) + { + fontFile = config.getValue("japanFont", ""); + if (fontFile.empty()) + fontFile = branding.getStringValue("japanFont"); + } + + if (fontFile.empty()) fontFile = branding.getStringValue("particleFont"); -- cgit v1.2.3-60-g2f50