diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-03-04 16:34:02 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-03-04 16:34:02 +0000 |
commit | 7a57cee0d153a4db1d82369aae9160e8ece9ba26 (patch) | |
tree | a64fd35942c72d8eb1250effaaca0f4b82768cfc /src/gui/equipment.cpp | |
parent | 47ddb7669a56c32597510d8153a6aa156bb4a397 (diff) | |
download | mana-7a57cee0d153a4db1d82369aae9160e8ece9ba26.tar.gz mana-7a57cee0d153a4db1d82369aae9160e8ece9ba26.tar.bz2 mana-7a57cee0d153a4db1d82369aae9160e8ece9ba26.tar.xz mana-7a57cee0d153a4db1d82369aae9160e8ece9ba26.zip |
A bunch of updates:
- inventory fixes
- equipment fixes
- graphic updates (items and monsters)
- weaponary system
- fixed status window
Diffstat (limited to 'src/gui/equipment.cpp')
-rw-r--r-- | src/gui/equipment.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/gui/equipment.cpp b/src/gui/equipment.cpp index 410be42b..770a88df 100644 --- a/src/gui/equipment.cpp +++ b/src/gui/equipment.cpp @@ -38,7 +38,8 @@ EquipmentWindow::EquipmentWindow(): itemset = new Spriteset(itemImg, 20, 20); for (int i = 0; i < 10; i++ ) { - equipments[i] = 0; + equipments[i].id = 0; + equipments[i].inventoryIndex = -1; } } @@ -55,12 +56,14 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) Window::draw(graphics); for (int i = 0; i < 8; i++) { - if (equipments[i] > 0) { - itemset->spriteset[equipments[i] - 501]->draw(screen, + if (equipments[i].id > 0) { + itemset->spriteset[equipments[i].id - 501]->draw(screen, x + 22, y + 24 * i + 20); } graphics->setColor(gcn::Color(0, 0, 0)); graphics->drawRectangle(gcn::Rectangle(22, 24 * i + 20, 20, 20)); + + } } @@ -69,10 +72,18 @@ void EquipmentWindow::action(const std::string &eventId) } void EquipmentWindow::addEquipment(int index, int id) { - equipments[index] = id; + equipments[index].id = id; } void EquipmentWindow::removeEquipment(int index) { - equipments[index] = 0; + equipments[index].id = 0; +} + +void EquipmentWindow::setInventoryIndex(int index, int inventoryIndex) { + equipments[index].inventoryIndex = inventoryIndex; +} + +int EquipmentWindow::getInventoryIndex(int index) { + return equipments[index].inventoryIndex; } |