diff --git a/src/game_initialization/lobby_data.cpp b/src/game_initialization/lobby_data.cpp index 673a146abbb5..d7f694818a09 100644 --- a/src/game_initialization/lobby_data.cpp +++ b/src/game_initialization/lobby_data.cpp @@ -200,6 +200,7 @@ game_info::game_info(const config& game, const std::vector& install , map_data(game["map_data"]) , name(font::escape_text(game["name"])) , scenario() + , type_marker() , remote_scenario(false) , map_info() , map_size_info() @@ -351,7 +352,8 @@ game_info::game_info(const config& game, const std::vector& install } if(*level_cfg) { - scenario = formatter() << make_game_type_marker(_("scenario_abbreviation^S"), false) << (*level_cfg)["name"].str(); + type_marker = make_game_type_marker(_("scenario_abbreviation^S"), false); + scenario = (*level_cfg)["name"].str(); info_stream << scenario; // Reloaded games do not match the original scenario hash, so it makes no sense @@ -384,15 +386,17 @@ game_info::game_info(const config& game, const std::vector& install if(require) { addons_outcome = std::max(addons_outcome, NEED_DOWNLOAD); // Elevate to most severe error level encountered so far } - scenario = formatter() << make_game_type_marker(_("scenario_abbreviation^S"), true) << game["mp_scenario_name"].str(); + type_marker = make_game_type_marker(_("scenario_abbreviation^S"), true); + scenario = game["mp_scenario_name"].str(); info_stream << scenario; verified = false; } } else if(!game["mp_campaign"].empty()) { if(const config& campaign_cfg = game_config.find_child("campaign", "id", game["mp_campaign"])) { + type_marker = make_game_type_marker(_("campaign_abbreviation^C"), false); + std::stringstream campaign_text; campaign_text - << make_game_type_marker(_("campaign_abbreviation^C"), false) << campaign_cfg["name"] << spaced_em_dash() << game["mp_scenario_name"]; @@ -415,7 +419,8 @@ game_info::game_info(const config& game, const std::vector& install addons_outcome = std::max(addons_outcome, result); // Elevate to most severe error level encountered so far //} } else { - scenario = formatter() << make_game_type_marker(_("campaign_abbreviation^C"), true) << game["mp_campaign_name"].str(); + type_marker = make_game_type_marker(_("campaign_abbreviation^C"), true); + scenario = game["mp_campaign_name"].str(); info_stream << scenario; verified = false; } diff --git a/src/game_initialization/lobby_data.hpp b/src/game_initialization/lobby_data.hpp index 9435cfa35f20..66bbde33b9d6 100644 --- a/src/game_initialization/lobby_data.hpp +++ b/src/game_initialization/lobby_data.hpp @@ -145,6 +145,7 @@ struct game_info std::string map_data; std::string name; std::string scenario; + std::string type_marker; bool remote_scenario; std::string map_info; std::string map_size_info; diff --git a/src/gui/dialogs/multiplayer/lobby.cpp b/src/gui/dialogs/multiplayer/lobby.cpp index c2459fc1d3b2..18aa10137a81 100644 --- a/src/gui/dialogs/multiplayer/lobby.cpp +++ b/src/gui/dialogs/multiplayer/lobby.cpp @@ -425,7 +425,7 @@ std::map mp_lobby::make_game_row_data(const mp::game_in item["label"] = game.vacant_slots > 0 ? colorize(game.name, color_string) : game.name; data.emplace("name", item); - item["label"] = colorize("" + scenario_text + "", font::GRAY_COLOR); + item["label"] = colorize("" + game.type_marker + scenario_text + "", font::GRAY_COLOR); data.emplace("scenario", item); item["label"] = colorize(game.status, color_string);