summaryrefslogtreecommitdiff
path: root/src/touchmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-11 01:15:25 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-11 01:15:25 +0300
commitcddb3dd72f0fdf4639270596b3bcc252b3216c3a (patch)
tree8941d557f9b9fe27c9f8dbb2f4a9ddee26624871 /src/touchmanager.cpp
parentfcd7af5db04ada44f9351ed7c1cac5b19001ace8 (diff)
downloadmv-cddb3dd72f0fdf4639270596b3bcc252b3216c3a.tar.gz
mv-cddb3dd72f0fdf4639270596b3bcc252b3216c3a.tar.bz2
mv-cddb3dd72f0fdf4639270596b3bcc252b3216c3a.tar.xz
mv-cddb3dd72f0fdf4639270596b3bcc252b3216c3a.zip
Hide on screen buttons before enter to game and show in game.
Diffstat (limited to 'src/touchmanager.cpp')
-rw-r--r--src/touchmanager.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/touchmanager.cpp b/src/touchmanager.cpp
index 2780f186f..af90c65e3 100644
--- a/src/touchmanager.cpp
+++ b/src/touchmanager.cpp
@@ -43,7 +43,8 @@ TouchManager::TouchManager() :
mShowJoystick(false),
mShowButtons(false),
mButtonsSize(1),
- mJoystickSize(1)
+ mJoystickSize(1),
+ mInGame(false)
{
for (int f = 0; f < actionsSize; f ++)
mActions[f] = false;
@@ -158,7 +159,7 @@ void TouchManager::draw()
it != it_end; ++ it)
{
const TouchItem *const item = *it;
- if (item && item->images)
+ if (item && item->images && (mInGame || item == mKeyboard))
{
mainGraphics->calcWindow(mVertexes, item->x, item->y,
item->width, item->height, *item->images);
@@ -174,7 +175,7 @@ void TouchManager::draw()
it != it_end; ++ it)
{
const TouchItem *const item = *it;
- if (item && item->images)
+ if (item && item->images && (mInGame || item == mKeyboard))
{
mainGraphics->drawImageRect(item->x, item->y,
item->width, item->height, *item->images);
@@ -192,7 +193,7 @@ bool TouchManager::processEvent(const MouseInput &mouseInput)
it != it_end; ++ it)
{
const TouchItem *const item = *it;
- if (!item)
+ if (!item || (!mInGame && item != mKeyboard))
continue;
const gcn::Rectangle &rect = item->rect;
if (rect.isPointInRect(x, y))
@@ -393,3 +394,9 @@ void TouchManager::optionChanged(const std::string &value)
}
}
}
+
+void TouchManager::setInGame(bool b)
+{
+ mInGame = b;
+ mRedraw = true;
+}