From 7e3684dba968d2129caf4deff344c4f099640a68 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 6 Jan 2015 21:49:29 +0000 Subject: Fixed @goto and @dock buttons. --- src/client/targeticonbutton.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/client/targeticonbutton.cc') diff --git a/src/client/targeticonbutton.cc b/src/client/targeticonbutton.cc index afc3838..ebd5ec3 100644 --- a/src/client/targeticonbutton.cc +++ b/src/client/targeticonbutton.cc @@ -18,10 +18,12 @@ TargetIconButton::TargetIconButton(Widget *parent, const char *icon, const char entity_flags = flags; } -bool TargetIconButton::on_keypress(const int key, const unsigned int modifier) +bool TargetIconButton::on_mousepress(const unsigned int button) { - if (key == 512 + SDL_BUTTON_LEFT) { - if (enabled() && command().size() && targets::current()) { + if (button == SDL_BUTTON_LEFT) + { + if (enabled() && command().size() && targets::current()) + { core::cmd() << "@" << command() << " " << targets::current_id() << std::endl; audio::play("ui/clicked"); } @@ -34,7 +36,6 @@ bool TargetIconButton::on_keypress(const int key, const unsigned int modifier) void TargetIconButton::draw() { set_enabled(targets::current() && ((targets::current()->flags() & entity_flags) == entity_flags)); - ui::IconButton::draw(); } -- cgit v1.2.3