Jens Beyer has proposed merging lp:~widelands-dev/widelands/bug1502458 into 
lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1502458 in widelands: "Carrier hiding in Warehouse/HQ is hardcoded"
  https://bugs.launchpad.net/widelands/+bug/1502458

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug1502458/+merge/273345

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.
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug1502458 into lp:widelands.
=== modified file 'src/wui/warehousewindow.cc'
--- src/wui/warehousewindow.cc	2014-11-30 18:49:38 +0000
+++ src/wui/warehousewindow.cc	2015-10-04 18:16:44 +0000
@@ -64,10 +64,14 @@
 {
 	set_inner_size(width, 0);
 	add_warelist(type == Widelands::wwWORKER ? m_warehouse.get_workers() : m_warehouse.get_wares());
-	if (type == Widelands::wwWORKER) {
-		Widelands::WareIndex carrier_index =
-			m_warehouse.descr().tribe().worker_index("carrier");
-		hide_ware(carrier_index);
+	if (type == Widelands::wwWORKER)
+	{
+		const std::vector<Widelands::WareIndex> & worker_types_without_cost =
+			m_warehouse.descr().tribe().worker_types_without_cost();
+		for (size_t i = 0; i < worker_types_without_cost.size(); ++i)
+		{
+			hide_ware(worker_types_without_cost.at(i));
+		}
 	}
 }
 

_______________________________________________
Mailing list: https://launchpad.net/~widelands-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to