Merge lp:~widelands-dev/widelands/bug-1634736-victory-gamespeed into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 8282
Proposed branch: lp:~widelands-dev/widelands/bug-1634736-victory-gamespeed
Merge into: lp:widelands
Diff against target: 55 lines (+7/-2)
3 files modified
src/wui/game_summary.cc (+6/-1)
src/wui/game_summary.h (+1/-0)
src/wui/interactive_gamebase.cc (+0/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1634736-victory-gamespeed
Reviewer Review Type Date Requested Status
kaputtnik (community) testing Approve
Review via email: mp+316973@code.launchpad.net

Commit message

The game summary window now restores the original desired speed when it's closed.

Description of the change

Resume game speed when game summary window is closed. Using the desired speed is the only way to pause the game both in single- and multiplayer mode.

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

Continuous integration builds have changed state:

Travis build 1926. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/200408939.
Appveyor build 1761. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1634736_victory_gamespeed-1761.

Revision history for this message
Notabilis (notabilis27) wrote :

Code looks good to me and in single player it works as wanted.

What do you mean with your NOCOM?

Revision history for this message
kaputtnik (franku) wrote :

Played the first tutorial and it works as expected.

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

Thanks for the test and review! The NOCOM was an old note that needed to go.

Revision history for this message
GunChleoc (gunchleoc) wrote :

@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 2017-01-25 18:55:59 +0000
3+++ src/wui/game_summary.cc 2017-02-11 11:05:58 +0000
4@@ -26,6 +26,7 @@
5 #include "graphic/graphic.h"
6 #include "graphic/playercolor.h"
7 #include "logic/game.h"
8+#include "logic/game_controller.h"
9 #include "logic/player.h"
10 #include "logic/playersmanager.h"
11 #include "ui_basic/box.h"
12@@ -40,7 +41,10 @@
13 #define PADDING 4
14
15 GameSummaryScreen::GameSummaryScreen(InteractiveGameBase* parent, UI::UniqueWindow::Registry* r)
16- : UI::UniqueWindow(parent, "game_summary", r, 0, 0, _("Game over")), game_(parent->game()) {
17+ : UI::UniqueWindow(parent, "game_summary", r, 0, 0, _("Game over")),
18+ game_(parent->game()),
19+ desired_speed_(game_.game_controller()->desired_speed()) {
20+ game_.game_controller()->set_desired_speed(0);
21 // Init boxes
22 UI::Box* vbox = new UI::Box(this, 0, 0, UI::Box::Vertical, 0, 0, PADDING);
23 title_area_ = new UI::Textarea(vbox, "", UI::Align::kHCenter);
24@@ -207,6 +211,7 @@
25 }
26
27 void GameSummaryScreen::continue_clicked() {
28+ game_.game_controller()->set_desired_speed(desired_speed_);
29 die();
30 }
31
32
33=== modified file 'src/wui/game_summary.h'
34--- src/wui/game_summary.h 2017-01-25 18:55:59 +0000
35+++ src/wui/game_summary.h 2017-02-11 11:05:58 +0000
36@@ -47,6 +47,7 @@
37 std::string parse_player_info(std::string info);
38
39 Widelands::Game& game_;
40+ uint32_t desired_speed_;
41 UI::Textarea* title_area_;
42 UI::Textarea* gametime_label_;
43 UI::Textarea* gametime_value_;
44
45=== modified file 'src/wui/interactive_gamebase.cc'
46--- src/wui/interactive_gamebase.cc 2017-01-25 18:55:59 +0000
47+++ src/wui/interactive_gamebase.cc 2017-02-11 11:05:58 +0000
48@@ -156,7 +156,6 @@
49 }
50
51 void InteractiveGameBase::show_game_summary() {
52- game().game_controller()->set_desired_speed(0);
53 if (game_summary_.window) {
54 game_summary_.window->set_visible(true);
55 game_summary_.window->think();

Subscribers

People subscribed via source and target branches

to status/vote changes: