diff options
author | Eugene Sandulenko | 2016-02-04 18:27:23 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-02-14 17:13:01 +0100 |
commit | 30713e4262fee800fcbafaab01e7c7b785c5d0c8 (patch) | |
tree | 0981b23b9541b06f8ffcaf4aa6acf4f9cb748492 /engines | |
parent | 5ac25816456b24baae06f84708262397092efaea (diff) | |
download | scummvm-rg350-30713e4262fee800fcbafaab01e7c7b785c5d0c8.tar.gz scummvm-rg350-30713e4262fee800fcbafaab01e7c7b785c5d0c8.tar.bz2 scummvm-rg350-30713e4262fee800fcbafaab01e7c7b785c5d0c8.zip |
WAGE: Implement highlighting one line selection
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wage/gui.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index 2ea8e82912..fc606e0907 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -534,6 +534,26 @@ void Gui::renderConsole(Graphics::Surface *g, Common::Rect &r) { font->drawString(&_console, beg, x1, y1, textW, color1); font->drawString(&_console, end, x1 + rectW - kConWPadding - kConWOverlap, y1, textW, color2); + } else { + int startPos = _selectionStartX; + int endPos = _selectionEndX; + + if (startPos > endPos) + SWAP(startPos, endPos); + + Common::String beg(_lines[line].c_str(), &_lines[line].c_str()[startPos]); + Common::String mid(&_lines[line].c_str()[startPos], &_lines[line].c_str()[endPos]); + Common::String end(&_lines[line].c_str()[endPos]); + + int rectW1 = font->getStringWidth(beg) + kConWPadding + kConWOverlap; + int rectW2 = rectW1 + font->getStringWidth(mid); + Common::Rect trect(rectW1, y1, rectW2, y1 + _consoleLineHeight); + + Design::drawFilledRect(&_console, trect, kColorBlack, _patterns, kPatternSolid); + + font->drawString(&_console, beg, x1, y1, textW, kColorBlack); + font->drawString(&_console, mid, x1 + rectW1 - kConWPadding - kConWOverlap, y1, textW, kColorWhite); + font->drawString(&_console, end, x1 + rectW2 - kConWPadding - kConWOverlap, y1, textW, kColorBlack); } } else { if (*str) |