diff options
author | Borja Lorente | 2016-08-04 13:54:21 +0200 |
---|---|---|
committer | Borja Lorente | 2016-08-14 19:01:00 +0200 |
commit | 0aef29a8c5f364e53f6bef57fee890005bcda129 (patch) | |
tree | 8dcee982ddfa108598e16c24629ddc242509e7ee /engines/macventure/gui.cpp | |
parent | 5b63e29d5e2ff4710cf4d417474b607d84317dee (diff) | |
download | scummvm-rg350-0aef29a8c5f364e53f6bef57fee890005bcda129.tar.gz scummvm-rg350-0aef29a8c5f364e53f6bef57fee890005bcda129.tar.bz2 scummvm-rg350-0aef29a8c5f364e53f6bef57fee890005bcda129.zip |
MACVENTURE: Revamp double click detection
Diffstat (limited to 'engines/macventure/gui.cpp')
-rw-r--r-- | engines/macventure/gui.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp index 4f11478c21..327a2e8b7f 100644 --- a/engines/macventure/gui.cpp +++ b/engines/macventure/gui.cpp @@ -20,9 +20,7 @@ * */ - #include "common/file.h" -#include "common/timer.h" #include "common/system.h" #include "image/bmp.h" @@ -92,11 +90,6 @@ static const Graphics::MenuData menuSubItems[] = { }; -static void cursorTimerHandler(void *refCon) { - Gui *gui = (Gui *)refCon; - gui->processCursorTick(); -} - bool commandsWindowCallback(Graphics::WindowClick, Common::Event &event, void *gui); bool mainGameWindowCallback(Graphics::WindowClick, Common::Event &event, void *gui); bool outConsoleWindowCallback(Graphics::WindowClick, Common::Event &event, void *gui); @@ -117,7 +110,6 @@ Gui::Gui(MacVentureEngine *engine, Common::MacResManager *resman) { _dialog = nullptr; _cursor = new Cursor(this); - g_system->getTimerManager()->installTimerProc(&cursorTimerHandler, 500000, this, "macVentureCursor"); _consoleText = new ConsoleText(this); @@ -886,8 +878,7 @@ WindowReference Gui::findWindowAtPoint(Common::Point point) { win = findWindow(it->refcon); if (win && it->refcon != kDiplomaWindow) { //HACK, diploma should be cosnidered if (win->getDimensions().contains(point)) { - if (win->isActive()) - return it->refcon; + return it->refcon; } } } @@ -979,7 +970,10 @@ void Gui::checkSelect(const WindowData &data, const Common::Event &event, const child = (*it).obj; } } - if (child != 0) selectDraggable(child, ref, event.mouse, data.scrollPos); + if (child != 0) { + selectDraggable(child, ref, event.mouse, data.scrollPos); + bringToFront(ref); + } } bool Gui::canBeSelected(ObjID obj, const Common::Event &event, const Common::Rect &clickRect, WindowReference ref) { @@ -1375,10 +1369,6 @@ bool Gui::processInventoryEvents(WindowClick click, Common::Event & event) { return true; } -void Gui::processCursorTick() { - _cursor->tick(); -} - void Gui::handleSingleClick(Common::Point pos) { debug("Single Click"); // HACK THERE HAS TO BE A MORE ELEGANT WAY |