diff options
author | Eugene Sandulenko | 2016-04-19 13:22:39 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-04-20 00:55:54 +0200 |
commit | fd7b31292dffe0ad456f590c4d9e6e29bfed0f00 (patch) | |
tree | fc1efcb8d1116805d0d35ae73eb0cf98df15f061 /engines/wage/gui.cpp | |
parent | 9a4a8ac5eff671b5216f2e17d9876cfae57f8ab7 (diff) | |
download | scummvm-rg350-fd7b31292dffe0ad456f590c4d9e6e29bfed0f00.tar.gz scummvm-rg350-fd7b31292dffe0ad456f590c4d9e6e29bfed0f00.tar.bz2 scummvm-rg350-fd7b31292dffe0ad456f590c4d9e6e29bfed0f00.zip |
WAGE: Implement object clicking as part of callbacks
Diffstat (limited to 'engines/wage/gui.cpp')
-rw-r--r-- | engines/wage/gui.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index ffbd801f89..05af5667e6 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -315,7 +315,18 @@ void Gui::drawScene() { _consoleTextArea.setHeight(_scene->_textBounds->height() - 2 * kBorderWidth); } -static void sceneWindowCallback(WindowClick click, Common::Event &event, void *gui) { +static void sceneWindowCallback(WindowClick click, Common::Event &event, void *g) { + Gui *gui = (Gui *)g; + + if (click == kBorderInner && event.type == Common::EVENT_LBUTTONUP) { + Designed *obj = gui->_scene->lookUpEntity(event.mouse.x - gui->_sceneWindow->getDimensions().left, + event.mouse.y - gui->_sceneWindow->getDimensions().top); + + if (obj != nullptr) + gui->_engine->processTurn(NULL, obj); + + return; + } } // Render console |