summaryrefslogtreecommitdiff
path: root/src/gui/inventorywindow.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-01-14 16:45:13 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-01-14 16:45:13 +0000
commitd1395845cdc678db2a71326f2e6f20253ed14cac (patch)
tree9a75fe0591fc7bd74f828aa048aa027f59a4ae66 /src/gui/inventorywindow.cpp
parent6c3a2550813c14290307f2ad91e1d76eea3e6a02 (diff)
downloadmana-client-d1395845cdc678db2a71326f2e6f20253ed14cac.tar.gz
mana-client-d1395845cdc678db2a71326f2e6f20253ed14cac.tar.bz2
mana-client-d1395845cdc678db2a71326f2e6f20253ed14cac.tar.xz
mana-client-d1395845cdc678db2a71326f2e6f20253ed14cac.zip
Merged 0.0 changes from revision 2988 to 3035 to trunk.
Diffstat (limited to 'src/gui/inventorywindow.cpp')
-rw-r--r--src/gui/inventorywindow.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index 7f9ba3b9..e533c16c 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -99,7 +99,7 @@ void InventoryWindow::logic()
mWeightLabel->adjustSize();
}
-void InventoryWindow::action(const std::string &eventId, gcn::Widget *widget)
+void InventoryWindow::action(const gcn::ActionEvent &event)
{
Item *item = mItems->getItem();
@@ -107,7 +107,7 @@ void InventoryWindow::action(const std::string &eventId, gcn::Widget *widget)
return;
}
- if (eventId == "use") {
+ if (event.getId() == "use") {
if (item->isEquipment()) {
if (item->isEquipped()) {
player_node->unequipItem(item);
@@ -120,7 +120,7 @@ void InventoryWindow::action(const std::string &eventId, gcn::Widget *widget)
player_node->useItem(item);
}
}
- else if (eventId == "drop")
+ else if (event.getId() == "drop")
{
// Choose amount of items to drop
new ItemAmountWindow(AMOUNT_ITEM_DROP, this, item);
@@ -155,11 +155,11 @@ void InventoryWindow::selectionChanged(const SelectionEvent &event)
}
}
-void InventoryWindow::mouseClick(int x, int y, int button, int count)
+void InventoryWindow::mouseClicked(gcn::MouseEvent &event)
{
- Window::mouseClick(x, y, button, count);
+ Window::mouseClicked(event);
- if (button == gcn::MouseInput::RIGHT)
+ if (event.getButton() == gcn::MouseEvent::RIGHT)
{
Item *item = mItems->getItem();
@@ -168,16 +168,16 @@ void InventoryWindow::mouseClick(int x, int y, int button, int count)
/* Convert relative to the window coordinates to
* absolute screen coordinates.
*/
- int mx = x + getX();
- int my = y + getY();
+ int mx = event.getX() + getX();
+ int my = event.getY() + getY();
viewport->showPopup(mx, my, item);
}
}
-void InventoryWindow::mouseMotion(int mx, int my)
+void InventoryWindow::mouseDragged(gcn::MouseEvent &event)
{
int tmpWidth = getWidth(), tmpHeight = getHeight();
- Window::mouseMotion(mx, my);
+ Window::mouseDragged(event);
if (getWidth() != tmpWidth || getHeight() != tmpHeight) {
updateWidgets();
}