diff options
author | Stijn Buys <ingar@osirion.org> | 2015-01-06 21:38:33 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2015-01-06 21:38:33 +0000 |
commit | 9626a5ce823fe94970b04dc504993583996e6074 (patch) | |
tree | 6c751347b75ce952169da889abd74853f5544857 /src/client/mapwidget.cc | |
parent | 22785c4e7eb0be49a795f4b2bcdf5cbda1626a5a (diff) |
Fixed target selection in the map window.
Diffstat (limited to 'src/client/mapwidget.cc')
-rw-r--r-- | src/client/mapwidget.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/client/mapwidget.cc b/src/client/mapwidget.cc index 52fe074..54e109e 100644 --- a/src/client/mapwidget.cc +++ b/src/client/mapwidget.cc @@ -45,10 +45,10 @@ void MapWidget::set_zone(core::Zone *zone) mapwidget_zone = zone; } -bool MapWidget::on_keypress(const int key, const unsigned int modifier) +bool MapWidget::on_mousepress(const unsigned int button) { - if (key == 512 + SDL_BUTTON_LEFT) { - if (mapwidget_zone && has_mouse_focus() && hover()) { + if (button == SDL_BUTTON_LEFT) { + if (mapwidget_zone && hover()) { core::Entity *target = mapwidget_zone->find_entity(hover()); if (targets::is_valid_map_target(target)) { @@ -57,10 +57,12 @@ bool MapWidget::on_keypress(const int key, const unsigned int modifier) } } return true; + } - } return false; + } + void MapWidget::draw() { if (!mapwidget_zone) |