Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/targeticonbutton.cc')
-rw-r--r--src/client/targeticonbutton.cc9
1 files changed, 5 insertions, 4 deletions
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();
}