summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-01-18 20:02:27 +0300
committerAndrei Karas <akaras@inbox.ru>2014-01-18 20:02:27 +0300
commitfb5d0e7762f692948dddebd3deb38a0bd20de5f2 (patch)
treeafe2c0d8cf75738fd847af37dc166e0c338f7493 /src/gui/gui.cpp
parent8a5603e487f682f5f67bc2cedae81249aa138f5b (diff)
parente9e343366fbfbe9a6343089ff113354524f3f306 (diff)
downloadplus-fb5d0e7762f692948dddebd3deb38a0bd20de5f2.tar.gz
plus-fb5d0e7762f692948dddebd3deb38a0bd20de5f2.tar.bz2
plus-fb5d0e7762f692948dddebd3deb38a0bd20de5f2.tar.xz
plus-fb5d0e7762f692948dddebd3deb38a0bd20de5f2.zip
Merge branch 'master' into stable
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp47
1 files changed, 42 insertions, 5 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index db3faa314..a8c31469a 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -49,6 +49,7 @@
#include "resources/resourcemanager.h"
#include "utils/langs.h"
+#include "utils/timer.h"
#include <guichan/exception.hpp>
@@ -107,6 +108,7 @@ Gui::Gui() :
mFocusListeners(),
mForegroundColor(Theme::getThemeColor(Theme::TEXT)),
mForegroundColor2(Theme::getThemeColor(Theme::TEXT_OUTLINE)),
+ mTime(0),
mCustomCursor(false),
mDoubleClick(true)
{
@@ -137,6 +139,8 @@ void Gui::postInit(Graphics *const graphics)
const StringVect langs = getLang();
const bool isJapan = (!langs.empty() && langs[0].size() > 3
&& langs[0].substr(0, 3) == "ja_");
+ const bool isChinese = (!langs.empty() && langs[0].size() > 3
+ && langs[0].substr(0, 3) == "zh_");
// Set global font
const int fontSize = config.getIntValue("fontSize");
@@ -147,7 +151,12 @@ void Gui::postInit(Graphics *const graphics)
if (fontFile.empty())
fontFile = branding.getStringValue("japanFont");
}
-
+ else if (isChinese)
+ {
+ fontFile = config.getValue("chinaFont", "");
+ if (fontFile.empty())
+ fontFile = branding.getStringValue("chinaFont");
+ }
if (fontFile.empty())
fontFile = branding.getStringValue("font");
@@ -161,17 +170,21 @@ void Gui::postInit(Graphics *const graphics)
.append("': ").append(e.getMessage()));
}
+
// Set particle font
fontFile = config.getValue("particleFont", "");
-
if (isJapan)
{
fontFile = config.getValue("japanFont", "");
if (fontFile.empty())
fontFile = branding.getStringValue("japanFont");
}
-
-
+ else if (isChinese)
+ {
+ fontFile = config.getValue("chinaFont", "");
+ if (fontFile.empty())
+ fontFile = branding.getStringValue("chinaFont");
+ }
if (fontFile.empty())
fontFile = branding.getStringValue("particleFont");
@@ -186,6 +199,7 @@ void Gui::postInit(Graphics *const graphics)
.append("': ").append(e.getMessage()));
}
+
// Set bold font
fontFile = config.getValue("boldFont", "");
if (fontFile.empty())
@@ -201,6 +215,7 @@ void Gui::postInit(Graphics *const graphics)
.append("': ").append(e.getMessage()));
}
+
// Set help font
fontFile = config.getValue("helpFont", "");
if (fontFile.empty())
@@ -216,6 +231,7 @@ void Gui::postInit(Graphics *const graphics)
.append("': ").append(e.getMessage()));
}
+
// Set secure font
fontFile = config.getValue("secureFont", "");
if (fontFile.empty())
@@ -231,9 +247,22 @@ void Gui::postInit(Graphics *const graphics)
.append("': ").append(e.getMessage()));
}
+
// Set npc font
- fontFile = config.getValue("npcFont", "");
const int npcFontSize = config.getIntValue("npcfontSize");
+ fontFile = config.getValue("npcFont", "");
+ if (isJapan)
+ {
+ fontFile = config.getValue("japanFont", "");
+ if (fontFile.empty())
+ fontFile = branding.getStringValue("japanFont");
+ }
+ else if (isChinese)
+ {
+ fontFile = config.getValue("chinaFont", "");
+ if (fontFile.empty())
+ fontFile = branding.getStringValue("chinaFont");
+ }
if (fontFile.empty())
fontFile = branding.getStringValue("npcFont");
@@ -339,6 +368,14 @@ void Gui::slowLogic()
mNpcFont->slowLogic(5);
if (windowContainer)
windowContainer->slowLogic();
+
+ const int time = cur_time;
+ if (mTime != time)
+ {
+ logger->flush();
+ mTime = time;
+ }
+
BLOCK_END("Gui::slowLogic")
}