summaryrefslogtreecommitdiff
path: root/src/touchmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-16 02:50:13 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-16 02:50:13 +0300
commita9ddb1992d186d559f24370a33a987e281c134c5 (patch)
treee661ef11486bdfde907b6bf5dee0c4988911ddb9 /src/touchmanager.cpp
parenta44ad060d637ec363100d05ffc5a11fb52fef4af (diff)
downloadmv-a9ddb1992d186d559f24370a33a987e281c134c5.tar.gz
mv-a9ddb1992d186d559f24370a33a987e281c134c5.tar.bz2
mv-a9ddb1992d186d559f24370a33a987e281c134c5.tar.xz
mv-a9ddb1992d186d559f24370a33a987e281c134c5.zip
Hide screen buttons and joystick if setup window is opened.
Diffstat (limited to 'src/touchmanager.cpp')
-rw-r--r--src/touchmanager.cpp18
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;
}