diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-12-16 02:50:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-12-16 02:50:13 +0300 |
commit | a9ddb1992d186d559f24370a33a987e281c134c5 (patch) | |
tree | e661ef11486bdfde907b6bf5dee0c4988911ddb9 /src/touchmanager.cpp | |
parent | a44ad060d637ec363100d05ffc5a11fb52fef4af (diff) | |
download | plus-a9ddb1992d186d559f24370a33a987e281c134c5.tar.gz plus-a9ddb1992d186d559f24370a33a987e281c134c5.tar.bz2 plus-a9ddb1992d186d559f24370a33a987e281c134c5.tar.xz plus-a9ddb1992d186d559f24370a33a987e281c134c5.zip |
Hide screen buttons and joystick if setup window is opened.
Diffstat (limited to 'src/touchmanager.cpp')
-rw-r--r-- | src/touchmanager.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/touchmanager.cpp b/src/touchmanager.cpp index af90c65e3..38f9c3237 100644 --- a/src/touchmanager.cpp +++ b/src/touchmanager.cpp @@ -44,7 +44,9 @@ TouchManager::TouchManager() : mShowButtons(false), mButtonsSize(1), mJoystickSize(1), - mInGame(false) + mShow(false), + mInGame(false), + mTempHideButtons(false) { for (int f = 0; f < actionsSize; f ++) mActions[f] = false; @@ -159,7 +161,7 @@ void TouchManager::draw() it != it_end; ++ it) { const TouchItem *const item = *it; - if (item && item->images && (mInGame || item == mKeyboard)) + if (item && item->images && (mShow || item == mKeyboard)) { mainGraphics->calcWindow(mVertexes, item->x, item->y, item->width, item->height, *item->images); @@ -175,7 +177,7 @@ void TouchManager::draw() it != it_end; ++ it) { const TouchItem *const item = *it; - if (item && item->images && (mInGame || item == mKeyboard)) + if (item && item->images && (mShow || item == mKeyboard)) { mainGraphics->drawImageRect(item->x, item->y, item->width, item->height, *item->images); @@ -193,7 +195,7 @@ bool TouchManager::processEvent(const MouseInput &mouseInput) it != it_end; ++ it) { const TouchItem *const item = *it; - if (!item || (!mInGame && item != mKeyboard)) + if (!item || (!mShow && item != mKeyboard)) continue; const gcn::Rectangle &rect = item->rect; if (rect.isPointInRect(x, y)) @@ -398,5 +400,13 @@ void TouchManager::optionChanged(const std::string &value) void TouchManager::setInGame(bool b) { mInGame = b; + mShow = mInGame && !mTempHideButtons; + mRedraw = true; +} + +void TouchManager::setTempHide(bool b) +{ + mTempHideButtons = b; + mShow = mInGame && !mTempHideButtons; mRedraw = true; } |