From 66fd67f04a113fd1f1052f879a890615d334024c Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Fri, 8 Apr 2005 13:58:41 +0000 Subject: Updated change log and made mouse walk only work with left mouse button. --- src/gui/gui.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/gui') diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index c79d0833..436a5a1a 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -99,14 +99,17 @@ void Gui::draw() void Gui::mousePress(int mx, int my, int button) { // Mouse pressed on window container (basically, the map) - int tilex = mx / 32 + camera_x; - int tiley = my / 32 + camera_y; - // Experimental mouse walk support - if (state == GAME && tiledMap->getWalk(tilex, tiley)) { - walk(tilex, tiley, 0); - player_node->setPath(tiledMap->findPath( - player_node->x, player_node->y, - tilex, tiley)); + + if (button == gcn::MouseInput::LEFT) { + int tilex = mx / 32 + camera_x; + int tiley = my / 32 + camera_y; + + if (state == GAME && tiledMap->getWalk(tilex, tiley)) { + walk(tilex, tiley, 0); + player_node->setPath(tiledMap->findPath( + player_node->x, player_node->y, + tilex, tiley)); + } } } -- cgit v1.2.3-70-g09d2