Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2013-10-16 21:57:12 +0000
committerStijn Buys <ingar@osirion.org>2013-10-16 21:57:12 +0000
commit928bd2d6ca25f857dca906fc1e79b61f7e8fc348 (patch)
treef2527d832837ca7957f603ab59c9e7ce4c51dbcb /src/client
parent7b7559f7f96227d555935b32dd3acce1af42da72 (diff)
Revert to either owner or entity name on hud targets, draw target indicators for controlables without owner.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/hud.cc21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/client/hud.cc b/src/client/hud.cc
index 0142201..7069310 100644
--- a/src/client/hud.cc
+++ b/src/client/hud.cc
@@ -233,21 +233,19 @@ 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("^N");
label_text.append(entity->name());
}
+
} else {
+
if (entity->has_flag(core::Entity::Dockable)) {
label_text.append("^B");
label_text.append(entity->name());
@@ -256,7 +254,6 @@ void HUD::draw_target(core::Entity *entity, bool is_active_target)
label_text.append("^N");
label_text.append(entity->name());
}
-
}
const ui::Font *label_font;
@@ -269,11 +266,6 @@ 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
@@ -397,12 +389,9 @@ void HUD::draw()
draw_target(entity, false);
} else if ((entity->type() == core::Entity::Controlable) && (targets::is_valid_hud_target(entity))) {
- const core::EntityControlable *ec = static_cast<core::EntityControlable *>(entity);
- if (ec->owner()) {
- // draw other players
- draw_target(entity, false);
- }
+ // draw other players
+ draw_target(entity, false);
}
}