Author: cycholka
Date: Mon Jun 23 10:25:45 2008
New Revision: 27427
URL: http://svn.gna.org/viewcvs/wesnoth?rev=27427&view=rev
Log:
Fix an earlier bug causing all game names to show in red
Disable a check causing have_era attribute not not be set in most cases making
selection_is_joinable and selection_is_obsevable not to function properly
Fix bug introduced in my previous commit causing all games getting Unknown Era
suffix regardless of need.
Modified:
trunk/src/multiplayer_lobby.cpp
Modified: trunk/src/multiplayer_lobby.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/multiplayer_lobby.cpp?rev=27427&r1=27426&r2=27427&view=diff
==============================================================================
--- trunk/src/multiplayer_lobby.cpp (original)
+++ trunk/src/multiplayer_lobby.cpp Mon Jun 23 10:25:45 2008
@@ -114,7 +114,7 @@
const game_item& game = games_[index];
int xpos = item_rect.x + margin_;
int ypos = item_rect.y + margin_;
-
+ std::string no_era_string = "";
// Draw minimaps
if (game.mini_map != NULL) {
int minimap_x = xpos + (minimap_size_ - game.mini_map->w)/2;
@@ -125,7 +125,7 @@
// Set font color
SDL_Color font_color;
- if (!game.password_required) {
+ if (game.password_required) {
font_color = font::BAD_COLOUR;
} else if (game.vacant_slots > 0 && game.have_era) {
if (game.reloaded || game.started) {
@@ -140,14 +140,16 @@
font_color = font::BAD_COLOUR;
}
}
-
+ if(!game.have_era)
+ no_era_string = _(" (Unknown Era)");
+
const surface status_text(font::get_rendered_text(game.status,
font::SIZE_NORMAL, font_color));
const int status_text_width = status_text ? status_text->w : 0;
// First line: draw game name
const surface name_surf(font::get_rendered_text(
- font::make_text_ellipsis(game.name + _(" (Unknown Era)"),
font::SIZE_PLUS,
+ font::make_text_ellipsis(game.name + no_era_string, font::SIZE_PLUS,
(item_rect.x + item_rect.w) - xpos - margin_ -
status_text_width - h_padding_),
font::SIZE_PLUS, font_color));
video().blit_surface(xpos, ypos, name_surf);
@@ -403,9 +405,9 @@
if (era_cfg != NULL) {
games_.back().map_info =
era_cfg->get_attribute("name");
} else {
- if((**game)["require_era"] == "yes") {
+// if((**game)["require_era"] == "yes") {
games_.back().have_era = false;
- }
+// }
games_.back().map_info = vgettext("Unknown era:
$era_id", symbols);
verified = false;
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits