Skip to content

Commit

Permalink
MP Create: display game title in details area
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Aug 27, 2016
1 parent ae2a3c5 commit d6cff9b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
18 changes: 18 additions & 0 deletions data/gui/window/mp_create_game/default_resolution.cfg
Expand Up @@ -67,6 +67,24 @@

[grid]

[row]
grow_factor = 0

[column]
border = "all"
border_size = 5
horizontal_grow = "true"

[label]
definition = "default_large"
id = "game_title"
[/label]

[/column]

[/row]


[row]
grow_factor = 0

Expand Down
7 changes: 7 additions & 0 deletions src/gui/dialogs/multiplayer/mp_create_game.cpp
Expand Up @@ -49,6 +49,8 @@
#include "utils/functional.hpp"
#endif

#include <boost/algorithm/string.hpp>

namespace gui2
{

Expand Down Expand Up @@ -808,6 +810,11 @@ void tmp_create_game::update_details(twindow& window)
config_engine_->update_initial_cfg(create_engine_.current_level().data());
config_engine_->set_default_values();

// Set the title, with newlines replaced. Newlines are sometimes found in SP Campaign names
std::string title = create_engine_.current_level().name();
boost::replace_all(title, "\n", " " + utils::unicode_em_dash + " ");
find_widget<tcontrol>(&window, "game_title", false).set_label(title);

show_description(window, create_engine_.current_level().description());

switch(create_engine_.current_level_type().v) {
Expand Down

0 comments on commit d6cff9b

Please sign in to comment.