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

Proposed by Angelo Locritani
Status: Merged
Merged at revision: 6323
Proposed branch: lp:~alocritani/widelands/resource_info_in_editor
Merge into: lp:widelands
Diff against target: 32 lines (+22/-0)
1 file modified
src/editor/tools/editor_info_tool.cc (+22/-0)
To merge this branch: bzr merge lp:~alocritani/widelands/resource_info_in_editor
Reviewer Review Type Date Requested Status
Widelands Developers Pending
Review via email: mp+98110@code.launchpad.net

Description of the change

Added to info tool information regarding resource name and amount

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/editor/tools/editor_info_tool.cc'
2--- src/editor/tools/editor_info_tool.cc 2012-02-21 13:52:14 +0000
3+++ src/editor/tools/editor_info_tool.cc 2012-03-18 20:34:23 +0000
4@@ -89,6 +89,28 @@
5 buf += buf1;
6 }
7
8+ buf += _("3) Resources Info\n");
9+ {
10+ Widelands::Resource_Index ridx = f.get_resources();
11+ int ramount = f.get_resources_amount();
12+
13+ if (ramount > 0){
14+ snprintf
15+ (buf1, sizeof(buf1), _("Resource name: %s\n"), world.get_resource(ridx)->name().c_str());
16+ }
17+ else
18+ {
19+ snprintf
20+ (buf1, sizeof(buf1), _("Resource name: %s\n"), _("<none>"));
21+ }
22+
23+ buf += buf1;
24+
25+ snprintf
26+ (buf1, sizeof(buf1), _("Resource amount: %i\n"), ramount);
27+ buf += buf1;
28+ }
29+
30 buf += _("4) Map Info\n Name: ");
31 buf += map.get_name();
32 snprintf

Subscribers

People subscribed via source and target branches

to status/vote changes: