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')
-rw-r--r--src/client/hud.cc29
-rw-r--r--src/client/video.cc45
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()) {