Merge lp:~widelands-dev/widelands/bug-1645844-game-summary into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 8721
Proposed branch: lp:~widelands-dev/widelands/bug-1645844-game-summary
Merge into: lp:widelands
Diff against target: 12 lines (+1/-1)
1 file modified
src/wui/game_summary.cc (+1/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1645844-game-summary
Reviewer Review Type Date Requested Status
Notabilis Approve
Review via email: mp+346916@code.launchpad.net

Commit message

Display en-dash for team 0 in game summary

Description of the change

The easiest way to test this is to hack

   local remaining_time

in one of the win conditions, so you don't have to wait for 4 hours gametime.

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 3554. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/384301992.
Appveyor build 3358. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1645844_game_summary-3358.

Revision history for this message
Notabilis (notabilis27) wrote :

Thanks, the dash is much better than displaying it as team 0.
Testing worked fine and code change is looking good.

Small refactoring suggestion for the existing code: Rename the local variable teastr_ to team_str. No idea why it was named that way, it is another naming scheme than the other local variables and seems to denote a private member variable.

review: Approve
Revision history for this message
GunChleoc (gunchleoc) wrote :

That whole screen needs refactoring and improving, so I'd rather rename the variable then and get this in now. Unless somebody has an IDE handy where it's just a few mouse clicks? I'd have to do this manually in a text editor at the moment.

Revision history for this message
Notabilis (notabilis27) wrote :

The variable is only used in that line and in the following line, so its no problem renaming it by hand. But feel free to merge this as it is.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Then it should also be const or omitted... I already shut down my VM for the day, so let's have it as it is for now.

@bunnybot merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/wui/game_summary.cc'
2--- src/wui/game_summary.cc 2018-04-27 06:11:05 +0000
3+++ src/wui/game_summary.cc 2018-05-27 07:22:25 +0000
4@@ -156,7 +156,7 @@
5 assert(player_image);
6 te.set_picture(0, player_image, p->get_name());
7 // Team
8- std::string teastr_ =
9+ std::string teastr_ = p->team_number() == 0 ? "—" :
10 (boost::format("%|1$u|") % static_cast<unsigned int>(p->team_number())).str();
11 te.set_string(1, teastr_);
12 // Status

Subscribers

People subscribed via source and target branches

to status/vote changes: