← Back to team overview

widelands-dev team mailing list archive

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

 

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

Requested reviews:
  Widelands Developers (widelands-dev)

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

Inspired by topic about fish breeders (http://wl.widelands.org/forum/topic/1018/?page=1) I just added resource name and amount to field debug window.
Sadly, when no resource is there the resource is marked as coal.
It only happens on mountains with no resources - all other fields should have a default resource (water or fishes)
-- 
https://code.launchpad.net/~alocritani/widelands/resource_amounts_in_debug_window/+merge/100237
Your team Widelands Developers is requested to review the proposed merge of lp:~alocritani/widelands/resource_amounts_in_debug_window into lp:widelands.
=== modified file 'src/wui/game_debug_ui.cc'
--- src/wui/game_debug_ui.cc	2012-02-15 21:25:34 +0000
+++ src/wui/game_debug_ui.cc	2012-03-30 21:12:21 +0000
@@ -365,6 +365,20 @@
 			str +=  buffer;
 		}
 	}
+	{
+		Widelands::Resource_Index ridx = m_coords.field->get_resources();
+		int ramount = m_coords.field->get_resources_amount();
+		int startingAmount = m_coords.field->get_starting_res_amount();
+		snprintf
+		(buffer, sizeof(buffer), _("Resource name: %s\n"),
+			m_map.get_world()->get_resource(ridx)->name().c_str());
+
+		str += buffer;
+
+		snprintf
+		(buffer, sizeof(buffer), _("Resource amount: %i/%i\n"), ramount, startingAmount);
+		str += buffer;
+	}
 
 	m_ui_field.set_text(str.c_str());
 


Follow ups