changes in parsing message texts

This commit is contained in:
Pawel Kolodziejski 2005-01-02 13:34:50 +00:00
parent 631db27920
commit 1e4fdcada6
5 changed files with 126 additions and 74 deletions

View file

@ -31,13 +31,11 @@ void TextObject::setX(int x) {_x = x; }
void TextObject::setY(int y) {_y = y; }
void TextObject::setColor(Color *newcolor) { _fgColor = newcolor; }
std::string parseMsgText(char *msg, char *msgId);
void TextObject::draw() {
const char *localString = g_localizer->localize(_textID).c_str();
// This is also used for things like debugging in addition
// to dialogue so there aren't always translations
if (strrchr(localString, '/') != NULL) {
g_driver->drawEmergString(_x, _y, strrchr(localString, '/') + 1, _fgColor);
} else {
g_driver->drawEmergString(_x, _y, localString, _fgColor);
}
char msgId[32];
std::string msg = parseMsgText(_textID, msgId);
g_driver->drawEmergString(_x, _y, msg.c_str(), _fgColor);
}