diff options
author | Cedric Borgese <cedric.borgese@gmail.com> | 2005-07-22 17:27:59 +0000 |
---|---|---|
committer | Cedric Borgese <cedric.borgese@gmail.com> | 2005-07-22 17:27:59 +0000 |
commit | 5731ddbf5ef5fa1556a7c5f84c0c71865a15499b (patch) | |
tree | 967cfacdf62a8930be9691152746b6f0e6b35a6e /src/gui/inventorywindow.cpp | |
parent | 4333effa0e80c996c91e4014cf449c30a32120b7 (diff) | |
download | mana-5731ddbf5ef5fa1556a7c5f84c0c71865a15499b.tar.gz mana-5731ddbf5ef5fa1556a7c5f84c0c71865a15499b.tar.bz2 mana-5731ddbf5ef5fa1556a7c5f84c0c71865a15499b.tar.xz mana-5731ddbf5ef5fa1556a7c5f84c0c71865a15499b.zip |
Merge between moi1392's branch and head
Diffstat (limited to 'src/gui/inventorywindow.cpp')
-rw-r--r-- | src/gui/inventorywindow.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index 06eb8ce0..377acc1f 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -22,8 +22,10 @@ */ #include "inventorywindow.h" +#include "popupmenu.h" #include "../playerinfo.h" #include "../inventory.h" +#include "../engine.h" #include "button.h" #include "scrollarea.h" #include "item_amount.h" @@ -141,6 +143,17 @@ void InventoryWindow::mouseClick(int x, int y, int button, int count) SomeText = "Description: " + item->getInfo()->getDescription(); itemDescriptionLabel->setCaption(SomeText); itemDescriptionLabel->adjustSize(); + + if (button == gcn::MouseInput::RIGHT) + { + /* + * convert relative to the window coordinates to + * absolute tile coordinates + */ + int mx = (x + getX()) / 32 + camera_x; + int my = (y + getY()) / 32 + camera_y; + popupMenu->showPopup(mx, my, item); + } } void InventoryWindow::mouseMotion(int mx, int my) |