diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-02-05 15:00:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-02-05 15:00:58 +0300 |
commit | 9a3a196dbf633a699c26d0227802a42f025c8bfd (patch) | |
tree | dfbdb2ff1e2c54d75a2bf6411d3f70df22518c28 /src/gui/gui.cpp | |
parent | fc17ff22d9df50df9c5d1cf3dc0de358001271ed (diff) | |
parent | ece36a40d4e9a838cde01075d7681b8fc517b19f (diff) | |
download | plus-9a3a196dbf633a699c26d0227802a42f025c8bfd.tar.gz plus-9a3a196dbf633a699c26d0227802a42f025c8bfd.tar.bz2 plus-9a3a196dbf633a699c26d0227802a42f025c8bfd.tar.xz plus-9a3a196dbf633a699c26d0227802a42f025c8bfd.zip |
Merge branch 'master' into stripped
Conflicts:
src/guichan/gui.cpp
src/guichan/include/guichan/sdl/sdlpixel.hpp
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index bd855a598..1d8b45872 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -99,20 +99,19 @@ Gui::Gui(Graphics *graphics): // Initialize top GUI widget WindowContainer *guiTop = new WindowContainer; guiTop->setFocusable(true); - guiTop->setDimension(gcn::Rectangle(0, 0, - graphics->mWidth, graphics->mHeight)); + guiTop->setSize(graphics->mWidth, graphics->mHeight); guiTop->setOpaque(false); Window::setWindowContainer(guiTop); setTop(guiTop); + const std::vector<std::string> 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<std::string> 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 +133,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"); @@ -278,6 +286,20 @@ void Gui::draw() mGraphics->popClipArea(); } +void Gui::videoResized() +{ + WindowContainer *top = static_cast<WindowContainer*>(getTop()); + + if (top) + { + int oldWidth = top->getWidth(); + int oldHeight = top->getHeight(); + + top->setSize(mainGraphics->mWidth, mainGraphics->mHeight); + top->adjustAfterResize(oldWidth, oldHeight); + } +} + void Gui::setUseCustomCursor(bool customCursor) { if (customCursor != mCustomCursor) |