Skip to content

Commit

Permalink
MP Lobby: bunch of small UI and text formatting tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed May 7, 2018
1 parent 6356f34 commit 0c0cd2c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions data/gui/window/lobby_main.cfg
Expand Up @@ -505,7 +505,7 @@

[row]
[column]
border = "left,right,top"
border = "all"
border_size = 5
horizontal_grow = true

Expand All @@ -531,7 +531,7 @@

[/row]

{GUI_HORIZONTAL_SPACER_LINE}
#{GUI_HORIZONTAL_SPACER_LINE}

{_GUI_PLAYER_TREE_AREA}

Expand Down
13 changes: 7 additions & 6 deletions src/gui/dialogs/multiplayer/lobby.cpp
Expand Up @@ -452,13 +452,14 @@ void mp_lobby::adjust_game_row_contents(const mp::game_info& game, grid* grid, b
//
std::ostringstream ss;

ss << "<big>" << _("Era:") << "</big>\n" << game.era;
ss << "<big>" << colorize(_("Era"), font::TITLE_COLOR) << "</big>\n" << game.era;

if(!game.have_era) {
ss << " (" << _("era^missing") << ")";
// NOTE: not using colorize() here deliberately to avoid awkward string concatenation.
ss << " " << font::span_color(font::BAD_COLOR) << "(" << _("era^missing") << ")</span>";
}

ss << "\n\n<big>" << _("Modifications:") << "</big>\n";
ss << "\n\n<big>" << colorize(_("Modifications"), font::TITLE_COLOR) << "</big>\n";

std::vector<std::string> mods = utils::split(game.mod_info);

Expand All @@ -473,7 +474,7 @@ void mp_lobby::adjust_game_row_contents(const mp::game_info& game, grid* grid, b
// TODO: move to some general are of the code.
const auto yes_or_no = [](bool val) { return val ? _("yes") : _("no"); };

ss << "\n<big>" << _("Settings:") << "</big>\n";
ss << "\n<big>" << colorize(_("Settings"), font::TITLE_COLOR) << "</big>\n";
ss << _("Experience modifier:") << " " << game.xp << "\n";
ss << _("Gold per village:") << " " << game.gold << "\n";
ss << _("Map size:") << " " << game.map_size_info << "\n";
Expand All @@ -489,8 +490,8 @@ void mp_lobby::adjust_game_row_contents(const mp::game_info& game, grid* grid, b
if(!game.have_era || !game.have_all_mods || !game.required_addons.empty()) {
info_icon.set_label("icons/icon-info-error.png");

ss << "\n\n<big><span color='#f00'>! </span></big>";
ss << _("One or more items need to be installed\nin order to join this game.");
ss << "\n\n<span color='#f00' size='x-large'>! </span>";
ss << _("One or more add-ons need to be installed\nin order to join this game.");
} else {
info_icon.set_label("icons/icon-info.png");
}
Expand Down

0 comments on commit 0c0cd2c

Please sign in to comment.