GRAPHICS: Implemented MacText::replaceLastLine()

This commit is contained in:
Eugene Sandulenko 2016-12-22 18:15:43 +01:00
parent a1236d5782
commit 57864f5e6c
2 changed files with 12 additions and 1 deletions

View File

@ -144,4 +144,15 @@ void MacText::appendText(Common::String str) {
render(oldLen + 1, _text.size());
}
void MacText::replaceLastLine(Common::String str) {
int oldLen = MAX<int>(0, _text.size() - 1);
if (_text.size())
_text.pop_back();
splitString(str);
render(oldLen, _text.size());
}
} // End of namespace Graphics

View File

@ -36,7 +36,7 @@ public:
void draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff);
void appendText(Common::String str);
void replaceLastLine(Common::String str);
private:
void splitString(Common::String &s);