diff options
Diffstat (limited to 'engines/macventure/gui.cpp')
-rw-r--r-- | engines/macventure/gui.cpp | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp index 1ac1d0b0f8..f1eb8b63e6 100644 --- a/engines/macventure/gui.cpp +++ b/engines/macventure/gui.cpp @@ -104,7 +104,6 @@ void Gui::draw() { _wm.setFullRefresh(true); drawWindows(); - drawTitle(); _wm.draw(); } @@ -121,14 +120,6 @@ void Gui::drawExit(ObjID id) { warning("Unimplemented method: drawExit"); } -bool Gui::processEvent(Common::Event &event) { - bool processed = false; - if (event.type == Common::EVENT_LBUTTONDOWN) { - debug("Click on the ui"); - } - return (processed || _wm.processEvent(event)); -} - const WindowData& Gui::getWindowData(WindowReference reference) { return findWindowData(reference); } @@ -736,6 +727,13 @@ bool Gui::tryCloseWindow(WindowReference winID) { return true; } +bool Gui::processEvent(Common::Event &event) { + bool processed = false; + if (event.type == Common::EVENT_LBUTTONDOWN) { + debug("Click on the ui"); + } + return (processed || _wm.processEvent(event)); +} bool Gui::processCommandEvents(WindowClick click, Common::Event &event) { if (event.type == Common::EVENT_LBUTTONUP) { @@ -764,7 +762,25 @@ bool Gui::processCommandEvents(WindowClick click, Common::Event &event) { } bool MacVenture::Gui::processMainGameEvents(WindowClick click, Common::Event & event) { - return getWindowData(kMainGameWindow).visible; + if (click == kBorderInner && event.type == Common::EVENT_LBUTTONUP) { + WindowData &data = findWindowData(kMainGameWindow); + ObjID child; + BlitMode mode; + Common::Point pos; + for (Common::Array<DrawableObject>::const_iterator it = data.children.begin(); it != data.children.end(); it++) { + child = (*it).obj; + mode = (BlitMode)(*it).mode; + pos = _engine->getObjPosition(child); + pos.x += data.bounds.left; + pos.y += data.bounds.top; + if (_assets[child]->isPointInside(pos, event.mouse)) { + // select the first object clicked + _engine->selectObject(child); + return true; + } + } + } + return false; } bool MacVenture::Gui::processOutConsoleEvents(WindowClick click, Common::Event & event) { return getWindowData(kOutConsoleWindow).visible; |