diff options
author | Stijn Buys <ingar@osirion.org> | 2011-07-31 18:23:09 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2011-07-31 18:23:09 +0000 |
commit | f0cbe1d0655013d14dd4f1807ddb88789ae8d27a (patch) | |
tree | d21a926978e38b70c96bd80dfed28b7aa9396d53 /src | |
parent | 5a464fca4618af9eeb0fe3f2c43d148fb194a015 (diff) |
Handle local mouse pointer in client::HUD,
removed video::set_cursor() method.
Diffstat (limited to 'src')
-rw-r--r-- | src/client/hud.cc | 29 | ||||
-rw-r--r-- | src/client/video.cc | 45 |
2 files changed, 29 insertions, 45 deletions
diff --git a/src/client/hud.cc b/src/client/hud.cc index d712987..423bf58 100644 --- a/src/client/hud.cc +++ b/src/client/hud.cc @@ -393,6 +393,35 @@ void HUD::draw() gl::disable(GL_TEXTURE_2D); + + if (has_mouse_focus()) { + + if (render::Camera::mode() == render::Camera::Overview) { + + ui::root()->set_pointer("aim"); + + } else if (targets::hover()) { + + ui::root()->set_pointer("target", ui::Palette::Active, true); + + if (input::joystick_lastmoved_time() > input::mouse_lastmoved_time()) { + ui::root()->input_mouse(render::State::width() / 2, render::State::height() / 2); + } + + } else if (input::mouse_control) { + + ui::root()->set_pointer("control", ui::Palette::Pointer); + + } else if ((input::joystick_lastmoved_time() > input::mouse_lastmoved_time()) && + (render::Camera::mode() == render::Camera::Cockpit || render::Camera::mode() == render::Camera::Track)) { + + ui::root()->set_pointer(); + + } else { + + ui::root()->set_pointer("aim", ui::Palette::Foreground); + } + } } } diff --git a/src/client/video.cc b/src/client/video.cc index a957ef6..f00b7f9 100644 --- a/src/client/video.cc +++ b/src/client/video.cc @@ -286,50 +286,6 @@ void restart() input::reset(); } -void set_cursor() -{ - if (ui::console()->visible()) { - ui::root()->set_pointer(); - - } else if (core::localplayer()->view() || ui::root()->active()) { - - ui::root()->set_pointer("pointer"); - - } else if (!core::localcontrol()) { - - ui::root()->set_pointer(); - - } else if (client()->mainwindow()->gamewindow()->map()->hover()) { - - ui::root()->set_pointer("pointer"); - - } else if (render::Camera::mode() == render::Camera::Overview) { - - ui::root()->set_pointer("aim"); - - } else if (targets::hover()) { - - ui::root()->set_pointer("target", ui::Palette::Active, true); - - if (input::joystick_lastmoved_time() > input::mouse_lastmoved_time()) { - ui::root()->input_mouse(render::State::width() / 2, render::State::height() / 2); - } - - } else if (input::mouse_control) { - - ui::root()->set_pointer("control", ui::Palette::Pointer); - - } else if ((input::joystick_lastmoved_time() > input::mouse_lastmoved_time()) && - (render::Camera::mode() == render::Camera::Cockpit || render::Camera::mode() == render::Camera::Track)) { - - ui::root()->set_pointer(); - - } else { - - ui::root()->set_pointer("aim", ui::Palette::Foreground); - } -} - void set_loader_message(const std::string message) { loader_message.assign(message); @@ -431,7 +387,6 @@ void frame(float elapsed) // draw the user interface if (draw_ui->value()) { - set_cursor(); ui::root()->frame(); } else if (ui::console()->visible()) { |