diff options
author | Ira Rice <irarice@gmail.com> | 2009-01-20 12:35:38 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-20 12:35:38 -0700 |
commit | 7db9e03f34bf150dbcfec981cc3b4105bda92ada (patch) | |
tree | 906e18e622f6965822ceaaa191bdebc9d236cef3 /src/gui/itemlinkhandler.cpp | |
parent | f404997629d9a34f5a15261073536903a59a604c (diff) | |
download | mana-7db9e03f34bf150dbcfec981cc3b4105bda92ada.tar.gz mana-7db9e03f34bf150dbcfec981cc3b4105bda92ada.tar.bz2 mana-7db9e03f34bf150dbcfec981cc3b4105bda92ada.tar.xz mana-7db9e03f34bf150dbcfec981cc3b4105bda92ada.zip |
Changed item popup drawing to be based on the mouse position, not window
position.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/itemlinkhandler.cpp')
-rw-r--r-- | src/gui/itemlinkhandler.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/itemlinkhandler.cpp b/src/gui/itemlinkhandler.cpp index bdfa2ca6..34c12a0c 100644 --- a/src/gui/itemlinkhandler.cpp +++ b/src/gui/itemlinkhandler.cpp @@ -19,6 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include <SDL_mouse.h> + #include "itemlinkhandler.h" #include "itempopup.h" @@ -47,14 +49,15 @@ void ItemLinkHandler::handleLink(const std::string &link) if (id > 0) { const ItemInfo &iteminfo = ItemDB::get(id); + int mouseX, mouseY; + + SDL_GetMouseState(&mouseX, &mouseY); + mItemPopup->setItem(iteminfo); + if (mItemPopup->isVisible()) - { mItemPopup->setVisible(false); - } else - { - mItemPopup->setVisible(true); - } + mItemPopup->view(mouseX, mouseY); } } |