summaryrefslogtreecommitdiff
path: root/src/gui/equipment.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2005-03-04 16:34:02 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2005-03-04 16:34:02 +0000
commit7a57cee0d153a4db1d82369aae9160e8ece9ba26 (patch)
treea64fd35942c72d8eb1250effaaca0f4b82768cfc /src/gui/equipment.cpp
parent47ddb7669a56c32597510d8153a6aa156bb4a397 (diff)
downloadmana-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.cpp21
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;
}