summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-07-28 22:18:05 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-07-28 22:18:05 +0000
commit5b6ca06022be1f78b5c39387f71a7bf6580a66bd (patch)
tree6f07d390ed7ee81eef797b4848e13bc930105670
parent81caf032f4f0c852c57eb95a2d049cc8ec964c44 (diff)
downloadmana-client-5b6ca06022be1f78b5c39387f71a7bf6580a66bd.tar.gz
mana-client-5b6ca06022be1f78b5c39387f71a7bf6580a66bd.tar.bz2
mana-client-5b6ca06022be1f78b5c39387f71a7bf6580a66bd.tar.xz
mana-client-5b6ca06022be1f78b5c39387f71a7bf6580a66bd.zip
Fixed popup window not always being correctly hidden when the player clicks somewhere else.
-rw-r--r--ChangeLog5
-rw-r--r--src/game.cpp11
2 files changed, 9 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 3ef8ae12..f37afd18 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-29 Björn Steinbrink <B.Steinbrink@gmx.de>
+
+ * src/game.cpp: Fixed popup window not always being correctly hidden when
+ the player clicks somewhere else.
+
2005-07-28 Björn Steinbrink <B.Steinbrink@gmx.de>
* src/main.cpp, src/gui/update.cpp, src/resources/resourcemanager.cpp,
diff --git a/src/game.cpp b/src/game.cpp
index ff1621d6..191141a8 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -601,20 +601,17 @@ void do_input()
// Just cancel the popup menu if shown, and don't make the character walk
if (popupMenu->isVisible() == true)
{
- // We get the x, y coord of the click
- int clickX = (mx - camera_x) * 32 + 25;
- int clickY = (my - camera_y) * 32 + 25;
-
// If we click elsewhere than in the window, do not use the event
// The user wanted to close the popup.
// Still buggy : Wonder if the x, y, width, and height aren't reported partially
// with these functions.
- if ( clickX > (popupMenu->getX() + popupMenu->getWidth()) || clickX < popupMenu->getX()
- || clickY > (popupMenu->getY() + popupMenu->getHeight()) || clickY < popupMenu->getY() )
+ if (event.button.x >= (popupMenu->getX() + popupMenu->getWidth()) ||
+ event.button.x < popupMenu->getX() ||
+ event.button.y >= (popupMenu->getY() + popupMenu->getHeight()) ||
+ event.button.y < popupMenu->getY())
{
used = true;
popupMenu->setVisible(false);
- std::cout << "out" << std::endl;
}
}