Merge lp:~widelands-dev/widelands/bug1502458 into lp:widelands

Proposed by Jens Beyer
Status: Merged
Merged at revision: 7542
Proposed branch: lp:~widelands-dev/widelands/bug1502458
Merge into: lp:widelands
Diff against target: 21 lines (+8/-4)
1 file modified
src/wui/warehousewindow.cc (+8/-4)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug1502458
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+273345@code.launchpad.net

Description of the change

Idea by gunchleoc:

instead of hiding carriers in a hardcoded way in the worker storage tab of warehouses, we hide all workers which do not have buildcost. For vanilla widelands, this is only the carriers, so no visible change for Barbarian, Atlantean and Empire players.

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

LGTM :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/wui/warehousewindow.cc'
2--- src/wui/warehousewindow.cc 2014-11-30 18:49:38 +0000
3+++ src/wui/warehousewindow.cc 2015-10-04 18:16:44 +0000
4@@ -64,10 +64,14 @@
5 {
6 set_inner_size(width, 0);
7 add_warelist(type == Widelands::wwWORKER ? m_warehouse.get_workers() : m_warehouse.get_wares());
8- if (type == Widelands::wwWORKER) {
9- Widelands::WareIndex carrier_index =
10- m_warehouse.descr().tribe().worker_index("carrier");
11- hide_ware(carrier_index);
12+ if (type == Widelands::wwWORKER)
13+ {
14+ const std::vector<Widelands::WareIndex> & worker_types_without_cost =
15+ m_warehouse.descr().tribe().worker_types_without_cost();
16+ for (size_t i = 0; i < worker_types_without_cost.size(); ++i)
17+ {
18+ hide_ware(worker_types_without_cost.at(i));
19+ }
20 }
21 }
22

Subscribers

People subscribed via source and target branches

to status/vote changes: