summaryrefslogtreecommitdiff
path: root/src/gui/inventorywindow.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-01-14 14:54:39 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-01-14 14:54:39 +0000
commitf842e0b40d8382011f0bc46b1446945d99ac0425 (patch)
tree5ddbb7c146a8ece28a4260d788350b1c2cf0dbed /src/gui/inventorywindow.cpp
parentcbbcc5489e2f72a76b66ae849cbe8f1dc44246ca (diff)
downloadmana-client-f842e0b40d8382011f0bc46b1446945d99ac0425.tar.gz
mana-client-f842e0b40d8382011f0bc46b1446945d99ac0425.tar.bz2
mana-client-f842e0b40d8382011f0bc46b1446945d99ac0425.tar.xz
mana-client-f842e0b40d8382011f0bc46b1446945d99ac0425.zip
Upgraded to Guichan 0.6.0 (merge from guichan-0.6.0 branch).
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 75b63208..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();
}