diff options
author | Socapex <philippe_groarke@yahoo.ca> | 2013-01-19 21:02:01 -0500 |
---|---|---|
committer | Socapex <philippe_groarke@yahoo.ca> | 2013-01-19 21:02:01 -0500 |
commit | df606ace309acaf0c78f52e1f98eabed6c844ae2 (patch) | |
tree | d9799b0e4a507d9eacbbafc1755eecea03f0b373 /src/client.cpp | |
parent | d0169223b889a115b486e974e5b287c3ccb00d85 (diff) | |
parent | 678d4e70999ade5a36862039875aa5564291d09d (diff) | |
download | manaverse-df606ace309acaf0c78f52e1f98eabed6c844ae2.tar.gz manaverse-df606ace309acaf0c78f52e1f98eabed6c844ae2.tar.bz2 manaverse-df606ace309acaf0c78f52e1f98eabed6c844ae2.tar.xz manaverse-df606ace309acaf0c78f52e1f98eabed6c844ae2.zip |
Merge remote-tracking branch 'upstream/master' into osx
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/src/client.cpp b/src/client.cpp index a96f50395..e281ddced 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2012 The ManaPlus Developers + * Copyright (C) 2011-2013 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -279,7 +279,10 @@ Client::Client(const Options &options) : mInputFocused(true), mMouseFocused(true), mGuiAlpha(1.0f), - mNewMessageFlag(false) + mNewMessageFlag(false), + mSkin(nullptr), + mButtonPadding(1), + mButtonSpacing(3) { mInstance = this; } @@ -884,8 +887,8 @@ int Client::testsExec() const } #define ADDBUTTON(var, object) var = object; \ - x -= var->getWidth() + 6; \ - var->setPosition(x, 0); \ + x -= var->getWidth() + mButtonSpacing; \ + var->setPosition(x, mButtonPadding); \ top->add(var); @@ -900,6 +903,14 @@ int Client::gameExec() SDL_Event event; + if (Theme::instance()) + mSkin = Theme::instance()->load("windowmenu.xml", ""); + if (mSkin) + { + mButtonPadding = mSkin->getPadding(); + mButtonSpacing = mSkin->getOption("spacing", 3); + } + while (mState != STATE_EXIT) { PROFILER_START(); @@ -1099,7 +1110,7 @@ int Client::gameExec() mDesktop = new Desktop(nullptr); top->add(mDesktop); - int x = top->getWidth(); + int x = top->getWidth() - mButtonPadding; ADDBUTTON(mSetupButton, new Button(mDesktop, _("Setup"), "Setup", this)) #ifndef WIN32 @@ -2697,20 +2708,20 @@ void Client::resizeVideo(int width, int height, const bool always) if (mSetupButton) { - int x = width - mSetupButton->getWidth() - 3; - mSetupButton->setPosition(x, 3); + int x = width - mSetupButton->getWidth() - mButtonPadding; + mSetupButton->setPosition(x, mButtonPadding); #ifndef WIN32 - x -= mPerfomanceButton->getWidth() + 6; - mPerfomanceButton->setPosition(x, 3); + x -= mPerfomanceButton->getWidth() + mButtonSpacing; + mPerfomanceButton->setPosition(x, mButtonPadding); - x -= mVideoButton->getWidth() + 6; - mVideoButton->setPosition(x, 3); + x -= mVideoButton->getWidth() + mButtonSpacing; + mVideoButton->setPosition(x, mButtonPadding); - x -= mThemesButton->getWidth() + 6; - mThemesButton->setPosition(x, 3); + x -= mThemesButton->getWidth() + mButtonSpacing; + mThemesButton->setPosition(x, mButtonPadding); #ifdef ANDROID - x -= mCloseButton->getWidth() + 6; - mCloseButton->setPosition(x, 3); + x -= mCloseButton->getWidth() + mButtonSpacing; + mCloseButton->setPosition(x, mButtonPadding); #endif #endif } |