Rename all SDL_Color font::FOO_COLOUR as font::FOO_COLOR
This commit is contained in:
parent
d9997e472d
commit
f6fab3788f
38 changed files with 159 additions and 159 deletions
|
@ -200,7 +200,7 @@ void show_about(display &disp, const std::string &campaign)
|
|||
close.set_volatile(true);
|
||||
|
||||
const int def_size = font::SIZE_XLARGE;
|
||||
const SDL_Color def_color = font::NORMAL_COLOUR;
|
||||
const SDL_Color def_color = font::NORMAL_COLOR;
|
||||
|
||||
//substitute in the correct control characters for '+' and '-'
|
||||
std::string before_header(2, ' ');
|
||||
|
|
|
@ -2476,13 +2476,13 @@ size_t move_unit(move_unit_spectator *move_spectator,
|
|||
if (ambushed_string.empty())
|
||||
ambushed_string = _("Ambushed!");
|
||||
// We've been ambushed, display an appropriate message
|
||||
disp.announce(ambushed_string, font::BAD_COLOUR);
|
||||
disp.announce(ambushed_string, font::BAD_COLOR);
|
||||
redraw = true;
|
||||
}
|
||||
|
||||
if(teleport_failed) {
|
||||
std::string teleport_string = _ ("Failed teleport! Exit not empty");
|
||||
disp.announce(teleport_string, font::BAD_COLOUR);
|
||||
disp.announce(teleport_string, font::BAD_COLOR);
|
||||
redraw = true;
|
||||
}
|
||||
|
||||
|
@ -2527,17 +2527,17 @@ size_t move_unit(move_unit_spectator *move_spectator,
|
|||
if(nfriends == 0 || nenemies == 0) {
|
||||
if(nfriends > 0) {
|
||||
message = vngettext("Friendly unit sighted", "$friends friendly units sighted", nfriends, symbols);
|
||||
msg_colour = font::GOOD_COLOUR;
|
||||
msg_colour = font::GOOD_COLOR;
|
||||
} else if(nenemies > 0) {
|
||||
message = vngettext("Enemy unit sighted!", "$enemies enemy units sighted!", nenemies, symbols);
|
||||
msg_colour = font::BAD_COLOUR;
|
||||
msg_colour = font::BAD_COLOR;
|
||||
}
|
||||
}
|
||||
else {
|
||||
symbols["friendphrase"] = vngettext("Part of 'Units sighted! (...)' sentence^1 friendly", "$friends friendly", nfriends, symbols);
|
||||
symbols["enemyphrase"] = vngettext("Part of 'Units sighted! (...)' sentence^1 enemy", "$enemies enemy", nenemies, symbols);
|
||||
message = vgettext("Units sighted! ($friendphrase, $enemyphrase)", symbols);
|
||||
msg_colour = font::NORMAL_COLOUR;
|
||||
msg_colour = font::NORMAL_COLOR;
|
||||
}
|
||||
|
||||
if(steps.size() < route.size()) {
|
||||
|
|
|
@ -360,18 +360,18 @@ void battle_prediction_pane::draw_unit(int x_off, int damage_line_skip, int left
|
|||
int y_off = 15;
|
||||
|
||||
// Draw unit label.
|
||||
font::draw_text_line(screen, clip_rect, font::SIZE_15, font::NORMAL_COLOUR, label,
|
||||
font::draw_text_line(screen, clip_rect, font::SIZE_15, font::NORMAL_COLOR, label,
|
||||
clip_rect.x + x_off + (units_width_ - label_width) / 2, clip_rect.y + y_off, 0, TTF_STYLE_BOLD);
|
||||
|
||||
y_off += 24;
|
||||
|
||||
// Draw unit left and right strings except the last two (total damage and unscathed probability).
|
||||
for(i = 0; i < static_cast<int>(left_strings.size()) - 2; i++) {
|
||||
font::draw_text_line(screen, clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOUR, left_strings[i],
|
||||
font::draw_text_line(screen, clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOR, left_strings[i],
|
||||
clip_rect.x + x_off, clip_rect.y + y_off + (font::SIZE_NORMAL + inter_line_gap_) * i,
|
||||
0, TTF_STYLE_NORMAL);
|
||||
|
||||
font::draw_text_line(screen, clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOUR, right_strings[i],
|
||||
font::draw_text_line(screen, clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOR, right_strings[i],
|
||||
clip_rect.x + x_off + left_strings_width + inter_column_gap_,
|
||||
clip_rect.y + y_off + (font::SIZE_NORMAL + inter_line_gap_) * i, 0, TTF_STYLE_NORMAL);
|
||||
}
|
||||
|
@ -384,11 +384,11 @@ void battle_prediction_pane::draw_unit(int x_off, int damage_line_skip, int left
|
|||
const std::string& left_string = left_strings[left_strings.size() - 2 + i];
|
||||
const std::string& right_string = right_strings[right_strings.size() - 2 + i];
|
||||
|
||||
font::draw_text_line(screen, clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOUR, left_string,
|
||||
font::draw_text_line(screen, clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOR, left_string,
|
||||
clip_rect.x + x_off, clip_rect.y + y_off + (font::SIZE_NORMAL + inter_line_gap_) * i,
|
||||
0, TTF_STYLE_NORMAL);
|
||||
|
||||
font::draw_text_line(screen, clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOUR, right_string,
|
||||
font::draw_text_line(screen, clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOR, right_string,
|
||||
clip_rect.x + x_off + left_strings_width + inter_column_gap_,
|
||||
clip_rect.y + y_off + (font::SIZE_NORMAL + inter_line_gap_) * i, 0, TTF_STYLE_NORMAL);
|
||||
}
|
||||
|
@ -396,7 +396,7 @@ void battle_prediction_pane::draw_unit(int x_off, int damage_line_skip, int left
|
|||
y_off += 2 * (font::SIZE_NORMAL + inter_line_gap_) + 14;
|
||||
|
||||
// Draw hitpoints distribution string.
|
||||
font::draw_text(screen, clip_rect, font::SIZE_SMALL, font::NORMAL_COLOUR, hp_distrib_string_,
|
||||
font::draw_text(screen, clip_rect, font::SIZE_SMALL, font::NORMAL_COLOR, hp_distrib_string_,
|
||||
clip_rect.x + x_off + (units_width_ - hp_distrib_string_width_) / 2, clip_rect.y + y_off);
|
||||
|
||||
y_off += 19;
|
||||
|
@ -500,7 +500,7 @@ void battle_prediction_pane::get_hp_distrib_surface(const std::vector<std::pair<
|
|||
int hp_width = font::line_width(str_buf, fs);
|
||||
|
||||
// Draw bars.
|
||||
font::draw_text_line(surf, clip_rect, fs, font::NORMAL_COLOUR, str_buf,
|
||||
font::draw_text_line(surf, clip_rect, fs, font::NORMAL_COLOR, str_buf,
|
||||
hp_sep - hp_width - 2, 2 + (fs + 2) * i, 0, TTF_STYLE_NORMAL);
|
||||
|
||||
int bar_len = std::max<int>(static_cast<int>((prob * (bar_space - 4)) + 0.5), 2);
|
||||
|
@ -520,7 +520,7 @@ void battle_prediction_pane::get_hp_distrib_surface(const std::vector<std::pair<
|
|||
// Draw probability percentage, aligned right.
|
||||
format_prob(str_buf, static_cast<float>(prob));
|
||||
int prob_width = font::line_width(str_buf, fs);
|
||||
font::draw_text_line(surf, clip_rect, fs, font::NORMAL_COLOUR, str_buf,
|
||||
font::draw_text_line(surf, clip_rect, fs, font::NORMAL_COLOR, str_buf,
|
||||
width - prob_width - 4, 2 + (fs + 2) * i, 0, TTF_STYLE_NORMAL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ dialog::dialog(display &disp, const std::string& title, const std::string& messa
|
|||
|
||||
try {
|
||||
std::string msg = font::word_wrap_text(message, message_font_size, screen.getx() / 2, screen.gety() / 2);
|
||||
message_ = new label(screen, msg, message_font_size, font::NORMAL_COLOUR, false);
|
||||
message_ = new label(screen, msg, message_font_size, font::NORMAL_COLOR, false);
|
||||
} catch(utils::invalid_utf8_exception&) {
|
||||
ERR_DP << "Problem handling utf8 in message '" << message << "'\n";
|
||||
throw;
|
||||
|
@ -230,7 +230,7 @@ void dialog::set_textbox(const std::string& text_widget_label,
|
|||
const std::string& text_widget_text,
|
||||
const int text_widget_max_chars, const unsigned int text_box_width)
|
||||
{
|
||||
label *label_ptr = new label(disp_.video(), text_widget_label, message_font_size, font::NORMAL_COLOUR, false);
|
||||
label *label_ptr = new label(disp_.video(), text_widget_label, message_font_size, font::NORMAL_COLOR, false);
|
||||
const bool editable_textbox = std::find(text_widget_text.begin(),text_widget_text.end(),'\n') == text_widget_text.end();
|
||||
text_widget_ = new dialog_textbox(label_ptr, disp_.video(), text_box_width, text_widget_text, editable_textbox, text_widget_max_chars);
|
||||
text_widget_->set_wrap(!editable_textbox);
|
||||
|
@ -826,7 +826,7 @@ void dialog::set_image(surface surf, const std::string &caption)
|
|||
{
|
||||
label *label_ptr = NULL;
|
||||
if(!caption.empty()) {
|
||||
label_ptr = new label(disp_.video(), caption, caption_font_size, font::NORMAL_COLOUR, false);
|
||||
label_ptr = new label(disp_.video(), caption, caption_font_size, font::NORMAL_COLOR, false);
|
||||
}
|
||||
set_image( new dialog_image(label_ptr, disp_.video(), surf ));
|
||||
}
|
||||
|
|
|
@ -488,7 +488,7 @@ void save_preview_pane::draw_contents()
|
|||
}
|
||||
}
|
||||
|
||||
font::draw_text(&video(), area, font::SIZE_SMALL, font::NORMAL_COLOUR, str.str(), area.x, ypos, true);
|
||||
font::draw_text(&video(), area, font::SIZE_SMALL, font::NORMAL_COLOR, str.str(), area.x, ypos, true);
|
||||
}
|
||||
|
||||
std::string format_time_summary(time_t t)
|
||||
|
@ -752,7 +752,7 @@ void unit_preview_pane::draw_contents()
|
|||
const std::string description = desc.str();
|
||||
description_rect = font::text_area(description, font::SIZE_NORMAL);
|
||||
description_rect = font::draw_text(&video(), area,
|
||||
font::SIZE_NORMAL, font::NORMAL_COLOUR,
|
||||
font::SIZE_NORMAL, font::NORMAL_COLOR,
|
||||
desc.str(), right_align ? image_rect.x :
|
||||
image_rect.x + image_rect.w - description_rect.w,
|
||||
image_rect.y + image_rect.h + details_button_.location().h);
|
||||
|
@ -828,7 +828,7 @@ void unit_preview_pane::draw_contents()
|
|||
xpos = area.x + area.w - line_area.w;
|
||||
}
|
||||
|
||||
SDL_Rect cur_area = font::draw_text(&video(),location(),font::SIZE_SMALL,font::NORMAL_COLOUR,*line,xpos,ypos);
|
||||
SDL_Rect cur_area = font::draw_text(&video(),location(),font::SIZE_SMALL,font::NORMAL_COLOR,*line,xpos,ypos);
|
||||
ypos += cur_area.h;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -858,7 +858,7 @@ void display::update_display()
|
|||
|
||||
font::floating_label flabel(stream.str());
|
||||
flabel.set_font_size(12);
|
||||
flabel.set_colour(benchmark ? font::BAD_COLOUR : font::NORMAL_COLOUR);
|
||||
flabel.set_colour(benchmark ? font::BAD_COLOR : font::NORMAL_COLOR);
|
||||
flabel.set_position(10, 100);
|
||||
flabel.set_alignement(font::LEFT_ALIGN);
|
||||
|
||||
|
@ -954,7 +954,7 @@ static void draw_label(CVideo& video, surface target, const theme::label& label)
|
|||
tooltips::add_tooltip(loc,text);
|
||||
}
|
||||
} else if(text.empty() == false) {
|
||||
font::draw_text(&video,loc,label.font_size(),font::NORMAL_COLOUR,text,loc.x,loc.y);
|
||||
font::draw_text(&video,loc,label.font_size(),font::NORMAL_COLOR,text,loc.x,loc.y);
|
||||
}
|
||||
|
||||
update_rect(loc);
|
||||
|
@ -1010,7 +1010,7 @@ void display::draw_text_in_hex(const map_location& loc,
|
|||
);
|
||||
|
||||
surface text_surf = font::get_rendered_text(text, font_sz, color);
|
||||
surface back_surf = font::get_rendered_text(text, font_sz, font::BLACK_COLOUR);
|
||||
surface back_surf = font::get_rendered_text(text, font_sz, font::BLACK_COLOR);
|
||||
const int x = get_location_x(loc) - text_surf->w/2
|
||||
+ static_cast<int>(x_in_hex* hex_size());
|
||||
const int y = get_location_y(loc) - text_surf->h/2
|
||||
|
@ -1112,7 +1112,7 @@ void display::set_diagnostic(const std::string& msg)
|
|||
if(msg != "") {
|
||||
font::floating_label flabel(msg);
|
||||
flabel.set_font_size(font::SIZE_PLUS);
|
||||
flabel.set_colour(font::YELLOW_COLOUR);
|
||||
flabel.set_colour(font::YELLOW_COLOR);
|
||||
flabel.set_position(300, 50);
|
||||
flabel.set_clip_rect(map_outside_area());
|
||||
|
||||
|
@ -1980,7 +1980,7 @@ void display::draw_hex(const map_location& loc) {
|
|||
if (draw_coordinates_) {
|
||||
int off_x = xpos + hex_size()/2;
|
||||
int off_y = ypos + hex_size()/2;
|
||||
surface text = font::get_rendered_text(lexical_cast<std::string>(loc), font::SIZE_SMALL, font::NORMAL_COLOUR);
|
||||
surface text = font::get_rendered_text(lexical_cast<std::string>(loc), font::SIZE_SMALL, font::NORMAL_COLOR);
|
||||
surface bg = create_neutral_surface(text->w, text->h);
|
||||
SDL_Rect bg_rect = {0, 0, text->w, text->h};
|
||||
SDL_FillRect(bg, &bg_rect, 0xaa000000);
|
||||
|
@ -1996,7 +1996,7 @@ void display::draw_hex(const map_location& loc) {
|
|||
if (draw_terrain_codes_ && (game_config::debug || !shrouded(loc))) {
|
||||
int off_x = xpos + hex_size()/2;
|
||||
int off_y = ypos + hex_size()/2;
|
||||
surface text = font::get_rendered_text(lexical_cast<std::string>(get_map().get_terrain(loc)), font::SIZE_SMALL, font::NORMAL_COLOUR);
|
||||
surface text = font::get_rendered_text(lexical_cast<std::string>(get_map().get_terrain(loc)), font::SIZE_SMALL, font::NORMAL_COLOR);
|
||||
surface bg = create_neutral_surface(text->w, text->h);
|
||||
SDL_Rect bg_rect = {0, 0, text->w, text->h};
|
||||
SDL_FillRect(bg, &bg_rect, 0xaa000000);
|
||||
|
|
|
@ -449,7 +449,7 @@ public:
|
|||
|
||||
/** Announce a message prominently. */
|
||||
void announce(const std::string& msg,
|
||||
const SDL_Color& colour = font::GOOD_COLOUR);
|
||||
const SDL_Color& colour = font::GOOD_COLOR);
|
||||
|
||||
/**
|
||||
* Schedule the minimap for recalculation.
|
||||
|
|
|
@ -501,7 +501,7 @@ void terrain_palette::draw(bool force) {
|
|||
}
|
||||
if (!is_core) {
|
||||
tooltip_text << " "
|
||||
<< font::span_color(font::BAD_COLOUR)
|
||||
<< font::span_color(font::BAD_COLOR)
|
||||
<< _("(non-core)") << "\n"
|
||||
<< _("Will not work in game without extra care.")
|
||||
<< "</span>";
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace gui{
|
|||
font::remove_floating_label(label_);
|
||||
|
||||
font::floating_label flabel(label_string_);
|
||||
flabel.set_colour(font::YELLOW_COLOUR);
|
||||
flabel.set_colour(font::YELLOW_COLOR);
|
||||
flabel.set_position(area.x + border_size, ypos);
|
||||
flabel.set_alignement(font::LEFT_ALIGN);
|
||||
flabel.set_clip_rect(area);
|
||||
|
|
28
src/font.cpp
28
src/font.cpp
|
@ -431,19 +431,19 @@ static void set_font_list(const std::vector<subset_descriptor>& fontlist)
|
|||
char_blocks.compress();
|
||||
}
|
||||
|
||||
const SDL_Color NORMAL_COLOUR = {0xDD,0xDD,0xDD,0},
|
||||
GRAY_COLOUR = {0x77,0x77,0x77,0},
|
||||
LOBBY_COLOUR = {0xBB,0xBB,0xBB,0},
|
||||
GOOD_COLOUR = {0x00,0xFF,0x00,0},
|
||||
BAD_COLOUR = {0xFF,0x00,0x00,0},
|
||||
BLACK_COLOUR = {0x00,0x00,0x00,0},
|
||||
YELLOW_COLOUR = {0xFF,0xFF,0x00,0},
|
||||
BUTTON_COLOUR = {0xBC,0xB0,0x88,0},
|
||||
PETRIFIED_COLOUR = {0xA0,0xA0,0xA0,0},
|
||||
TITLE_COLOUR = {0xBC,0xB0,0x88,0},
|
||||
LABEL_COLOUR = {0x6B,0x8C,0xFF,0},
|
||||
BIGMAP_COLOUR = {0xFF,0xFF,0xFF,0};
|
||||
const SDL_Color DISABLED_COLOUR = inverse(PETRIFIED_COLOUR);
|
||||
const SDL_Color NORMAL_COLOR = {0xDD,0xDD,0xDD,0},
|
||||
GRAY_COLOR = {0x77,0x77,0x77,0},
|
||||
LOBBY_COLOR = {0xBB,0xBB,0xBB,0},
|
||||
GOOD_COLOR = {0x00,0xFF,0x00,0},
|
||||
BAD_COLOR = {0xFF,0x00,0x00,0},
|
||||
BLACK_COLOR = {0x00,0x00,0x00,0},
|
||||
YELLOW_COLOR = {0xFF,0xFF,0x00,0},
|
||||
BUTTON_COLOR = {0xBC,0xB0,0x88,0},
|
||||
PETRIFIED_COLOR = {0xA0,0xA0,0xA0,0},
|
||||
TITLE_COLOR = {0xBC,0xB0,0x88,0},
|
||||
LABEL_COLOR = {0x6B,0x8C,0xFF,0},
|
||||
BIGMAP_COLOR = {0xFF,0xFF,0xFF,0};
|
||||
const SDL_Color DISABLED_COLOR = inverse(PETRIFIED_COLOR);
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -926,7 +926,7 @@ namespace font {
|
|||
floating_label::floating_label(const std::string& text)
|
||||
: surf_(NULL), buf_(NULL), text_(text),
|
||||
font_size_(SIZE_NORMAL),
|
||||
colour_(NORMAL_COLOUR), bgcolour_(), bgalpha_(0),
|
||||
colour_(NORMAL_COLOR), bgcolour_(), bgalpha_(0),
|
||||
xpos_(0), ypos_(0),
|
||||
xmove_(0), ymove_(0), lifetime_(-1),
|
||||
width_(-1),
|
||||
|
|
|
@ -47,9 +47,9 @@ private:
|
|||
};
|
||||
|
||||
//various standard colours
|
||||
extern const SDL_Color NORMAL_COLOUR, GRAY_COLOUR, LOBBY_COLOUR, GOOD_COLOUR, BAD_COLOUR,
|
||||
BLACK_COLOUR, YELLOW_COLOUR, BUTTON_COLOUR, BIGMAP_COLOUR,
|
||||
PETRIFIED_COLOUR, TITLE_COLOUR, DISABLED_COLOUR, LABEL_COLOUR;
|
||||
extern const SDL_Color NORMAL_COLOR, GRAY_COLOR, LOBBY_COLOR, GOOD_COLOR, BAD_COLOR,
|
||||
BLACK_COLOR, YELLOW_COLOR, BUTTON_COLOR, BIGMAP_COLOR,
|
||||
PETRIFIED_COLOR, TITLE_COLOR, DISABLED_COLOR, LABEL_COLOR;
|
||||
|
||||
// font sizes, to be made theme parameters
|
||||
#ifdef USE_TINY_GUI
|
||||
|
|
|
@ -399,7 +399,7 @@ void game_display::draw_hex(const map_location& loc)
|
|||
int debugH = debugHighlights_[loc];
|
||||
if (debugH) {
|
||||
std::string txt = lexical_cast<std::string>(debugH);
|
||||
draw_text_in_hex(loc, LAYER_MOVE_INFO, txt, 18, font::BAD_COLOUR);
|
||||
draw_text_in_hex(loc, LAYER_MOVE_INFO, txt, 18, font::BAD_COLOR);
|
||||
}
|
||||
}
|
||||
//simulate_delay += 1;
|
||||
|
@ -616,7 +616,7 @@ void game_display::draw_movement_info(const map_location& loc)
|
|||
if (w->second.turns > 1 || (w->second.turns == 1 && loc != route_.steps.back())) {
|
||||
std::stringstream turns_text;
|
||||
turns_text << w->second.turns;
|
||||
draw_text_in_hex(loc, LAYER_MOVE_INFO, turns_text.str(), 17, font::NORMAL_COLOUR, 0.5,0.8);
|
||||
draw_text_in_hex(loc, LAYER_MOVE_INFO, turns_text.str(), 17, font::NORMAL_COLOR, 0.5,0.8);
|
||||
}
|
||||
|
||||
// The hex is full now, so skip the "show enemy moves"
|
||||
|
@ -628,7 +628,7 @@ void game_display::draw_movement_info(const map_location& loc)
|
|||
reach_map::iterator reach = reach_map_.find(loc);
|
||||
if (reach != reach_map_.end() && reach->second > 1) {
|
||||
const std::string num = lexical_cast<std::string>(reach->second);
|
||||
draw_text_in_hex(loc, LAYER_MOVE_INFO, num, 16, font::YELLOW_COLOUR);
|
||||
draw_text_in_hex(loc, LAYER_MOVE_INFO, num, 16, font::YELLOW_COLOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -504,9 +504,9 @@ report generate_report(TYPE type,
|
|||
case GOLD: {
|
||||
char const *end = naps;
|
||||
if (current_side != playing_side)
|
||||
str << span_color(font::GRAY_COLOUR);
|
||||
str << span_color(font::GRAY_COLOR);
|
||||
else if (current_team.gold() < 0)
|
||||
str << span_color(font::BAD_COLOUR);
|
||||
str << span_color(font::BAD_COLOR);
|
||||
else
|
||||
end = "";
|
||||
str << current_team.gold() << end;
|
||||
|
@ -515,7 +515,7 @@ report generate_report(TYPE type,
|
|||
case VILLAGES: {
|
||||
const team_data data = calculate_team_data(current_team,current_side,units);
|
||||
if (current_side != playing_side)
|
||||
str << span_color(font::GRAY_COLOUR);
|
||||
str << span_color(font::GRAY_COLOR);
|
||||
str << data.villages << '/';
|
||||
if (current_team.uses_shroud()) {
|
||||
int unshrouded_villages = 0;
|
||||
|
@ -534,7 +534,7 @@ report generate_report(TYPE type,
|
|||
}
|
||||
case NUM_UNITS: {
|
||||
if (current_side != playing_side)
|
||||
str << span_color(font::GRAY_COLOUR);
|
||||
str << span_color(font::GRAY_COLOR);
|
||||
str << side_units(units, current_side);
|
||||
if (current_side != playing_side)
|
||||
str << naps;
|
||||
|
@ -543,7 +543,7 @@ report generate_report(TYPE type,
|
|||
case UPKEEP: {
|
||||
const team_data data = calculate_team_data(current_team,current_side,units);
|
||||
if (current_side != playing_side)
|
||||
str << span_color(font::GRAY_COLOUR);
|
||||
str << span_color(font::GRAY_COLOR);
|
||||
str << data.expenses << " (" << data.upkeep << ")";
|
||||
if (current_side != playing_side)
|
||||
str << naps;
|
||||
|
@ -552,7 +552,7 @@ report generate_report(TYPE type,
|
|||
case EXPENSES: {
|
||||
const team_data data = calculate_team_data(current_team,current_side,units);
|
||||
if (current_side != playing_side)
|
||||
str << span_color(font::GRAY_COLOUR);
|
||||
str << span_color(font::GRAY_COLOR);
|
||||
str << data.expenses;
|
||||
if (current_side != playing_side)
|
||||
str << naps;
|
||||
|
@ -562,9 +562,9 @@ report generate_report(TYPE type,
|
|||
team_data data = calculate_team_data(current_team, current_side, units);
|
||||
char const *end = naps;
|
||||
if (current_side != playing_side)
|
||||
str << span_color(font::GRAY_COLOUR);
|
||||
str << span_color(font::GRAY_COLOR);
|
||||
else if (data.net_income < 0)
|
||||
str << span_color(font::BAD_COLOUR);
|
||||
str << span_color(font::BAD_COLOR);
|
||||
else
|
||||
end = "";
|
||||
str << data.net_income << end;
|
||||
|
@ -698,7 +698,7 @@ report generate_report(TYPE type,
|
|||
sec = current_team.countdown_time() / 1000;
|
||||
char const *end = naps;
|
||||
if (current_side != playing_side)
|
||||
str << span_color(font::GRAY_COLOUR);
|
||||
str << span_color(font::GRAY_COLOR);
|
||||
else if (sec < 60)
|
||||
str << "<span foreground=\"#c80000\">";
|
||||
else if (sec < 120)
|
||||
|
|
22
src/help.cpp
22
src/help.cpp
|
@ -418,7 +418,7 @@ private:
|
|||
void add_text_item(const std::string& text, const std::string& ref_dst="",
|
||||
bool broken_link = false,
|
||||
int font_size=-1, bool bold=false, bool italic=false,
|
||||
SDL_Color color=font::NORMAL_COLOUR);
|
||||
SDL_Color color=font::NORMAL_COLOR);
|
||||
|
||||
/// Add an image item with the specified attributes.
|
||||
void add_img_item(const std::string& path, const std::string& alignment, const bool floating,
|
||||
|
@ -568,7 +568,7 @@ static std::vector<std::string> parse_text(const std::string &text);
|
|||
/// [element_name]...[/element_name]. Return the resulting WML.
|
||||
static std::string convert_to_wml(const std::string &element_name, const std::string &contents);
|
||||
|
||||
/// Return the color the string represents. Return font::NORMAL_COLOUR if
|
||||
/// Return the color the string represents. Return font::NORMAL_COLOR if
|
||||
/// the string is empty or can't be matched against any other color.
|
||||
static SDL_Color string_to_color(const std::string &s);
|
||||
|
||||
|
@ -2201,7 +2201,7 @@ void help_text_area::set_items()
|
|||
const std::string show_title =
|
||||
font::make_text_ellipsis(shown_topic_->title, title_size, inner_location().w);
|
||||
surface surf(font::get_rendered_text(show_title, title_size,
|
||||
font::NORMAL_COLOUR, TTF_STYLE_BOLD));
|
||||
font::NORMAL_COLOR, TTF_STYLE_BOLD));
|
||||
if (surf != NULL) {
|
||||
add_item(item(surf, 0, 0, show_title));
|
||||
curr_loc_.second = title_spacing_;
|
||||
|
@ -2426,9 +2426,9 @@ void help_text_area::add_text_item(const std::string& text, const std::string& r
|
|||
if(ref_dst.empty())
|
||||
color = text_color;
|
||||
else if(broken_link)
|
||||
color = font::BAD_COLOUR;
|
||||
color = font::BAD_COLOR;
|
||||
else
|
||||
color = font::YELLOW_COLOUR;
|
||||
color = font::YELLOW_COLOR;
|
||||
|
||||
surface surf(font::get_rendered_text(first_part, font_size, color, state));
|
||||
if (!surf.null())
|
||||
|
@ -3016,21 +3016,21 @@ std::string convert_to_wml(const std::string &element_name, const std::string &c
|
|||
SDL_Color string_to_color(const std::string &cmp_str)
|
||||
{
|
||||
if (cmp_str == "green") {
|
||||
return font::GOOD_COLOUR;
|
||||
return font::GOOD_COLOR;
|
||||
}
|
||||
if (cmp_str == "red") {
|
||||
return font::BAD_COLOUR;
|
||||
return font::BAD_COLOR;
|
||||
}
|
||||
if (cmp_str == "black") {
|
||||
return font::BLACK_COLOUR;
|
||||
return font::BLACK_COLOR;
|
||||
}
|
||||
if (cmp_str == "yellow") {
|
||||
return font::YELLOW_COLOUR;
|
||||
return font::YELLOW_COLOR;
|
||||
}
|
||||
if (cmp_str == "white") {
|
||||
return font::BIGMAP_COLOUR;
|
||||
return font::BIGMAP_COLOR;
|
||||
}
|
||||
return font::NORMAL_COLOUR;
|
||||
return font::NORMAL_COLOR;
|
||||
}
|
||||
|
||||
std::vector<std::string> split_in_width(const std::string &s, const int font_size,
|
||||
|
|
|
@ -186,7 +186,7 @@ void loadscreen::set_progress(const int percentage, const std::string &text, con
|
|||
textarea_ = font::line_size(text, font::SIZE_NORMAL);
|
||||
textarea_.x = scrx/2 + bw + bispw - textarea_.w / 2;
|
||||
textarea_.y = pby + pbh + 4*(bw + bispw);
|
||||
textarea_ = font::draw_text(&screen_,textarea_,font::SIZE_NORMAL,font::NORMAL_COLOUR,text,textarea_.x,textarea_.y);
|
||||
textarea_ = font::draw_text(&screen_,textarea_,font::SIZE_NORMAL,font::NORMAL_COLOR,text,textarea_.x,textarea_.y);
|
||||
oldarea.x = std::min<int>(textarea_.x, oldarea.x);
|
||||
oldarea.y = std::min<int>(textarea_.y, oldarea.y);
|
||||
oldarea.w = std::max<int>(textarea_.w, oldarea.w);
|
||||
|
|
|
@ -317,7 +317,7 @@ void terrain_label::read(const config &cfg)
|
|||
{
|
||||
const variable_set &vs = *resources::state_of_game;
|
||||
loc_ = map_location(cfg, &vs);
|
||||
SDL_Color colour = font::LABEL_COLOUR;
|
||||
SDL_Color colour = font::LABEL_COLOR;
|
||||
std::string tmp_colour = cfg["colour"];
|
||||
|
||||
text_ = cfg["text"];
|
||||
|
@ -453,7 +453,7 @@ void terrain_label::draw()
|
|||
// If a colour is specified don't allow to override it with markup. (prevents faking map labels for example)
|
||||
// FIXME: @todo Better detect if it's team label and not provided by
|
||||
// the scenario.
|
||||
bool use_markup = colour_ == font::LABEL_COLOUR;
|
||||
bool use_markup = colour_ == font::LABEL_COLOR;
|
||||
|
||||
font::floating_label flabel(text_.str());
|
||||
flabel.set_colour(colour_);
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
const terrain_label* set_label(const map_location& loc,
|
||||
const t_string& text,
|
||||
const std::string& team = "",
|
||||
const SDL_Color colour = font::NORMAL_COLOUR,
|
||||
const SDL_Color colour = font::NORMAL_COLOR,
|
||||
const bool visible_in_fog = true,
|
||||
const bool visible_in_shroud = false,
|
||||
const bool immutable = false);
|
||||
|
@ -88,7 +88,7 @@ public:
|
|||
const std::string&,
|
||||
const map_location&,
|
||||
const map_labels&,
|
||||
const SDL_Color colour = font::NORMAL_COLOUR,
|
||||
const SDL_Color colour = font::NORMAL_COLOR,
|
||||
const bool visible_in_fog = true,
|
||||
const bool visible_in_shroud = false,
|
||||
const bool immutable = false);
|
||||
|
|
|
@ -125,14 +125,14 @@ void default_map_generator::user_config(display& disp)
|
|||
const std::string& castlesize_label = _("Castle Size:");
|
||||
const std::string& landform_label = _("Landform:");
|
||||
|
||||
SDL_Rect players_rect = font::draw_text(NULL,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,players_label,0,0);
|
||||
SDL_Rect width_rect = font::draw_text(NULL,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,width_label,0,0);
|
||||
SDL_Rect height_rect = font::draw_text(NULL,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,height_label,0,0);
|
||||
SDL_Rect iterations_rect = font::draw_text(NULL,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,iterations_label,0,0);
|
||||
SDL_Rect hillsize_rect = font::draw_text(NULL,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,hillsize_label,0,0);
|
||||
SDL_Rect villages_rect = font::draw_text(NULL,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,villages_label,0,0);
|
||||
SDL_Rect castlesize_rect = font::draw_text(NULL,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,castlesize_label,0,0);
|
||||
SDL_Rect landform_rect = font::draw_text(NULL,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,landform_label,0,0);
|
||||
SDL_Rect players_rect = font::draw_text(NULL,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,players_label,0,0);
|
||||
SDL_Rect width_rect = font::draw_text(NULL,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,width_label,0,0);
|
||||
SDL_Rect height_rect = font::draw_text(NULL,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,height_label,0,0);
|
||||
SDL_Rect iterations_rect = font::draw_text(NULL,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,iterations_label,0,0);
|
||||
SDL_Rect hillsize_rect = font::draw_text(NULL,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,hillsize_label,0,0);
|
||||
SDL_Rect villages_rect = font::draw_text(NULL,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,villages_label,0,0);
|
||||
SDL_Rect castlesize_rect = font::draw_text(NULL,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,castlesize_label,0,0);
|
||||
SDL_Rect landform_rect = font::draw_text(NULL,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,landform_label,0,0);
|
||||
|
||||
const int horz_margin = 15;
|
||||
const int text_right = xpos + horz_margin +
|
||||
|
@ -276,39 +276,39 @@ void default_map_generator::user_config(display& disp)
|
|||
events::raise_process_event();
|
||||
events::raise_draw_event();
|
||||
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,players_label,players_rect.x,players_rect.y);
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,width_label,width_rect.x,width_rect.y);
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,height_label,height_rect.x,height_rect.y);
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,iterations_label,iterations_rect.x,iterations_rect.y);
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,hillsize_label,hillsize_rect.x,hillsize_rect.y);
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,villages_label,villages_rect.x,villages_rect.y);
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,castlesize_label,castlesize_rect.x,castlesize_rect.y);
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,landform_label,landform_rect.x,landform_rect.y);
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,players_label,players_rect.x,players_rect.y);
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,width_label,width_rect.x,width_rect.y);
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,height_label,height_rect.x,height_rect.y);
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,iterations_label,iterations_rect.x,iterations_rect.y);
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,hillsize_label,hillsize_rect.x,hillsize_rect.y);
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,villages_label,villages_rect.x,villages_rect.y);
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,castlesize_label,castlesize_rect.x,castlesize_rect.y);
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,landform_label,landform_rect.x,landform_rect.y);
|
||||
|
||||
font::draw_text(&screen, screen_area(), font::SIZE_NORMAL,
|
||||
font::NORMAL_COLOUR, str_cast(nplayers_),
|
||||
font::NORMAL_COLOR, str_cast(nplayers_),
|
||||
slider_right + horz_margin, players_rect.y);
|
||||
|
||||
font::draw_text(&screen, screen_area(), font::SIZE_NORMAL,
|
||||
font::NORMAL_COLOUR, str_cast(width_),
|
||||
font::NORMAL_COLOR, str_cast(width_),
|
||||
slider_right + horz_margin, width_rect.y);
|
||||
|
||||
font::draw_text(&screen, screen_area(), font::SIZE_NORMAL,
|
||||
font::NORMAL_COLOUR, str_cast(height_),
|
||||
font::NORMAL_COLOR, str_cast(height_),
|
||||
slider_right+horz_margin,height_rect.y);
|
||||
|
||||
std::stringstream villages_str;
|
||||
villages_str << nvillages_ << _("/1000 tiles");
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,villages_str.str(),
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,villages_str.str(),
|
||||
slider_right+horz_margin,villages_rect.y);
|
||||
|
||||
font::draw_text(&screen, screen_area(), font::SIZE_NORMAL,
|
||||
font::NORMAL_COLOUR, str_cast(castle_size_),
|
||||
font::NORMAL_COLOR, str_cast(castle_size_),
|
||||
slider_right + horz_margin, castlesize_rect.y);
|
||||
|
||||
std::stringstream landform_str;
|
||||
landform_str << gettext(island_size_ == 0 ? N_("Inland") : (island_size_ < max_coastal ? N_("Coastal") : N_("Island")));
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOUR,landform_str.str(),
|
||||
font::draw_text(&screen,screen_area(),font::SIZE_NORMAL,font::NORMAL_COLOR,landform_str.str(),
|
||||
slider_right+horz_margin,landform_rect.y);
|
||||
|
||||
update_rect(xpos,ypos,width,height);
|
||||
|
|
|
@ -63,19 +63,19 @@ std::string::const_iterator parse_markup(std::string::const_iterator i1,
|
|||
// quoted backslash - either way, remove leading backslash
|
||||
break;
|
||||
case BAD_TEXT:
|
||||
if (colour) *colour = BAD_COLOUR;
|
||||
if (colour) *colour = BAD_COLOR;
|
||||
break;
|
||||
case GOOD_TEXT:
|
||||
if (colour) *colour = GOOD_COLOUR;
|
||||
if (colour) *colour = GOOD_COLOR;
|
||||
break;
|
||||
case NORMAL_TEXT:
|
||||
if (colour) *colour = NORMAL_COLOUR;
|
||||
if (colour) *colour = NORMAL_COLOR;
|
||||
break;
|
||||
case BLACK_TEXT:
|
||||
if (colour) *colour = BLACK_COLOUR;
|
||||
if (colour) *colour = BLACK_COLOR;
|
||||
break;
|
||||
case GRAY_TEXT:
|
||||
if (colour) *colour = GRAY_COLOUR;
|
||||
if (colour) *colour = GRAY_COLOR;
|
||||
break;
|
||||
case LARGE_TEXT:
|
||||
if (font_size) *font_size += 2;
|
||||
|
@ -179,7 +179,7 @@ std::string span_color(const SDL_Color &color)
|
|||
SDL_Rect text_area(const std::string& text, int size, int style)
|
||||
{
|
||||
const SDL_Rect area = {0,0,10000,10000};
|
||||
return draw_text(NULL, area, size, font::NORMAL_COLOUR, text, 0, 0, false, style);
|
||||
return draw_text(NULL, area, size, font::NORMAL_COLOR, text, 0, 0, false, style);
|
||||
}
|
||||
|
||||
SDL_Rect draw_text(surface dst, const SDL_Rect& area, int size,
|
||||
|
|
|
@ -49,8 +49,8 @@ std::string::const_iterator parse_markup(std::string::const_iterator i1,
|
|||
* set for it equivalent to the entire contents of the text.
|
||||
*
|
||||
* Some very basic 'markup' will be done on the text:
|
||||
* - any line beginning in # will be displayed in BAD_COLOUR (red)
|
||||
* - any line beginning in @ will be displayed in GOOD_COLOUR (green)
|
||||
* - any line beginning in # will be displayed in BAD_COLOR (red)
|
||||
* - any line beginning in @ will be displayed in GOOD_COLOR (green)
|
||||
* - any line beginning in + will be displayed with size increased by 2
|
||||
* - any line beginning in - will be displayed with size decreased by 2
|
||||
* - any line beginning with 0x0n will be displayed in the colour of side n
|
||||
|
|
|
@ -1552,7 +1552,7 @@ void menu_handler::label_terrain(mouse_handler& mousehandler, bool team_only)
|
|||
|
||||
if(!d.show()) {
|
||||
std::string team_name;
|
||||
SDL_Color colour = font::LABEL_COLOUR;
|
||||
SDL_Color colour = font::LABEL_COLOR;
|
||||
|
||||
if (d.option_checked()) {
|
||||
team_name = gui_->labels().team_name();
|
||||
|
|
|
@ -79,7 +79,7 @@ connect::side::side(connect& parent, const config& cfg, int index) :
|
|||
income_lock_(cfg["income_lock"].to_bool()),
|
||||
team_lock_(cfg["team_lock"].to_bool()),
|
||||
colour_lock_(cfg["colour_lock"].to_bool()),
|
||||
player_number_(parent.video(), str_cast(index + 1), font::SIZE_LARGE, font::LOBBY_COLOUR),
|
||||
player_number_(parent.video(), str_cast(index + 1), font::SIZE_LARGE, font::LOBBY_COLOR),
|
||||
combo_controller_(new gui::combo_drag(parent.disp(), parent.player_types_, parent.combo_control_group_)),
|
||||
orig_controller_(parent.video(), current_player_, font::SIZE_SMALL),
|
||||
combo_ai_algorithm_(parent.disp(), std::vector<std::string>()),
|
||||
|
@ -90,8 +90,8 @@ connect::side::side(connect& parent, const config& cfg, int index) :
|
|||
combo_colour_(parent.disp(), parent.player_colours_),
|
||||
slider_gold_(parent.video()),
|
||||
slider_income_(parent.video()),
|
||||
label_gold_(parent.video(), "100", font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
label_income_(parent.video(), _("Normal"), font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
label_gold_(parent.video(), "100", font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
label_income_(parent.video(), _("Normal"), font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
allow_player_(cfg["allow_player"].to_bool(true)),
|
||||
allow_changes_(cfg["allow_changes"].to_bool(true)),
|
||||
enabled_(!parent_->params_.saved_game), changed_(false),
|
||||
|
@ -995,16 +995,16 @@ connect::connect(game_display& disp, const config& game_config,
|
|||
team_prefix_(std::string(_("Team")) + " "),
|
||||
sides_(),
|
||||
users_(),
|
||||
waiting_label_(video(), "", font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
waiting_label_(video(), "", font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
message_full_(false),
|
||||
default_controller_(default_controller),
|
||||
scroll_pane_(video()),
|
||||
type_title_label_(video(), _("Player/Type"), font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
faction_title_label_(video(), _("Faction"), font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
team_title_label_(video(), _("Team/Gender"), font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
colour_title_label_(video(), _("Color"), font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
gold_title_label_(video(), _("Gold"), font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
income_title_label_(video(), _("Income"), font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
type_title_label_(video(), _("Player/Type"), font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
faction_title_label_(video(), _("Faction"), font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
team_title_label_(video(), _("Team/Gender"), font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
colour_title_label_(video(), _("Color"), font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
gold_title_label_(video(), _("Gold"), font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
income_title_label_(video(), _("Income"), font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
|
||||
launch_(video(), _("I'm Ready")),
|
||||
cancel_(video(), _("Cancel")),
|
||||
|
|
|
@ -59,25 +59,25 @@ create::create(game_display& disp, const config &cfg, chat& c, config& gamelist)
|
|||
|
||||
maps_menu_(disp.video(), std::vector<std::string>()),
|
||||
turns_slider_(disp.video()),
|
||||
turns_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
turns_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
countdown_game_(disp.video(), _("Time limit"), gui::button::TYPE_CHECK),
|
||||
countdown_init_time_slider_(disp.video()),
|
||||
countdown_init_time_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
countdown_init_time_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
countdown_reservoir_time_slider_(disp.video()),
|
||||
countdown_reservoir_time_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
countdown_turn_bonus_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
countdown_reservoir_time_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
countdown_turn_bonus_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
countdown_turn_bonus_slider_(disp.video()),
|
||||
countdown_action_bonus_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
countdown_action_bonus_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
countdown_action_bonus_slider_(disp.video()),
|
||||
village_gold_slider_(disp.video()),
|
||||
village_gold_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
village_gold_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
xp_modifier_slider_(disp.video()),
|
||||
xp_modifier_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
name_entry_label_(disp.video(), _("Name of game:"), font::SIZE_PLUS, font::LOBBY_COLOUR),
|
||||
num_players_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
map_size_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
era_label_(disp.video(), _("Era:"), font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
map_label_(disp.video(), _("Map to play:"), font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
xp_modifier_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
name_entry_label_(disp.video(), _("Name of game:"), font::SIZE_PLUS, font::LOBBY_COLOR),
|
||||
num_players_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
map_size_label_(disp.video(), "", font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
era_label_(disp.video(), _("Era:"), font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
map_label_(disp.video(), _("Map to play:"), font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
use_map_settings_(disp.video(), _("Use map settings"), gui::button::TYPE_CHECK),
|
||||
random_start_time_(disp.video(), _("Random start time"), gui::button::TYPE_CHECK),
|
||||
fog_game_(disp.video(), _("Fog Of War"), gui::button::TYPE_CHECK),
|
||||
|
|
|
@ -255,14 +255,14 @@ std::string chat::format_message(const msg& message)
|
|||
}
|
||||
|
||||
SDL_Color chat::color_message(const msg& message) {
|
||||
SDL_Color c = font::NORMAL_COLOUR;
|
||||
SDL_Color c = font::NORMAL_COLOR;
|
||||
// Normal users are not allowed to color their messages
|
||||
if(message.user == "server"
|
||||
|| message.user.substr(0,29) == "whisper: server message from ") {
|
||||
font::parse_markup(message.message.begin(), message.message.end(), NULL, &c, NULL);
|
||||
// Highlight private messages too
|
||||
} else if(message.user.substr(0,8) == "whisper:") {
|
||||
c = font::LABEL_COLOUR;
|
||||
c = font::LABEL_COLOR;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
@ -281,9 +281,9 @@ ui::ui(game_display& disp, const std::string& title, const config& cfg, chat& c,
|
|||
gamelist_(gamelist),
|
||||
|
||||
#ifdef USE_TINY_GUI
|
||||
title_(disp.video(), title, font::SIZE_SMALL, font::TITLE_COLOUR),
|
||||
title_(disp.video(), title, font::SIZE_SMALL, font::TITLE_COLOR),
|
||||
#else
|
||||
title_(disp.video(), title, font::SIZE_LARGE, font::TITLE_COLOUR),
|
||||
title_(disp.video(), title, font::SIZE_LARGE, font::TITLE_COLOR),
|
||||
entry_textbox_(disp.video(), 100),
|
||||
#endif
|
||||
chat_textbox_(disp.video(), 100, "", false),
|
||||
|
|
|
@ -119,12 +119,12 @@ void wait::leader_preview_pane::draw_contents()
|
|||
SDL_BlitSurface(unit_image,NULL,screen,&image_rect);
|
||||
}
|
||||
|
||||
font::draw_text(&video(),area,font::SIZE_PLUS,font::NORMAL_COLOUR,faction,area.x + 110, area.y + 60);
|
||||
const SDL_Rect leader_rect = font::draw_text(&video(),area,font::SIZE_SMALL,font::NORMAL_COLOUR,
|
||||
font::draw_text(&video(),area,font::SIZE_PLUS,font::NORMAL_COLOR,faction,area.x + 110, area.y + 60);
|
||||
const SDL_Rect leader_rect = font::draw_text(&video(),area,font::SIZE_SMALL,font::NORMAL_COLOR,
|
||||
_("Leader: "),area.x, area.y + 110);
|
||||
const SDL_Rect gender_rect = font::draw_text(&video(),area,font::SIZE_SMALL,font::NORMAL_COLOUR,
|
||||
const SDL_Rect gender_rect = font::draw_text(&video(),area,font::SIZE_SMALL,font::NORMAL_COLOR,
|
||||
_("Gender: "),area.x, leader_rect.y + 30 + (leader_rect.h - leader_combo_.height()) / 2);
|
||||
font::draw_wrapped_text(&video(),area,font::SIZE_SMALL,font::NORMAL_COLOUR,
|
||||
font::draw_wrapped_text(&video(),area,font::SIZE_SMALL,font::NORMAL_COLOR,
|
||||
_("Recruits: ") + recruit_string.str(),area.x, area.y + 132 + 30 + (leader_rect.h - leader_combo_.height()) / 2,
|
||||
area.w);
|
||||
leader_combo_.set_location(leader_rect.x + leader_rect.w + 16, leader_rect.y + (leader_rect.h - leader_combo_.height()) / 2);
|
||||
|
@ -172,7 +172,7 @@ wait::wait(game_display& disp, const config& cfg,
|
|||
mp::chat& c, config& gamelist) :
|
||||
ui(disp, _("Game Lobby"), cfg, c, gamelist),
|
||||
cancel_button_(disp.video(), _("Cancel")),
|
||||
start_label_(disp.video(), _("Waiting for game to start..."), font::SIZE_SMALL, font::LOBBY_COLOUR),
|
||||
start_label_(disp.video(), _("Waiting for game to start..."), font::SIZE_SMALL, font::LOBBY_COLOR),
|
||||
game_menu_(disp.video(), std::vector<std::string>(), false, -1, -1, NULL, &gui::menu::bluebg_style),
|
||||
level_(),
|
||||
state_(),
|
||||
|
|
|
@ -296,7 +296,7 @@ void show_hotkeys_dialog (display & disp, config *save_config)
|
|||
|
||||
SDL_Rect clip_rect = { 0, 0, disp.w (), disp.h () };
|
||||
SDL_Rect text_size = font::draw_text(NULL, clip_rect, font::SIZE_LARGE,
|
||||
font::NORMAL_COLOUR,_("Press desired Hotkey (Esc cancels)"),
|
||||
font::NORMAL_COLOR,_("Press desired Hotkey (Esc cancels)"),
|
||||
0, 0);
|
||||
|
||||
std::vector<std::string> menu_items;
|
||||
|
@ -363,7 +363,7 @@ void show_hotkeys_dialog (display & disp, config *save_config)
|
|||
text_size.h+12);
|
||||
mini_frame.draw_background();
|
||||
mini_frame.draw_border();
|
||||
font::draw_text (&disp.video(), clip_rect, font::SIZE_LARGE,font::NORMAL_COLOUR,
|
||||
font::draw_text (&disp.video(), clip_rect, font::SIZE_LARGE,font::NORMAL_COLOR,
|
||||
_("Press desired Hotkey (Esc cancels)"),centerx-text_size.w/2,
|
||||
centery-text_size.h/2);
|
||||
disp.update_display();
|
||||
|
|
|
@ -2077,8 +2077,8 @@ static int intf_float_label(lua_State *L)
|
|||
|
||||
t_string text;
|
||||
if (!luaW_totstring(L, 3, text)) goto error_call_destructors_1;
|
||||
resources::screen->float_label(loc, text, font::LABEL_COLOUR.r,
|
||||
font::LABEL_COLOUR.g, font::LABEL_COLOUR.b);
|
||||
resources::screen->float_label(loc, text, font::LABEL_COLOR.r,
|
||||
font::LABEL_COLOR.g, font::LABEL_COLOR.b);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -289,7 +289,7 @@ SDL_Rect dialog_frame::draw_title(CVideo* video)
|
|||
{
|
||||
SDL_Rect rect = {0, 0, 10000, 10000};
|
||||
rect = screen_area();
|
||||
return font::draw_text(video, rect, font::SIZE_LARGE, font::TITLE_COLOUR,
|
||||
return font::draw_text(video, rect, font::SIZE_LARGE, font::TITLE_COLOR,
|
||||
title_, dim_.title.x, dim_.title.y, false, TTF_STYLE_BOLD);
|
||||
}
|
||||
|
||||
|
|
|
@ -350,14 +350,14 @@ static void draw_background(game_display& screen)
|
|||
std::string(" ") + game_config::revision;
|
||||
|
||||
const SDL_Rect version_area = font::draw_text(NULL, screen_area(),
|
||||
font::SIZE_TINY, font::NORMAL_COLOUR,
|
||||
font::SIZE_TINY, font::NORMAL_COLOR,
|
||||
version_str,0,0);
|
||||
const size_t versiony = screen.h() - version_area.h;
|
||||
|
||||
if(versiony < size_t(screen.h())) {
|
||||
draw_solid_tinted_rectangle(0, versiony - 2, version_area.w + 3, version_area.h + 2,0,0,0,0.75,screen.video().getSurface());
|
||||
font::draw_text(&screen.video(),screen.screen_area(),
|
||||
font::SIZE_TINY, font::NORMAL_COLOUR,
|
||||
font::SIZE_TINY, font::NORMAL_COLOR,
|
||||
version_str,0,versiony);
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ static void show_tooltip(const tooltip& tip)
|
|||
|
||||
font::floating_label flabel(tip.message);
|
||||
flabel.set_font_size(font_size);
|
||||
flabel.set_colour(font::NORMAL_COLOUR);
|
||||
flabel.set_colour(font::NORMAL_COLOR);
|
||||
flabel.set_clip_rect(area);
|
||||
flabel.set_width(text_width);
|
||||
flabel.set_alignement(font::LEFT_ALIGN);
|
||||
|
|
|
@ -122,7 +122,7 @@ void button::calculate_size()
|
|||
|
||||
if (type_ != TYPE_IMAGE){
|
||||
textRect_ = font::draw_text(NULL, screen_area(), font_size,
|
||||
font::BUTTON_COLOUR, label_, 0, 0);
|
||||
font::BUTTON_COLOR, label_, 0, 0);
|
||||
}
|
||||
|
||||
if (!change_size)
|
||||
|
@ -226,13 +226,13 @@ void button::draw_contents()
|
|||
textx = loc.x + image_w + checkbox_horizontal_padding / 2;
|
||||
}
|
||||
|
||||
SDL_Color button_colour = font::BUTTON_COLOUR;
|
||||
SDL_Color button_colour = font::BUTTON_COLOR;
|
||||
|
||||
if (!enabled()) {
|
||||
static const Uint32 disabled_btn_color = 0xAAAAAA;
|
||||
static const double disabled_btn_adjust = 0.18;
|
||||
image = blend_surface(greyscale_image(image), disabled_btn_adjust, disabled_btn_color);
|
||||
button_colour = font::GRAY_COLOUR;
|
||||
button_colour = font::GRAY_COLOR;
|
||||
}
|
||||
|
||||
video().blit_surface(loc.x, loc.y, image);
|
||||
|
|
|
@ -51,7 +51,7 @@ const SDL_Color& label::set_colour(const SDL_Color& colour)
|
|||
|
||||
const SDL_Color& label::get_colour() const
|
||||
{
|
||||
return (enabled()) ? colour_ : font::DISABLED_COLOUR;
|
||||
return (enabled()) ? colour_ : font::DISABLED_COLOR;
|
||||
}
|
||||
|
||||
void label::draw_contents()
|
||||
|
|
|
@ -25,7 +25,7 @@ class label : public widget
|
|||
{
|
||||
public:
|
||||
label(CVideo& video, const std::string& text, int size=font::SIZE_NORMAL,
|
||||
const SDL_Color& colour=font::NORMAL_COLOUR, const bool auto_join=true);
|
||||
const SDL_Color& colour=font::NORMAL_COLOR, const bool auto_join=true);
|
||||
const std::string& set_text(const std::string& text);
|
||||
const std::string& get_text() const;
|
||||
|
||||
|
|
|
@ -806,7 +806,7 @@ SDL_Rect menu::style::item_size(const std::string& item) const {
|
|||
} else {
|
||||
const SDL_Rect area = {0,0,10000,10000};
|
||||
const SDL_Rect font_size =
|
||||
font::draw_text(NULL,area,get_font_size(),font::NORMAL_COLOUR,str,0,0);
|
||||
font::draw_text(NULL,area,get_font_size(),font::NORMAL_COLOR,str,0,0);
|
||||
res.w += font_size.w;
|
||||
res.h = std::max<int>(font_size.h, res.h);
|
||||
}
|
||||
|
@ -956,7 +956,7 @@ void menu::draw_row(const size_t row_index, const SDL_Rect& rect, ROW_TYPE type)
|
|||
: str;
|
||||
const SDL_Rect& text_size = font::text_area(str,style_->get_font_size());
|
||||
const size_t y = rect.y + (rect.h - text_size.h)/2;
|
||||
font::draw_text(&video(),column,style_->get_font_size(),font::NORMAL_COLOUR,to_show,xpos,y);
|
||||
font::draw_text(&video(),column,style_->get_font_size(),font::NORMAL_COLOR,to_show,xpos,y);
|
||||
|
||||
if(type == HEADING_ROW && sortby_ == int(i)) {
|
||||
const surface sort_img = image::get_image(sortreversed_ ? "misc/sort-arrow.png" :
|
||||
|
|
|
@ -77,7 +77,7 @@ void progress_bar::draw_contents()
|
|||
&video(),
|
||||
location(),
|
||||
font::SIZE_NORMAL,
|
||||
font::BLACK_COLOUR,
|
||||
font::BLACK_COLOR,
|
||||
text,
|
||||
text_area.x,
|
||||
text_area.y
|
||||
|
|
|
@ -142,10 +142,10 @@ void slider::draw_contents()
|
|||
surface image(state_ != NORMAL ? highlightedImage_ : image_);
|
||||
if (image == NULL)
|
||||
return;
|
||||
SDL_Color line_colour = font::NORMAL_COLOUR;
|
||||
SDL_Color line_colour = font::NORMAL_COLOR;
|
||||
if (!enabled()) {
|
||||
image = greyscale_image(image);
|
||||
line_colour = font::DISABLED_COLOUR;
|
||||
line_colour = font::DISABLED_COLOR;
|
||||
}
|
||||
|
||||
SDL_Rect const &loc = location();
|
||||
|
|
|
@ -42,7 +42,7 @@ textbox::textbox(CVideo &video, int width, const std::string& text, bool editabl
|
|||
alpha_focus_(alpha_focus)
|
||||
{
|
||||
// static const SDL_Rect area = d.screen_area();
|
||||
// const int height = font::draw_text(NULL,area,font_size,font::NORMAL_COLOUR,"ABCD",0,0).h;
|
||||
// const int height = font::draw_text(NULL,area,font_size,font::NORMAL_COLOR,"ABCD",0,0).h;
|
||||
set_measurements(width, font::get_max_height(font_size));
|
||||
set_scroll_rate(font::get_max_height(font_size) / 2);
|
||||
update_text_cache(true);
|
||||
|
|
|
@ -32,8 +32,8 @@ public:
|
|||
virtual ~textbox();
|
||||
|
||||
const std::string text() const;
|
||||
void set_text(const std::string& text, const SDL_Color& color =font::NORMAL_COLOUR);
|
||||
void append_text(const std::string& text,bool auto_scroll = false, const SDL_Color& color =font::NORMAL_COLOUR);
|
||||
void set_text(const std::string& text, const SDL_Color& color =font::NORMAL_COLOR);
|
||||
void append_text(const std::string& text,bool auto_scroll = false, const SDL_Color& color =font::NORMAL_COLOR);
|
||||
void clear();
|
||||
|
||||
void scroll_to_bottom();
|
||||
|
@ -82,8 +82,8 @@ private:
|
|||
void handle_event(const SDL_Event& event);
|
||||
|
||||
void draw_cursor(int pos, CVideo &video) const;
|
||||
void update_text_cache(bool reset = false, const SDL_Color& color =font::NORMAL_COLOUR);
|
||||
surface add_text_line(const wide_string& text, const SDL_Color& color =font::NORMAL_COLOUR);
|
||||
void update_text_cache(bool reset = false, const SDL_Color& color =font::NORMAL_COLOR);
|
||||
surface add_text_line(const wide_string& text, const SDL_Color& color =font::NORMAL_COLOR);
|
||||
bool is_selection();
|
||||
void erase_selection();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue