summaryrefslogtreecommitdiff
path: root/src/gui/popups/itempopup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/popups/itempopup.cpp')
-rw-r--r--src/gui/popups/itempopup.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gui/popups/itempopup.cpp b/src/gui/popups/itempopup.cpp
index 3cb80b7ac..f7898d91a 100644
--- a/src/gui/popups/itempopup.cpp
+++ b/src/gui/popups/itempopup.cpp
@@ -270,8 +270,8 @@ void ItemPopup::setItem(const ItemInfo &item,
mItemName->adjustSize();
setLabelColor(mItemName, mItemType);
mItemName->setPosition(space, 0);
-
- mItemEffect->setTextWrapped(item.getEffect(), 196);
+ const std::string readableEffect = replaceChar((char*)item.getEffect().c_str(), '/', '\n');
+ mItemEffect->setTextWrapped(readableEffect, 196);
// TRANSLATORS: popup label
mItemWeight->setTextWrapped(strprintf(_("Weight: %s"),
UnitsDb::formatWeight(item.getWeight()).c_str()), 196);
@@ -466,3 +466,15 @@ void ItemPopup::resetPopup()
mLastColor = ItemColor_one;
mLastId = 0;
}
+
+char* ItemPopup::replaceChar(char* str, char find, char replace)
+{
+ char *currentPos = str;
+ while ((currentPos = strchr(currentPos, find)) != NULL)
+ {
+ *currentPos = ' ';
+ *currentPos++;
+ *currentPos = replace;
+ }
+ return str;
+}