summaryrefslogtreecommitdiff
path: root/src/gui/itempopup.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-08-26 16:55:05 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-08-26 16:55:05 +0200
commit6d9dbf93e6c0247cb9b19d3f52a1837a5833b22d (patch)
tree4e6e178095ac8cf89dc0dba4f532913891305436 /src/gui/itempopup.cpp
parentee8f131b49bb9b1d66cac3840b3c566eb49bcf3f (diff)
downloadmana-6d9dbf93e6c0247cb9b19d3f52a1837a5833b22d.tar.gz
mana-6d9dbf93e6c0247cb9b19d3f52a1837a5833b22d.tar.bz2
mana-6d9dbf93e6c0247cb9b19d3f52a1837a5833b22d.tar.xz
mana-6d9dbf93e6c0247cb9b19d3f52a1837a5833b22d.zip
Merged testing branch into master.
Diffstat (limited to 'src/gui/itempopup.cpp')
-rw-r--r--src/gui/itempopup.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/gui/itempopup.cpp b/src/gui/itempopup.cpp
index c926670a..ea33fda3 100644
--- a/src/gui/itempopup.cpp
+++ b/src/gui/itempopup.cpp
@@ -61,12 +61,12 @@ ItemPopup::ItemPopup():
// Item Effect
mItemEffect = new TextBox;
mItemEffect->setEditable(false);
- mItemEffect->setPosition(getPadding(), 2 * fontHeight + 2 * getPadding());
+ mItemEffect->setPosition(getPadding(), (fontHeight << 1) + (getPadding() << 1));
// Item Weight
mItemWeight = new TextBox;
mItemWeight->setEditable(false);
- mItemWeight->setPosition(getPadding(), 3 * fontHeight + 4 * getPadding());
+ mItemWeight->setPosition(getPadding(), fontHeight * 3 + (getPadding() << 2));
mIcon = new Icon(0);
@@ -121,18 +121,27 @@ void ItemPopup::setItem(const ItemInfo &item, bool showImage)
mIcon->setImage(0);
}
- mItemType = item.getType();
+ //mItemType = item.getType();
mItemName->setCaption(item.getName());
mItemName->adjustSize();
- mItemName->setForegroundColor(getColor(mItemType));
+ mItemName->setForegroundColor(Theme::UNKNOWN_ITEM); // TODO
mItemName->setPosition(getPadding() + space, getPadding());
- mItemDesc->setTextWrapped(item.getDescription(), 196);
- mItemEffect->setTextWrapped(item.getEffect(), 196);
+#define ITEMPOPUP_WRAP_WIDTH 196
+
+ mItemDesc->setTextWrapped(item.getDescription(), ITEMPOPUP_WRAP_WIDTH);
+ {
+ const std::vector<std::string> &effect = item.getEffect();
+ std::string temp = "";
+ for (std::vector<std::string>::const_iterator it = effect.begin(),
+ it_end = effect.end(); it != it_end; ++it)
+ temp += temp.empty() ? *it : "\n" + *it;
+ mItemEffect->setTextWrapped(temp, ITEMPOPUP_WRAP_WIDTH);
+ }
mItemWeight->setTextWrapped(strprintf(_("Weight: %s"),
Units::formatWeight(item.getWeight()).c_str()),
- 196);
+ ITEMPOPUP_WRAP_WIDTH);
int minWidth = mItemName->getWidth() + space;