diff options
author | Stijn Buys <ingar@osirion.org> | 2008-07-30 20:08:14 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-07-30 20:08:14 +0000 |
commit | 02f6bfcef4f2e8b0fdbf12c652ab202edbeed19a (patch) | |
tree | 1b6c878c612f577971eb78bfbfeaf8da94df34f3 /src | |
parent | cf0f21b73e53b4371c42c95e1132b1d3ce69ade5 (diff) |
even better clicking
Diffstat (limited to 'src')
-rw-r--r-- | src/client/input.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/input.cc b/src/client/input.cc index 751b3ca..052ffb2 100644 --- a/src/client/input.cc +++ b/src/client/input.cc @@ -464,6 +464,11 @@ void key_pressed(Key *key) } else if (core::application()->connected() && core::localcontrol()) { + if ((render::Camera::mode() == render::Camera::Free) && (key->sym() == 512 + SDL_BUTTON_LEFT) && targets::hover()) { + // hovering target selected + targets::select_target(targets::hover()); + + } else { char c = key->bind(convert_SDL_modifier(keyboard_modifiers)).c_str()[0]; if (c == '+') { // action bind @@ -473,6 +478,7 @@ void key_pressed(Key *key) // normal bind core::cmd() << key->bind(convert_SDL_modifier(keyboard_modifiers)) << "\n"; } + } } else if (core::application()->connected()) { @@ -488,8 +494,8 @@ void key_pressed(Key *key) void key_released(Key *key) { if (core::application()->connected() && core::localcontrol() && !console()->visible() && !chat::visible()) { - if ((key->sym() == 512 + SDL_BUTTON_LEFT) && targets::hover()) { + if ((render::Camera::mode() != render::Camera::Free) && (key->sym() == 512 + SDL_BUTTON_LEFT) && targets::hover()) { // hovering target selected targets::select_target(targets::hover()); } |