summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-12-23 18:11:19 +0300
committerAndrei Karas <akaras@inbox.ru>2013-12-23 18:11:19 +0300
commit82ea830316b90bc4e55f2b34eb3c09df897df44d (patch)
tree8ad5aa10886708b4881369fe24c1c80e54169f20
parent7e25611234272081ae847a0388da84d09be3cb59 (diff)
downloadmanaverse-82ea830316b90bc4e55f2b34eb3c09df897df44d.tar.gz
manaverse-82ea830316b90bc4e55f2b34eb3c09df897df44d.tar.bz2
manaverse-82ea830316b90bc4e55f2b34eb3c09df897df44d.tar.xz
manaverse-82ea830316b90bc4e55f2b34eb3c09df897df44d.zip
in npc dialog at first try split long lines by spaces.
-rw-r--r--src/gui/widgets/extendedlistbox.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp
index 721a0a591..da9c4521e 100644
--- a/src/gui/widgets/extendedlistbox.cpp
+++ b/src/gui/widgets/extendedlistbox.cpp
@@ -90,8 +90,19 @@ void ExtendedListBox::draw(gcn::Graphics *graphics)
{
const int strSize = str.size();
int divPos = strSize / 2;
- if (divPos > 0 && (unsigned char)str[divPos - 1] >= 0xc0)
+ if (divPos > 0 && static_cast<unsigned char>(
+ str[divPos - 1]) >= 0xc0)
+ {
divPos --;
+ }
+ for (int d = divPos; d > 10; d --)
+ {
+ if (str[d] == 32)
+ {
+ divPos = d + 1;
+ break;
+ }
+ }
list.push_back(ExtendedListBoxItem(row,
str.substr(0, divPos), useImage, y));
str = str.substr(divPos);