diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-23 16:45:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-23 16:45:46 +0300 |
commit | d20744c0ff83572dc209389df900826b7d088546 (patch) | |
tree | b6a91790f6c52d016e57cfdba687251c1f01409f /src/gui/windows | |
parent | a22d7bce703101ba3ae15cb5b8545381dfe863c4 (diff) | |
download | manaverse-d20744c0ff83572dc209389df900826b7d088546.tar.gz manaverse-d20744c0ff83572dc209389df900826b7d088546.tar.bz2 manaverse-d20744c0ff83572dc209389df900826b7d088546.tar.xz manaverse-d20744c0ff83572dc209389df900826b7d088546.zip |
Add support for additional slots in net code.
Now projectile slot depend on server.
Diffstat (limited to 'src/gui/windows')
-rw-r--r-- | src/gui/windows/equipmentwindow.cpp | 7 | ||||
-rw-r--r-- | src/gui/windows/statuswindow.cpp | 5 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index e37d623d6..a78052404 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -53,11 +53,13 @@ #include "utils/dtor.h" #include "utils/gettext.h" +#include "net/inventoryhandler.h" + #include "debug.h" EquipmentWindow *equipmentWindow = nullptr; EquipmentWindow *beingEquipmentWindow = nullptr; -static const int BOX_COUNT = 22; +static const int BOX_COUNT = 27; std::map<std::string, int> EquipmentWindow::mSlotNames; EquipmentWindow::EquipmentWindow(Equipment *const equipment, @@ -241,6 +243,7 @@ void EquipmentWindow::draw(Graphics *graphics) } i = 0; + const int projSlot = inventoryHandler->getProjectileSlot(); for (std::vector<EquipmentBox*>::const_iterator it = boxes.begin(), it_end = boxes.end(); it != it_end; ++ it, ++ i) { @@ -258,7 +261,7 @@ void EquipmentWindow::draw(Graphics *graphics) // with maximum opacity graphics->drawImage(image, box->x + mItemPadding, box->y + mItemPadding); - if (i == ItemSlot::PROJECTILE_SLOT) + if (i == projSlot) { graphics->setColorAll(mLabelsColor, mLabelsColor2); const std::string str = toString(item->getQuantity()); diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp index 9d979f27f..8803654c8 100644 --- a/src/gui/windows/statuswindow.cpp +++ b/src/gui/windows/statuswindow.cpp @@ -50,8 +50,9 @@ #include "gui/widgets/vertcontainer.h" #include "gui/widgets/windowcontainer.h" -#include "net/playerhandler.h" #include "net/gamehandler.h" +#include "net/inventoryhandler.h" +#include "net/playerhandler.h" #include "utils/delete2.h" #include "utils/gettext.h" @@ -585,7 +586,7 @@ void StatusWindow::updateArrowsBar(ProgressBar *const bar) return; const Item *const item = equipmentWindow->getEquipment( - Equipment::EQUIP_PROJECTILE_SLOT); + inventoryHandler->getProjectileSlot()); if (item && item->getQuantity() > 0) bar->setText(toString(item->getQuantity())); |