Merge lp:~widelands-dev/widelands/multiplayer-ui into lp:widelands

Proposed by Toni Förster on 2018-08-21
Status: Merged
Merged at revision: 8793
Proposed branch: lp:~widelands-dev/widelands/multiplayer-ui
Merge into: lp:widelands
Diff against target: 112 lines (+18/-15)
2 files modified
src/ui_fsmenu/launch_mpg.cc (+15/-12)
src/wui/multiplayersetupgroup.cc (+3/-3)
To merge this branch: bzr merge lp:~widelands-dev/widelands/multiplayer-ui
Reviewer Review Type Date Requested Status
GunChleoc 2018-08-21 Approve on 2018-08-22
Review via email: mp+353523@code.launchpad.net

Commit message

Multiplayer-ui tweaks: less empty spaces and more space for important content.

- chat has more space
- map_info scales better
- client_info has no height restriction

Description of the change

Less free space and more room for the important parts. Pictures can be found in the Forum:

https://wl.widelands.org/forum/post/25724/

To post a comment you must log in.
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 3827. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/418836717.
Appveyor build 3626. State: failed. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_multiplayer_ui-3626.

8792. By Toni Förster on 2018-08-22

merged trunk

GunChleoc (gunchleoc) wrote :

LGTM :)

@bunnybot merge

review: Approve
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 3831. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/419041575.
Appveyor build 3630. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_multiplayer_ui-3630.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ui_fsmenu/launch_mpg.cc'
2--- src/ui_fsmenu/launch_mpg.cc 2018-07-08 08:19:44 +0000
3+++ src/ui_fsmenu/launch_mpg.cc 2018-08-22 06:40:59 +0000
4@@ -105,7 +105,7 @@
5 padding_(4),
6 indent_(10),
7 label_height_(20),
8- right_column_x_(get_w() * 37 / 50),
9+ right_column_x_(get_w() * 57 / 80),
10
11 // Buttons
12 change_map_or_save_(this,
13@@ -130,17 +130,17 @@
14 // Text labels
15 mapname_(this, right_column_x_, get_h() * 3 / 20, std::string()),
16 clients_(this,
17- // (get_w() * 57 / 80) is the width of the MultiPlayerSetupGroup
18- get_w() / 50,
19+ // the width of the MultiPlayerSetupGroup is (get_w() * 53 / 80)
20+ get_w() * 3 / 80,
21 get_h() / 10,
22- (get_w() * 57 / 80) / 3,
23+ get_w() * 19 / 80,
24 get_h() / 10,
25 _("Clients"),
26 UI::Align::kCenter),
27 players_(this,
28- get_w() / 50 + (get_w() * 57 / 80) * 6 / 15,
29+ get_w() /4,
30 get_h() / 10,
31- (get_w() * 57 / 80) * 9 / 15,
32+ get_w() * 9 / 20,
33 get_h() / 10,
34 _("Players"),
35 UI::Align::kCenter),
36@@ -155,13 +155,13 @@
37 right_column_x_,
38 get_h() * 2 / 10,
39 butw_,
40- get_h() * 23 / 80 - 2 * label_height_,
41+ get_h() * 23 / 80 - 1.6 * label_height_,
42 UI::PanelStyle::kFsMenu),
43 client_info_(this,
44 right_column_x_,
45 get_h() * 13 / 20 - 2 * label_height_,
46 butw_,
47- 2 * label_height_,
48+ get_h(),
49 UI::PanelStyle::kFsMenu),
50 help_(nullptr),
51
52@@ -185,12 +185,14 @@
53 players_.set_color(RGBColor(0, 255, 0));
54 map_.set_fontsize(fs_);
55 map_.set_color(RGBColor(0, 255, 0));
56+ wincondition_type_.set_color(RGBColor(0, 255, 0));
57
58 mapname_.set_text(_("(no map)"));
59 map_info_.set_text(_("The host has not yet selected a map or saved game."));
60
61 mpsg_ = new MultiPlayerSetupGroup(
62- this, get_w() / 50, change_map_or_save_.get_y(), get_w() * 57 / 80, get_h(), settings, buth_);
63+ this, get_w() * 3 / 80, change_map_or_save_.get_y(), get_w() * 53 / 80,
64+ get_h() * 17 / 30 - change_map_or_save_.get_y(), settings, buth_);
65
66 // If we are the host, open the map or save selection menu at startup
67 if (settings_->settings().usernum == 0 && settings_->settings().mapname.empty()) {
68@@ -205,7 +207,7 @@
69 suggested_teams_box_ =
70 new UI::SuggestedTeamsBox(this, right_column_x_, 0, UI::Box::Vertical, padding_, indent_,
71 get_w() - right_column_x_, 4 * label_height_);
72-}
73+ }
74
75 FullscreenMenuLaunchMPG::~FullscreenMenuLaunchMPG() {
76 delete mpsg_;
77@@ -223,8 +225,9 @@
78 */
79 void FullscreenMenuLaunchMPG::set_chat_provider(ChatProvider& chat) {
80 delete chat_;
81- chat_ = new GameChatPanel(this, get_w() / 50, get_h() * 13 / 20, get_w() * 57 / 80,
82- get_h() * 3 / 10, chat, UI::PanelStyle::kFsMenu);
83+ chat_ = new GameChatPanel(this, get_w() * 3/ 80,
84+ get_h() * 17 / 30 + 0.5 * label_height_, get_w() * 53 / 80,
85+ get_h() * 11 / 30, chat, UI::PanelStyle::kFsMenu);
86 }
87
88 /**
89
90=== modified file 'src/wui/multiplayersetupgroup.cc'
91--- src/wui/multiplayersetupgroup.cc 2018-06-08 17:14:28 +0000
92+++ src/wui/multiplayersetupgroup.cc 2018-08-22 06:40:59 +0000
93@@ -628,16 +628,16 @@
94 settings_(settings),
95 npsb(new NetworkPlayerSettingsBackend(settings_)),
96 clientbox(this, 0, 0, UI::Box::Vertical),
97- playerbox(this, 0, 0, UI::Box::Vertical, w * 9 / 15, h, kPadding),
98+ playerbox(this, 0, 0, UI::Box::Vertical, w * 36 / 53, h, kPadding),
99 buth_(buth) {
100- clientbox.set_size(w / 3, h);
101+ clientbox.set_size(w * 16 / 53, h);
102 clientbox.set_scrolling(true);
103
104 add(&clientbox, UI::Box::Resizing::kExpandBoth);
105 add(&playerbox);
106
107 // Playerbox
108- playerbox.set_size(w * 9 / 15, h);
109+ playerbox.set_size(w * 36 / 53, h);
110 playerbox.add_space(0);
111 multi_player_player_groups.resize(kMaxPlayers);
112 for (PlayerSlot i = 0; i < multi_player_player_groups.size(); ++i) {