summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-07-28 12:32:12 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-07-28 12:32:12 +0000
commit51b75feaefd132ee0b7992a10dbe79bfa92e6d91 (patch)
tree91b1d54ae1ec29cc835f7d5198a04115c1874894 /src/game.cpp
parent227aeae87bcca1ecb0183530a4cca1b038863635 (diff)
downloadmana-51b75feaefd132ee0b7992a10dbe79bfa92e6d91.tar.gz
mana-51b75feaefd132ee0b7992a10dbe79bfa92e6d91.tar.bz2
mana-51b75feaefd132ee0b7992a10dbe79bfa92e6d91.tar.xz
mana-51b75feaefd132ee0b7992a10dbe79bfa92e6d91.zip
Cleaned up the showPopup() code, moved "map"-related code into game.cpp, made the popup show up at mouse coordinates instead of being aligned to tiles.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 98be0bc6..f5bd366c 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -632,7 +632,19 @@ void do_input()
// Mouse button right
else if (event.button.button == SDL_BUTTON_RIGHT)
{
- popupMenu->showPopup(mx, my);
+ Being *being;
+ FloorItem *floorItem;
+
+ if ((being = findNode(mx, my))) {
+ popupMenu->showPopup(event.button.x, event.button.y,
+ being);
+ } else if ((floorItem = find_floor_item_by_id(
+ find_floor_item_by_cor(mx, my)))) {
+ popupMenu->showPopup(event.button.x, event.button.y,
+ floorItem);
+ } else {
+ popupMenu->setVisible(false);
+ }
}
}