diff options
author | Ira Rice <irarice@gmail.com> | 2009-03-26 09:55:21 -0600 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-03-26 09:55:21 -0600 |
commit | f883ad28b77a499fa66497158db425ce1db50f78 (patch) | |
tree | 47156bc38c68130d1fb83f8d83b2543375d17d1a /src/gui/equipmentwindow.cpp | |
parent | 58eb615a589cd6444092f9c928f26210087aa78b (diff) | |
download | mana-f883ad28b77a499fa66497158db425ce1db50f78.tar.gz mana-f883ad28b77a499fa66497158db425ce1db50f78.tar.bz2 mana-f883ad28b77a499fa66497158db425ce1db50f78.tar.xz mana-f883ad28b77a499fa66497158db425ce1db50f78.zip |
Some code cleanups (mostly reducing how many calculations need to be
done in certain statements, rearranging arguements to make them look
cleaner, or overall making the code slightly more flexible)
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/equipmentwindow.cpp')
-rw-r--r-- | src/gui/equipmentwindow.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index 31fe3b8b..168ae22f 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -122,7 +122,7 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) // Set color to the highligh color g->setColor(gcn::Color(color.r, color.g, color.b, getGuiAlpha())); g->fillRectangle(gcn::Rectangle(mEquipBox[i].posX, mEquipBox[i].posY, - BOX_WIDTH, BOX_HEIGHT)); + BOX_WIDTH, BOX_HEIGHT)); } // Set color black. @@ -200,13 +200,8 @@ void EquipmentWindow::mousePressed(gcn::MouseEvent& mouseEvent) gcn::Rectangle tRect(mEquipBox[i].posX, mEquipBox[i].posY, BOX_WIDTH, BOX_HEIGHT); - if (tRect.isPointInRect(x, y)) - { - if (item) - { - mSelected = i; - } - } + if (tRect.isPointInRect(x, y) && item) + mSelected = i; } } else if (mouseEvent.getButton() == gcn::MouseEvent::RIGHT) |