diff options
author | Ira Rice <irarice@gmail.com> | 2009-02-04 14:45:20 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-02-04 14:45:20 -0700 |
commit | 1e20fad127583d7832130ecf50ca90d190ede91b (patch) | |
tree | a83482c7457e0c2ca962dfd3f07394c275a0e6d8 | |
parent | 35c4cb970f14989445828aefa4cf17f3260f9281 (diff) | |
download | mana-1e20fad127583d7832130ecf50ca90d190ede91b.tar.gz mana-1e20fad127583d7832130ecf50ca90d190ede91b.tar.bz2 mana-1e20fad127583d7832130ecf50ca90d190ede91b.tar.xz mana-1e20fad127583d7832130ecf50ca90d190ede91b.zip |
Forgot to check left clicking, as I assumed that it wouldn't break using
the same lookup code. This fixes left clicking on the last commit.
Signed-off-by: Ira Rice <irarice@gmail.com>
-rw-r--r-- | src/gui/equipmentwindow.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index f5ab604e..7630c53c 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -188,12 +188,18 @@ void EquipmentWindow::mousePressed(gcn::MouseEvent& mouseEvent) // Checks if any of the presses were in the equip boxes. for (int i = EQUIP_LEGS_SLOT; i < EQUIP_VECTOREND; i++) { - item = getItem(x, y); + item = (i != EQUIP_AMMO_SLOT) ? + mInventory->getItem(mEquipment->getEquipment(i)) : + mInventory->getItem(mEquipment->getArrows()); + gcn::Rectangle tRect(mEquipBox[i].posX, mEquipBox[i].posY, + BOX_WIDTH, BOX_HEIGHT); - if (item) + if (tRect.isPointInRect(x, y)) { - mSelected = i; - break; + if (item) + { + mSelected = i; + } } } } |