diff options
author | Eugene Sandulenko | 2016-02-03 11:01:41 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-02-14 17:12:58 +0100 |
commit | d812706328ddd31bd23b425d7d4eb7777d29ae55 (patch) | |
tree | 9455e3608a0e16bc6103346b6e0e22c25d0c7373 /engines/wage/gui.cpp | |
parent | 63ef49ec8afa761b89b809811699321c6fe5826e (diff) | |
download | scummvm-rg350-d812706328ddd31bd23b425d7d4eb7777d29ae55.tar.gz scummvm-rg350-d812706328ddd31bd23b425d7d4eb7777d29ae55.tar.bz2 scummvm-rg350-d812706328ddd31bd23b425d7d4eb7777d29ae55.zip |
WAGE: Started text selection implementation
Diffstat (limited to 'engines/wage/gui.cpp')
-rw-r--r-- | engines/wage/gui.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index 1f07b2a382..3bd47bbbb5 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -155,6 +155,8 @@ Gui::Gui(WageEngine *engine) { _cursorState = false; _cursorOff = false; + _inTextSelection = false; + g_system->getPaletteManager()->setPalette(palette, 0, 4); CursorMan.replaceCursorPalette(palette, 0, 4); @@ -649,8 +651,21 @@ Designed *Gui::mouseUp(int x, int y) { } void Gui::mouseDown(int x, int y) { - if (_menu->mouseClick(x, y)) + if (_menu->mouseClick(x, y)) { _menuDirty = true; + } else if (_consoleTextArea.contains(x, y)) { + startMarking(x, y); + } +} + +void Gui::startMarking(int x, int y) { + const int firstLine = _scrollPos / _consoleLineHeight; + int textLine = (y - kConHOverlap - kConHPadding - _scrollPos % _consoleLineHeight - _consoleTextArea.top) / _consoleLineHeight + firstLine; + int charPos = x - kConWOverlap - kConWPadding - _consoleTextArea.left; + + _inTextSelection = true; + + warning("x: %d y: %d", textLine, charPos); } } // End of namespace Wage |