summaryrefslogtreecommitdiff
path: root/src/gui/inventorywindow.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2008-12-08 12:17:06 -0700
committerIra Rice <irarice@gmail.com>2008-12-08 12:17:06 -0700
commite0f461d88eafac00ce67fe1f980e6b263d9916c6 (patch)
tree2b826db8957741f26f0654b3b5d9a353d55da9a1 /src/gui/inventorywindow.cpp
parent332f02da85370a6a2cd5ddc53e252fe2ae3eb53b (diff)
downloadmana-client-e0f461d88eafac00ce67fe1f980e6b263d9916c6.tar.gz
mana-client-e0f461d88eafac00ce67fe1f980e6b263d9916c6.tar.bz2
mana-client-e0f461d88eafac00ce67fe1f980e6b263d9916c6.tar.xz
mana-client-e0f461d88eafac00ce67fe1f980e6b263d9916c6.zip
Compacted the inventory window layout.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/inventorywindow.cpp')
-rw-r--r--src/gui/inventorywindow.cpp28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index 302d2cab..621a85d3 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -67,14 +67,12 @@ InventoryWindow::InventoryWindow():
mItemDescriptionLabel = new TextBox();
mItemEffect = "Effect:";
mItemEffectLabel = new TextBox();
- mWeight = "Total Weight: " + mTotalWeight + " g - " +
- "Maximum Weight: " + mMaxWeight + " g";
+ mWeight = "Weight: " + mTotalWeight + " g / " +
+ mMaxWeight + " g Slots: " +
+ toString(player_node->getInventory()->getNumberOfSlotsUsed()) +
+ "/" + toString(player_node->getInventory()->getInventorySize());
mWeightLabel = new TextBox();
mWeightLabel->setPosition(8, 8);
- mSlots = "Slots: " +
- toString(player_node->getInventory()->getNumberOfSlotsUsed()) +
- "/" + toString(player_node->getInventory()->getInventorySize());
- mSlotsLabel = new TextBox();
mItemEffectLabel = new TextBox();
draw();
@@ -86,7 +84,6 @@ InventoryWindow::InventoryWindow():
add(mItemDescriptionLabel);
add(mItemEffectLabel);
add(mWeightLabel);
- add(mSlotsLabel);
mUseButton->setSize(60, mUseButton->getHeight());
@@ -108,10 +105,8 @@ void InventoryWindow::logic()
mMaxWeight = toString(player_node->mMaxWeight);
// Adjust widgets
- mWeight = "Total Weight: " + mTotalWeight + " g - " +
- "Maximum Weight: " + mMaxWeight + " g";
-
- mSlots = "Slots: " +
+ mWeight = "Weight: " + mTotalWeight + " g / " +
+ mMaxWeight + " g Slots: " +
toString(player_node->getInventory()->getNumberOfSlotsUsed()) +
"/" + toString(player_node->getInventory()->getInventorySize());
@@ -230,19 +225,12 @@ void InventoryWindow::draw()
mItemEffectLabel->getY() - 5 - (mItemDescriptionLabel->getNumberOfRows()*15),
width - 16,
(mItemDescriptionLabel->getNumberOfRows()*15)));
- mSlotsLabel->setMinWidth(width - 16);
- mSlotsLabel->setTextWrapped(mSlots);
- mSlotsLabel->setDimension(gcn::Rectangle(8,
- mItemDescriptionLabel->getY() - 5 - (mSlotsLabel->getNumberOfRows()*15),
- width - 16,
- (mSlotsLabel->getNumberOfRows()*15)));
mInvenScroll->setSize(width - 16,
- mSlotsLabel->getY() - (mWeightLabel->getNumberOfRows()*15) - 18);
+ mItemDescriptionLabel->getY() - (mWeightLabel->getNumberOfRows()*15) - 18);
mInvenScroll->setPosition(8, (mWeightLabel->getNumberOfRows()*15) + 10);
- setMinHeight(130 + (mSlotsLabel->getNumberOfRows()*15) +
- (mWeightLabel->getNumberOfRows()*15) +
+ setMinHeight(130 + (mWeightLabel->getNumberOfRows()*15) +
(mItemDescriptionLabel->getNumberOfRows()*15) +
(mItemEffectLabel->getNumberOfRows()*15) +
(mItemNameLabel->getNumberOfRows()*15));