An attempt to make more clear the distinction between name,

...unit_type and race in unit sidebars.

Currently uses same colors and indentation as for weapon and its detail.
(for UI visual consistency and cuing importance hierarchy)
This commit is contained in:
Ali El Gariani 2009-09-07 18:48:05 +00:00
parent 8cfc56a9f0
commit 78983effa0
4 changed files with 9 additions and 7 deletions

View File

@ -765,8 +765,8 @@ void unit_preview_pane::draw_contents()
}
std::stringstream text;
text << det.type_name << "\n"
<< det.race << "\n"
text << font::unit_type << det.type_name << "\n"
<< font::race << " " << det.race << "\n"
<< font::BOLD_TEXT << _("level") << " " << det.level << "\n"
<< det.alignment << "\n"
<< det.traits << "\n";

View File

@ -65,9 +65,9 @@ report generate_report(TYPE type,
case UNIT_NAME:
return report(u->name(), "", u->name());
case UNIT_TYPE:
return report(u->type_name(), "", u->unit_description());
return report(font::unit_type + u->type_name(), "", u->unit_description());
case UNIT_RACE:
return report(u->race()->name(u->gender()));
return report(font::race + " " + u->race()->name(u->gender()));
case UNIT_SIDE: {
std::string flag_icon = teams[u->side() - 1].flag_icon();
std::string old_rgb = game_config::flag_rgb;

View File

@ -38,9 +38,11 @@ const char LARGE_TEXT='*', SMALL_TEXT='`',
GREEN_TEXT='@', RED_TEXT='#',
COLOR_TEXT='<', IMAGE='&';
// some colors often used in UI
const std::string weapon = "<245,230,193>",
weapon_details = "<166,146,117>";
weapon_details = "<166,146,117>",
unit_type = "<245,230,193>",
race = "<166,146,117>";
std::string::const_iterator parse_markup(std::string::const_iterator i1,
std::string::const_iterator i2,

View File

@ -29,7 +29,7 @@ namespace font {
extern const char LARGE_TEXT, SMALL_TEXT, BOLD_TEXT, NORMAL_TEXT, NULL_MARKUP, BLACK_TEXT, GRAY_TEXT,
GOOD_TEXT, BAD_TEXT, GREEN_TEXT, RED_TEXT, COLOR_TEXT, YELLOW_TEXT, IMAGE;
extern const std::string weapon, weapon_details;
extern const std::string weapon, weapon_details, unit_type, race;
/** Parses the markup-tags at the front of a string. */
std::string::const_iterator parse_markup(std::string::const_iterator i1,