diff options
author | Stijn Buys <ingar@osirion.org> | 2013-10-13 18:25:47 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-10-13 18:25:47 +0000 |
commit | d6503ad4863c85642de046697ce28af10dbb5c0d (patch) | |
tree | 1c4ceb81a4a93941af216799c0243b73a9d3d6c5 /src | |
parent | f83db9533343d43d025e212ed96122fdd795574b (diff) |
Draw both owner and entity name on HUD targets.
Diffstat (limited to 'src')
-rw-r--r-- | src/client/hud.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/client/hud.cc b/src/client/hud.cc index bc75963..0142201 100644 --- a/src/client/hud.cc +++ b/src/client/hud.cc @@ -233,12 +233,16 @@ void HUD::draw_target(core::Entity *entity, bool is_active_target) // labels std::string label_text; + std::string label_textsub; if (entity->type() == core::Entity::Controlable) { const core::EntityControlable *ec = static_cast<core::EntityControlable *>(entity); if (ec->owner()) { label_text.append("^B"); label_text.append(ec->owner()->name()); + + label_textsub.append("^N"); + label_textsub.append(entity->name()); } else { label_text.append("^B"); label_text.append(entity->name()); @@ -246,10 +250,13 @@ void HUD::draw_target(core::Entity *entity, bool is_active_target) } else { if (entity->has_flag(core::Entity::Dockable)) { label_text.append("^B"); + label_text.append(entity->name()); + } else { label_text.append("^N"); + label_text.append(entity->name()); } - label_text.append(entity->name()); + } const ui::Font *label_font; @@ -262,6 +269,11 @@ void HUD::draw_target(core::Entity *entity, bool is_active_target) math::Vector2f label_size(2.0f * bitmap_radius, label_font->height()); math::Vector2f label_location(cx - bitmap_radius, cy + bitmap_radius); ui::Paint::draw_label(label_location, label_size,label_font, label_text); + + if (label_textsub.size()) { + label_location[1] +=label_font->height(); + ui::Paint::draw_label(label_location, label_size,label_font, label_textsub); + } if (is_active_target) { // draw distance |