diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-07-26 23:52:15 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-07-26 23:52:15 +0000 |
commit | aa362286c725e17ec88aa46f8f6af9ca90d744b3 (patch) | |
tree | eedf5d13d3bcc809430e52dbb5047b95c5532e91 /src/gui/gui.cpp | |
parent | 9e4f25acd69489d949104eebec690ce5586849e6 (diff) | |
download | mana-aa362286c725e17ec88aa46f8f6af9ca90d744b3.tar.gz mana-aa362286c725e17ec88aa46f8f6af9ca90d744b3.tar.bz2 mana-aa362286c725e17ec88aa46f8f6af9ca90d744b3.tar.xz mana-aa362286c725e17ec88aa46f8f6af9ca90d744b3.zip |
Removed continous mouse movement
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index ca5c8133..1e101c5b 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -50,9 +50,7 @@ gcn::ImageFont *speechFont; Gui::Gui(Graphics *graphics): mHostImageLoader(NULL), mMouseCursor(NULL), - mCustomCursor(false), - mMouseWalk(false), - mMouseX(0), mMouseY(0) + mCustomCursor(false) { // Set graphics guiGraphics = graphics; @@ -209,19 +207,6 @@ void Gui::logic() // Work around Guichan bug of only applying focus on mouse or keyboard // events. mFocusHandler->applyChanges(); - - if (mMouseWalk) { - Map *tiledMap = engine->getCurrentMap(); - int tilex = mMouseX / 32 + camera_x; - int tiley = mMouseY / 32 + camera_y; - - if (state == GAME && tiledMap->getWalk(tilex, tiley)) { - walk(tilex, tiley, 0); - player_node->setDestination(tilex, tiley); - - autoTarget = NULL; - } - } } void Gui::draw() @@ -256,24 +241,21 @@ void Gui::mousePress(int mx, int my, int button) { // Mouse pressed on window container (basically, the map) - // When conditions for walking are met, start moving by mouse + // When conditions for walking are met, set new player destination if (player_node && player_node->action != DEAD && current_npc == 0 && button == gcn::MouseInput::LEFT) { - mMouseWalk = true; - } -} + Map *tiledMap = engine->getCurrentMap(); + int tilex = mx / 32 + camera_x; + int tiley = my / 32 + camera_y; -void Gui::mouseRelease(int x, int y, int button) -{ - gcn::MouseListener::mouseRelease(x, y, button); - mMouseWalk = false; -} + if (state == GAME && tiledMap->getWalk(tilex, tiley)) { + walk(tilex, tiley, 0); + player_node->setDestination(tilex, tiley); -void Gui::mouseMotion(int mx, int my) -{ - mMouseX = mx; - mMouseY = my; + autoTarget = NULL; + } + } } gcn::ImageFont *Gui::getFont() |