diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/console.cc | 4 | ||||
-rw-r--r-- | src/client/console.h | 2 | ||||
-rw-r--r-- | src/client/targets.cc | 7 | ||||
-rw-r--r-- | src/client/view.cc | 3 |
4 files changed, 10 insertions, 6 deletions
diff --git a/src/client/console.cc b/src/client/console.cc index 9678fa7..bc99bfd 100644 --- a/src/client/console.cc +++ b/src/client/console.cc @@ -68,11 +68,11 @@ void Console::clear() } -void Console::draw() { +void Console::draw(bool draw_ui_notifications) { flush(); if (visible()) draw_console(); - else + else if (draw_ui_notifications) draw_notify(); } diff --git a/src/client/console.h b/src/client/console.h index 05d62ad..e280e9d 100644 --- a/src/client/console.h +++ b/src/client/console.h @@ -27,7 +27,7 @@ public: void clear_notify(); /// draw client notifications or console text - void draw(); + void draw(bool draw_ui_notifications); /// toggle the console on or off void toggle(); diff --git a/src/client/targets.cc b/src/client/targets.cc index 128064e..c0b8e77 100644 --- a/src/client/targets.cc +++ b/src/client/targets.cc @@ -74,7 +74,10 @@ unsigned int hover() void select_target(core::Entity *entity) { current_target = entity; - current_target_id = current_target->id(); + if (entity) + current_target_id = current_target->id(); + else + current_target_id = 0; core::application()->notify_sound("ui/target"); } @@ -219,7 +222,7 @@ void func_target_center(std::string const &args) math::Vector3f v(entity->state()->location() - render::Camera::eye()); v.normalize(); - if (is_legal_target(entity) && math::dotproduct(render::Camera::axis().forward(), v) > 0.5 ) { + if (is_legal_target(entity) && math::dotproduct(render::Camera::axis().forward(), v) > 0.85 ) { // calculate the distance from entity location to the line [eye - cursor] float d = math::Vector3f::length(math::crossproduct( (center - render::Camera::eye()) , (render::Camera::eye() - entity->location()))) / math::Vector3f::length(center - render::Camera::eye()); diff --git a/src/client/view.cc b/src/client/view.cc index 610c1a5..5879728 100644 --- a/src/client/view.cc +++ b/src/client/view.cc @@ -447,7 +447,8 @@ void frame(float seconds) // draw console or notifications Text::setfont("bitmaps/fonts/gui", 12, 18); - console()->draw(); + + console()->draw((bool) draw_ui->value()); gl::disable(GL_TEXTURE_2D); gl::disable(GL_BLEND); |