← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~majcherlk/widelands/seafaring-check into lp:widelands

 

Lukasz has proposed merging lp:~majcherlk/widelands/seafaring-check into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~majcherlk/widelands/seafaring-check/+merge/263192

Now according to suggestion #1449420 seafaring tag is calculated automatically (tag is set only when map has at least 2 port spaces) and I have question: I was trying to remove seafaring checkbox but I couldn't find it in code, it exists?  
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~majcherlk/widelands/seafaring-check into lp:widelands.
=== modified file 'src/editor/ui_menus/editor_main_menu_save_map.cc'
--- src/editor/ui_menus/editor_main_menu_save_map.cc	2015-01-27 20:43:52 +0000
+++ src/editor/ui_menus/editor_main_menu_save_map.cc	2015-06-28 02:32:24 +0000
@@ -188,6 +188,13 @@
 				  filename.substr(0, filename_size - 4) : filename)
 				 .c_str());
 		}
+
+		// set seafaring tag only if map has at least two port spaces
+		if (map.get_port_spaces().size() >= 2)
+			map.add_tag("seafaring");
+		else
+			map.remove_tag("seafaring");
+
 		if
 			(save_map
 			 	(filename,

=== modified file 'src/logic/map.cc'
--- src/logic/map.cc	2015-02-24 13:51:38 +0000
+++ src/logic/map.cc	2015-06-28 02:32:24 +0000
@@ -580,6 +580,10 @@
 	m_tags.insert(tag);
 }
 
+void Map::remove_tag(const std::string& tag) {
+	m_tags.erase(tag);
+}
+
 NodeCaps Map::get_max_nodecaps(const World& world, FCoords & fc) {
 	NodeCaps caps = _calc_nodecaps_pass1(world, fc, false);
 	caps = _calc_nodecaps_pass2(world, fc, false, caps);

=== modified file 'src/logic/map.h'
--- src/logic/map.h	2015-06-10 06:46:40 +0000
+++ src/logic/map.h	2015-06-28 02:32:24 +0000
@@ -200,6 +200,7 @@
 	void set_hint       (const std::string& hint);
 	void set_background (const std::string& image_path);
 	void add_tag        (const std::string& tag);
+	void remove_tag     (const std::string& tag);
 	void set_scenario_types(ScenarioTypes t) {m_scenario_types = t;}
 
 	// Allows access to the filesystem of the map to access auxiliary files.


Follow ups