From 9626a5ce823fe94970b04dc504993583996e6074 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 6 Jan 2015 21:38:33 +0000 Subject: Fixed target selection in the map window. --- src/client/galaxymapwidget.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/client/galaxymapwidget.cc') diff --git a/src/client/galaxymapwidget.cc b/src/client/galaxymapwidget.cc index a49e004..47d1f79 100644 --- a/src/client/galaxymapwidget.cc +++ b/src/client/galaxymapwidget.cc @@ -36,10 +36,10 @@ void GalaxyMapWidget::set_zone(core::Zone *zone) galaxymapwidget_zone = zone; } -bool GalaxyMapWidget::on_keypress(const int key, const unsigned int modifier) +bool GalaxyMapWidget::on_mousepress(const unsigned int button) { - if (key == 512 + SDL_BUTTON_LEFT) { - if (has_mouse_focus() && hover()) { + if (button == SDL_BUTTON_LEFT) { + if (hover()) { if (zone() && (zone()->id() == hover())) { emit(ui::Widget::EventDoubleClicked); } else { @@ -48,9 +48,10 @@ bool GalaxyMapWidget::on_keypress(const int key, const unsigned int modifier) } } return true; - } + return false; + } void GalaxyMapWidget::draw() @@ -105,7 +106,7 @@ void GalaxyMapWidget::draw() // draw map icons /* * Note: the galactic coordinate system differs from the zone coordinate system: - * positive X-axis runs left-to-right on the screen and the positive U-axis runs bottom-to-top on the screen. + * positive X-axis runs left-to-right on the screen and the positive Y-axis runs bottom-to-top on the screen. * * This is because I'm lazy and I just copy the coordinates from the SVG starsystem roadmap as shown in Inkscape. */ -- cgit v1.2.3