mirror of
https://github.com/vcmi/vcmi.git
synced 2025-05-13 22:06:58 +02:00
Ellipsis in messages will not be broken apart, as with the description for Speculum.
This commit is contained in:
parent
9ebd6883ce
commit
4845ba80bd
@ -152,15 +152,21 @@ std::vector<std::string> * CMessage::breakText(std::string text, size_t maxLineS
|
|||||||
* suitable character. */
|
* suitable character. */
|
||||||
int pos = z-1;
|
int pos = z-1;
|
||||||
|
|
||||||
|
// Do not break an ellipsis, backtrack until whitespace.
|
||||||
|
if (text[z] == '.') {
|
||||||
|
while (pos != 0 && text[pos] != ' ')
|
||||||
|
pos--;
|
||||||
|
} else {
|
||||||
/* TODO: boost should have a nice method to do that. */
|
/* TODO: boost should have a nice method to do that. */
|
||||||
while(pos > 0 &&
|
while(pos > 0 &&
|
||||||
text[pos] != ' ' &&
|
text[pos] != ' ' &&
|
||||||
text[pos] != ',' &&
|
text[pos] != ',' &&
|
||||||
text[pos] != '.' &&
|
text[pos] != '.' &&
|
||||||
text[pos] != ';' &&
|
text[pos] != ';' &&
|
||||||
text[pos] != '!' &&
|
text[pos] != '!' &&
|
||||||
text[pos] != '?')
|
text[pos] != '?')
|
||||||
pos --;
|
pos --;
|
||||||
|
}
|
||||||
if (pos > 0)
|
if (pos > 0)
|
||||||
z = pos+1;
|
z = pos+1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user