← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~alocritani/widelands/resource_info_in_editor into lp:widelands

 

Angelo Locritani has proposed merging lp:~alocritani/widelands/resource_info_in_editor into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~alocritani/widelands/resource_info_in_editor/+merge/98150

"resource amount" line only visible if there's a resource
sorry for asking 2 merges so close
-- 
https://code.launchpad.net/~alocritani/widelands/resource_info_in_editor/+merge/98150
Your team Widelands Developers is requested to review the proposed merge of lp:~alocritani/widelands/resource_info_in_editor into lp:widelands.
=== modified file 'src/editor/tools/editor_info_tool.cc'
--- src/editor/tools/editor_info_tool.cc	2012-03-18 20:21:02 +0000
+++ src/editor/tools/editor_info_tool.cc	2012-03-19 06:07:23 +0000
@@ -92,23 +92,24 @@
 	buf += _("3) Resources Info\n");
 	{
 		Widelands::Resource_Index ridx = f.get_resources();
-		int ramount = f.get_resources_amount();		
-
-		if (ramount > 0){
-			snprintf
-			(buf1, sizeof(buf1), _("Resource name: %s\n"), world.get_resource(ridx)->name().c_str());
+		int ramount = f.get_resources_amount();
+
+		if (ramount > 0) {
+			snprintf
+			(buf1, sizeof(buf1), _(" Resource name: %s\n"), world.get_resource(ridx)->name().c_str());
+			buf += buf1;
+
+			snprintf
+			(buf1, sizeof(buf1), _(" Resource amount: %i\n"), ramount);
+			buf += buf1;
 		}
 		else
 		{
 			snprintf
-			(buf1, sizeof(buf1), _("Resource name: %s\n"), _("<none>"));
+			(buf1, sizeof(buf1), _(" Resource name: %s\n"), _("none"));
+			buf += buf1;
 		}
 
-		buf += buf1;
-
-		snprintf
-		(buf1, sizeof(buf1), _("Resource amount: %i\n"), ramount);
-		buf += buf1;
 	}
 
 	buf += _("4) Map Info\n Name: ");


Follow ups