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

Proposed by Angelo Locritani
Status: Merged
Merged at revision: 6364
Proposed branch: lp:~alocritani/widelands/resource_amounts_in_debug_window
Merge into: lp:widelands
Diff against target: 23 lines (+14/-0)
1 file modified
src/wui/game_debug_ui.cc (+14/-0)
To merge this branch: bzr merge lp:~alocritani/widelands/resource_amounts_in_debug_window
Reviewer Review Type Date Requested Status
Widelands Developers Pending
Review via email: mp+100237@code.launchpad.net

Description of the change

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)

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
365 str += buffer;365 str += buffer;
366 }366 }
367 }367 }
368 {
369 Widelands::Resource_Index ridx = m_coords.field->get_resources();
370 int ramount = m_coords.field->get_resources_amount();
371 int startingAmount = m_coords.field->get_starting_res_amount();
372 snprintf
373 (buffer, sizeof(buffer), _("Resource name: %s\n"),
374 m_map.get_world()->get_resource(ridx)->name().c_str());
375
376 str += buffer;
377
378 snprintf
379 (buffer, sizeof(buffer), _("Resource amount: %i/%i\n"), ramount, startingAmount);
380 str += buffer;
381 }
368382
369 m_ui_field.set_text(str.c_str());383 m_ui_field.set_text(str.c_str());
370384

Subscribers

People subscribed via source and target branches

to status/vote changes: