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
1=== modified file 'src/wui/game_debug_ui.cc'
2--- src/wui/game_debug_ui.cc 2012-02-15 21:25:34 +0000
3+++ src/wui/game_debug_ui.cc 2012-03-30 21:12:21 +0000
4@@ -365,6 +365,20 @@
5 str += buffer;
6 }
7 }
8+ {
9+ Widelands::Resource_Index ridx = m_coords.field->get_resources();
10+ int ramount = m_coords.field->get_resources_amount();
11+ int startingAmount = m_coords.field->get_starting_res_amount();
12+ snprintf
13+ (buffer, sizeof(buffer), _("Resource name: %s\n"),
14+ m_map.get_world()->get_resource(ridx)->name().c_str());
15+
16+ str += buffer;
17+
18+ snprintf
19+ (buffer, sizeof(buffer), _("Resource amount: %i/%i\n"), ramount, startingAmount);
20+ str += buffer;
21+ }
22
23 m_ui_field.set_text(str.c_str());
24

Subscribers

People subscribed via source and target branches

to status/vote changes: