Merge lp:~widelands-dev/widelands/bug-1395278-editor into lp:widelands
- bug-1395278-editor
- Merge into trunk
Proposed by
GunChleoc
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 7900 | ||||
Proposed branch: | lp:~widelands-dev/widelands/bug-1395278-editor | ||||
Merge into: | lp:widelands | ||||
Diff against target: |
2595 lines (+528/-528) 42 files modified
src/editor/tools/editor_action_args.h (+10/-10) src/editor/tools/editor_decrease_height_tool.cc (+4/-4) src/editor/tools/editor_decrease_height_tool.h (+4/-4) src/editor/tools/editor_decrease_resources_tool.cc (+6/-6) src/editor/tools/editor_decrease_resources_tool.h (+7/-7) src/editor/tools/editor_delete_bob_tool.cc (+3/-3) src/editor/tools/editor_delete_immovable_tool.cc (+2/-2) src/editor/tools/editor_history.cc (+40/-40) src/editor/tools/editor_history.h (+8/-8) src/editor/tools/editor_increase_height_tool.cc (+4/-4) src/editor/tools/editor_increase_height_tool.h (+9/-9) src/editor/tools/editor_increase_resources_tool.cc (+9/-9) src/editor/tools/editor_increase_resources_tool.h (+14/-14) src/editor/tools/editor_make_infrastructure_tool.cc (+1/-1) src/editor/tools/editor_make_infrastructure_tool.h (+5/-5) src/editor/tools/editor_noise_height_tool.cc (+6/-6) src/editor/tools/editor_noise_height_tool.h (+7/-7) src/editor/tools/editor_place_bob_tool.cc (+7/-7) src/editor/tools/editor_place_immovable_tool.cc (+7/-7) src/editor/tools/editor_set_height_tool.cc (+5/-5) src/editor/tools/editor_set_height_tool.h (+4/-4) src/editor/tools/editor_set_resources_tool.cc (+10/-10) src/editor/tools/editor_set_resources_tool.h (+7/-7) src/editor/tools/editor_set_starting_pos_tool.cc (+15/-15) src/editor/tools/editor_set_starting_pos_tool.h (+3/-3) src/editor/tools/editor_set_terrain_tool.cc (+7/-7) src/editor/tools/editor_tool.h (+8/-8) src/editor/tools/multi_select.h (+13/-13) src/editor/ui_menus/editor_player_menu.cc (+50/-50) src/editor/ui_menus/editor_player_menu.h (+11/-12) src/editor/ui_menus/editor_tool_change_height_options_menu.cc (+54/-54) src/editor/ui_menus/editor_tool_change_height_options_menu.h (+7/-7) src/editor/ui_menus/editor_tool_change_resources_options_menu.cc (+63/-63) src/editor/ui_menus/editor_tool_change_resources_options_menu.h (+9/-9) src/editor/ui_menus/editor_tool_noise_height_options_menu.cc (+65/-65) src/editor/ui_menus/editor_tool_noise_height_options_menu.h (+5/-5) src/editor/ui_menus/editor_tool_options_menu.cc (+2/-2) src/editor/ui_menus/editor_tool_options_menu.h (+2/-2) src/editor/ui_menus/editor_tool_place_bob_options_menu.cc (+18/-18) src/editor/ui_menus/editor_tool_place_bob_options_menu.h (+5/-4) src/editor/ui_menus/editor_toolsize_menu.cc (+10/-10) src/editor/ui_menus/editor_toolsize_menu.h (+2/-2) |
||||
To merge this branch: | bzr merge lp:~widelands-dev/widelands/bug-1395278-editor | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Klaus Halfmann | Approve | ||
Review via email: mp+289494@code.launchpad.net |
Commit message
Refactored member variable names in src/editor.
Description of the change
Almost there...
To post a comment you must log in.
Revision history for this message
GunChleoc (gunchleoc) wrote : | # |
I think we should go through all the clang warnings on Travis sometime and fix.
Added replies to your comments.
Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote : | # |
Played this for a while now, found no anomalies.
Revision history for this message
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 855. State: passed. Details: https:/
Appveyor build 690. State: failed. Details: https:/
Revision history for this message
GunChleoc (gunchleoc) wrote : | # |
Thanks!
@bunnybot merge
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/editor/tools/editor_action_args.h' | |||
2 | --- src/editor/tools/editor_action_args.h 2016-03-16 21:37:47 +0000 | |||
3 | +++ src/editor/tools/editor_action_args.h 2016-03-18 12:52:47 +0000 | |||
4 | @@ -48,9 +48,9 @@ | |||
5 | 48 | 48 | ||
6 | 49 | uint32_t sel_radius; | 49 | uint32_t sel_radius; |
7 | 50 | 50 | ||
11 | 51 | int32_t change_by; // resources, hight change tools | 51 | int32_t change_by; // resources, change height tools |
12 | 52 | std::list<Widelands::Field::Height> origHights; // change hight tool | 52 | std::list<Widelands::Field::Height> original_heights; // change height tool |
13 | 53 | uint8_t cur_res, set_to; // resources change tools | 53 | uint8_t current_resource, set_to; // resources change tools |
14 | 54 | 54 | ||
15 | 55 | struct ResourceState { | 55 | struct ResourceState { |
16 | 56 | Widelands::FCoords location; | 56 | Widelands::FCoords location; |
17 | @@ -58,14 +58,14 @@ | |||
18 | 58 | uint8_t amount; | 58 | uint8_t amount; |
19 | 59 | }; | 59 | }; |
20 | 60 | 60 | ||
27 | 61 | std::list<ResourceState> orgRes; // resources set tool | 61 | std::list<ResourceState> original_resource; // resources set tool |
28 | 62 | std::list<const Widelands::BobDescr *> obob_type, nbob_type; // bob change tools | 62 | std::list<const Widelands::BobDescr *> old_bob_type, new_bob_type; // bob change tools |
29 | 63 | std::list<std::string> oimmov_types; // immovable change tools | 63 | std::list<std::string> old_immovable_types; // immovable change tools |
30 | 64 | std::list<int32_t> nimmov_types; // immovable change tools | 64 | std::list<int32_t> new_immovable_types; // immovable change tools |
31 | 65 | Widelands::HeightInterval m_interval; // noise hight tool | 65 | Widelands::HeightInterval interval; // noise height tool |
32 | 66 | std::list<Widelands::DescriptionIndex> terrainType, origTerrainType; // set terrain tool | 66 | std::list<Widelands::DescriptionIndex> terrain_type, original_terrain_type; // set terrain tool |
33 | 67 | 67 | ||
35 | 68 | std::list<EditorToolAction *> draw_actions; // draw tool | 68 | std::list<EditorToolAction *> draw_actions; // draw tool |
36 | 69 | 69 | ||
37 | 70 | uint32_t refcount; | 70 | uint32_t refcount; |
38 | 71 | }; | 71 | }; |
39 | 72 | 72 | ||
40 | === modified file 'src/editor/tools/editor_decrease_height_tool.cc' | |||
41 | --- src/editor/tools/editor_decrease_height_tool.cc 2016-01-04 20:50:19 +0000 | |||
42 | +++ src/editor/tools/editor_decrease_height_tool.cc 2016-03-18 12:52:47 +0000 | |||
43 | @@ -32,12 +32,12 @@ | |||
44 | 32 | EditorInteractive& /* parent */, | 32 | EditorInteractive& /* parent */, |
45 | 33 | EditorActionArgs* args, | 33 | EditorActionArgs* args, |
46 | 34 | Widelands::Map* map) { | 34 | Widelands::Map* map) { |
48 | 35 | if (args->origHights.empty()) { | 35 | if (args->original_heights.empty()) { |
49 | 36 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr | 36 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr |
50 | 37 | (*map, | 37 | (*map, |
51 | 38 | Widelands::Area<Widelands::FCoords> | 38 | Widelands::Area<Widelands::FCoords> |
52 | 39 | (map->get_fcoords(center.node), args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); | 39 | (map->get_fcoords(center.node), args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); |
54 | 40 | do args->origHights.push_back(mr.location().field->get_height()); | 40 | do args->original_heights.push_back(mr.location().field->get_height()); |
55 | 41 | while (mr.advance(*map)); | 41 | while (mr.advance(*map)); |
56 | 42 | } | 42 | } |
57 | 43 | 43 | ||
58 | @@ -58,7 +58,7 @@ | |||
59 | 58 | (*map, | 58 | (*map, |
60 | 59 | Widelands::Area<Widelands::FCoords> | 59 | Widelands::Area<Widelands::FCoords> |
61 | 60 | (map->get_fcoords(center.node), args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); | 60 | (map->get_fcoords(center.node), args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); |
63 | 61 | std::list<Widelands::Field::Height>::iterator i = args->origHights.begin(); | 61 | std::list<Widelands::Field::Height>::iterator i = args->original_heights.begin(); |
64 | 62 | 62 | ||
65 | 63 | do { | 63 | do { |
66 | 64 | mr.location().field->set_height(*i); ++i; | 64 | mr.location().field->set_height(*i); ++i; |
67 | @@ -75,6 +75,6 @@ | |||
68 | 75 | EditorActionArgs EditorDecreaseHeightTool::format_args_impl(EditorInteractive & parent) | 75 | EditorActionArgs EditorDecreaseHeightTool::format_args_impl(EditorInteractive & parent) |
69 | 76 | { | 76 | { |
70 | 77 | EditorActionArgs a(parent); | 77 | EditorActionArgs a(parent); |
72 | 78 | a.change_by = m_change_by; | 78 | a.change_by = change_by_; |
73 | 79 | return a; | 79 | return a; |
74 | 80 | } | 80 | } |
75 | 81 | 81 | ||
76 | === modified file 'src/editor/tools/editor_decrease_height_tool.h' | |||
77 | --- src/editor/tools/editor_decrease_height_tool.h 2016-01-28 05:24:34 +0000 | |||
78 | +++ src/editor/tools/editor_decrease_height_tool.h 2016-03-18 12:52:47 +0000 | |||
79 | @@ -24,7 +24,7 @@ | |||
80 | 24 | 24 | ||
81 | 25 | /// Decreases the height of a node by a value. | 25 | /// Decreases the height of a node by a value. |
82 | 26 | struct EditorDecreaseHeightTool : public EditorTool { | 26 | struct EditorDecreaseHeightTool : public EditorTool { |
84 | 27 | EditorDecreaseHeightTool() : EditorTool(*this, *this), m_change_by(1) {} | 27 | EditorDecreaseHeightTool() : EditorTool(*this, *this), change_by_(1) {} |
85 | 28 | 28 | ||
86 | 29 | int32_t handle_click_impl | 29 | int32_t handle_click_impl |
87 | 30 | (const Widelands::World& world, | 30 | (const Widelands::World& world, |
88 | @@ -46,11 +46,11 @@ | |||
89 | 46 | return "images/wui/editor//fsel_editor_decrease_height.png"; | 46 | return "images/wui/editor//fsel_editor_decrease_height.png"; |
90 | 47 | } | 47 | } |
91 | 48 | 48 | ||
94 | 49 | int32_t get_change_by() const {return m_change_by;} | 49 | int32_t get_change_by() const {return change_by_;} |
95 | 50 | void set_change_by(const int32_t n) {m_change_by = n;} | 50 | void set_change_by(const int32_t n) {change_by_ = n;} |
96 | 51 | 51 | ||
97 | 52 | private: | 52 | private: |
99 | 53 | int32_t m_change_by; | 53 | int32_t change_by_; |
100 | 54 | }; | 54 | }; |
101 | 55 | 55 | ||
102 | 56 | #endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_DECREASE_HEIGHT_TOOL_H | 56 | #endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_DECREASE_HEIGHT_TOOL_H |
103 | 57 | 57 | ||
104 | === modified file 'src/editor/tools/editor_decrease_resources_tool.cc' | |||
105 | --- src/editor/tools/editor_decrease_resources_tool.cc 2016-03-17 12:14:57 +0000 | |||
106 | +++ src/editor/tools/editor_decrease_resources_tool.cc 2016-03-18 12:52:47 +0000 | |||
107 | @@ -50,17 +50,17 @@ | |||
108 | 50 | if (amount < 0) | 50 | if (amount < 0) |
109 | 51 | amount = 0; | 51 | amount = 0; |
110 | 52 | 52 | ||
113 | 53 | if (mr.location().field->get_resources() == args->cur_res && | 53 | if (mr.location().field->get_resources() == args->current_resource && |
114 | 54 | map->is_resource_valid(world, mr.location(), args->cur_res) && | 54 | map->is_resource_valid(world, mr.location(), args->current_resource) && |
115 | 55 | mr.location().field->get_resources_amount() != 0) { | 55 | mr.location().field->get_resources_amount() != 0) { |
116 | 56 | 56 | ||
118 | 57 | args->orgRes.push_back(EditorActionArgs::ResourceState{ | 57 | args->original_resource.push_back(EditorActionArgs::ResourceState{ |
119 | 58 | mr.location(), | 58 | mr.location(), |
120 | 59 | mr.location().field->get_resources(), | 59 | mr.location().field->get_resources(), |
121 | 60 | mr.location().field->get_resources_amount() | 60 | mr.location().field->get_resources_amount() |
122 | 61 | }); | 61 | }); |
123 | 62 | 62 | ||
125 | 63 | map->initialize_resources(mr.location(), args->cur_res, amount); | 63 | map->initialize_resources(mr.location(), args->current_resource, amount); |
126 | 64 | } | 64 | } |
127 | 65 | 65 | ||
128 | 66 | } while (mr.advance(*map)); | 66 | } while (mr.advance(*map)); |
129 | @@ -78,7 +78,7 @@ | |||
130 | 78 | EditorActionArgs EditorDecreaseResourcesTool::format_args_impl(EditorInteractive & parent) | 78 | EditorActionArgs EditorDecreaseResourcesTool::format_args_impl(EditorInteractive & parent) |
131 | 79 | { | 79 | { |
132 | 80 | EditorActionArgs a(parent); | 80 | EditorActionArgs a(parent); |
135 | 81 | a.change_by = m_change_by; | 81 | a.change_by = change_by_; |
136 | 82 | a.cur_res = m_cur_res; | 82 | a.current_resource = cur_res_; |
137 | 83 | return a; | 83 | return a; |
138 | 84 | } | 84 | } |
139 | 85 | 85 | ||
140 | === modified file 'src/editor/tools/editor_decrease_resources_tool.h' | |||
141 | --- src/editor/tools/editor_decrease_resources_tool.h 2016-01-28 05:24:34 +0000 | |||
142 | +++ src/editor/tools/editor_decrease_resources_tool.h 2016-03-18 12:52:47 +0000 | |||
143 | @@ -25,7 +25,7 @@ | |||
144 | 25 | /// Decreases the resources of a node by a value. | 25 | /// Decreases the resources of a node by a value. |
145 | 26 | struct EditorDecreaseResourcesTool : public EditorTool { | 26 | struct EditorDecreaseResourcesTool : public EditorTool { |
146 | 27 | EditorDecreaseResourcesTool() | 27 | EditorDecreaseResourcesTool() |
148 | 28 | : EditorTool(*this, *this), m_cur_res(0), m_change_by(1) | 28 | : EditorTool(*this, *this), cur_res_(0), change_by_(1) |
149 | 29 | {} | 29 | {} |
150 | 30 | 30 | ||
151 | 31 | int32_t handle_click_impl(const Widelands::World& world, | 31 | int32_t handle_click_impl(const Widelands::World& world, |
152 | @@ -46,16 +46,16 @@ | |||
153 | 46 | return "images/wui/editor/fsel_editor_decrease_resources.png"; | 46 | return "images/wui/editor/fsel_editor_decrease_resources.png"; |
154 | 47 | } | 47 | } |
155 | 48 | 48 | ||
159 | 49 | int32_t get_change_by() const {return m_change_by;} | 49 | int32_t get_change_by() const {return change_by_;} |
160 | 50 | void set_change_by(const int32_t n) {m_change_by = n;} | 50 | void set_change_by(const int32_t n) {change_by_ = n;} |
161 | 51 | Widelands::DescriptionIndex get_cur_res() const {return m_cur_res;} | 51 | Widelands::DescriptionIndex get_cur_res() const {return cur_res_;} |
162 | 52 | void set_cur_res(Widelands::DescriptionIndex const res) { | 52 | void set_cur_res(Widelands::DescriptionIndex const res) { |
164 | 53 | m_cur_res = res; | 53 | cur_res_ = res; |
165 | 54 | } | 54 | } |
166 | 55 | 55 | ||
167 | 56 | private: | 56 | private: |
170 | 57 | Widelands::DescriptionIndex m_cur_res; | 57 | Widelands::DescriptionIndex cur_res_; |
171 | 58 | int32_t m_change_by; | 58 | int32_t change_by_; |
172 | 59 | }; | 59 | }; |
173 | 60 | 60 | ||
174 | 61 | #endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_DECREASE_RESOURCES_TOOL_H | 61 | #endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_DECREASE_RESOURCES_TOOL_H |
175 | 62 | 62 | ||
176 | === modified file 'src/editor/tools/editor_delete_bob_tool.cc' | |||
177 | --- src/editor/tools/editor_delete_bob_tool.cc 2016-01-16 12:55:14 +0000 | |||
178 | +++ src/editor/tools/editor_delete_bob_tool.cc 2016-03-18 12:52:47 +0000 | |||
179 | @@ -41,10 +41,10 @@ | |||
180 | 41 | (map->get_fcoords(center.node), radius)); | 41 | (map->get_fcoords(center.node), radius)); |
181 | 42 | 42 | ||
182 | 43 | do if (Widelands::Bob * const bob = mr.location().field->get_first_bob()) { | 43 | do if (Widelands::Bob * const bob = mr.location().field->get_first_bob()) { |
184 | 44 | args->obob_type.push_back(&bob->descr()); | 44 | args->old_bob_type.push_back(&bob->descr()); |
185 | 45 | bob->remove(egbase); | 45 | bob->remove(egbase); |
186 | 46 | } else { | 46 | } else { |
188 | 47 | args->obob_type.push_back(nullptr); | 47 | args->old_bob_type.push_back(nullptr); |
189 | 48 | } | 48 | } |
190 | 49 | while (mr.advance(*map)); | 49 | while (mr.advance(*map)); |
191 | 50 | return radius + 2; | 50 | return radius + 2; |
192 | @@ -58,7 +58,7 @@ | |||
193 | 58 | Widelands::Map* map) { | 58 | Widelands::Map* map) { |
194 | 59 | 59 | ||
195 | 60 | uint32_t ret = parent.tools()->place_bob.handle_undo_impl(world, center, parent, args, map); | 60 | uint32_t ret = parent.tools()->place_bob.handle_undo_impl(world, center, parent, args, map); |
197 | 61 | args->obob_type.clear(); | 61 | args->old_bob_type.clear(); |
198 | 62 | return ret; | 62 | return ret; |
199 | 63 | } | 63 | } |
200 | 64 | 64 | ||
201 | 65 | 65 | ||
202 | === modified file 'src/editor/tools/editor_delete_immovable_tool.cc' | |||
203 | --- src/editor/tools/editor_delete_immovable_tool.cc 2016-01-16 12:55:14 +0000 | |||
204 | +++ src/editor/tools/editor_delete_immovable_tool.cc 2016-03-18 12:52:47 +0000 | |||
205 | @@ -44,10 +44,10 @@ | |||
206 | 44 | immovable, | 44 | immovable, |
207 | 45 | mr.location().field->get_immovable())) | 45 | mr.location().field->get_immovable())) |
208 | 46 | { | 46 | { |
210 | 47 | args->oimmov_types.push_back(immovable->descr().name()); | 47 | args->old_immovable_types.push_back(immovable->descr().name()); |
211 | 48 | immovable->remove(egbase); // Delete no buildings or stuff. | 48 | immovable->remove(egbase); // Delete no buildings or stuff. |
212 | 49 | } else { | 49 | } else { |
214 | 50 | args->oimmov_types.push_back(""); | 50 | args->old_immovable_types.push_back(""); |
215 | 51 | } | 51 | } |
216 | 52 | while (mr.advance(*map)); | 52 | while (mr.advance(*map)); |
217 | 53 | return mr.radius() + 2; | 53 | return mr.radius() + 2; |
218 | 54 | 54 | ||
219 | === modified file 'src/editor/tools/editor_history.cc' | |||
220 | --- src/editor/tools/editor_history.cc 2016-03-16 21:37:47 +0000 | |||
221 | +++ src/editor/tools/editor_history.cc 2016-03-18 12:52:47 +0000 | |||
222 | @@ -30,9 +30,9 @@ | |||
223 | 30 | EditorActionArgs::EditorActionArgs(EditorInteractive & base): | 30 | EditorActionArgs::EditorActionArgs(EditorInteractive & base): |
224 | 31 | sel_radius(base.get_sel_radius()), | 31 | sel_radius(base.get_sel_radius()), |
225 | 32 | change_by(0), | 32 | change_by(0), |
227 | 33 | cur_res(0), | 33 | current_resource(0), |
228 | 34 | set_to(0), | 34 | set_to(0), |
230 | 35 | m_interval(0, 0), | 35 | interval(0, 0), |
231 | 36 | refcount(0) | 36 | refcount(0) |
232 | 37 | {} | 37 | {} |
233 | 38 | 38 | ||
234 | @@ -42,28 +42,28 @@ | |||
235 | 42 | delete draw_actions.back(); | 42 | delete draw_actions.back(); |
236 | 43 | draw_actions.pop_back(); | 43 | draw_actions.pop_back(); |
237 | 44 | } | 44 | } |
246 | 45 | nbob_type.clear(); | 45 | new_bob_type.clear(); |
247 | 46 | obob_type.clear(); | 46 | old_bob_type.clear(); |
248 | 47 | nimmov_types.clear(); | 47 | new_immovable_types.clear(); |
249 | 48 | oimmov_types.clear(); | 48 | old_immovable_types.clear(); |
250 | 49 | orgRes.clear(); | 49 | original_resource.clear(); |
251 | 50 | origHights.clear(); | 50 | original_heights.clear(); |
252 | 51 | origTerrainType.clear(); | 51 | original_terrain_type.clear(); |
253 | 52 | terrainType.clear(); | 52 | terrain_type.clear(); |
254 | 53 | } | 53 | } |
255 | 54 | 54 | ||
256 | 55 | // === EditorHistory === // | 55 | // === EditorHistory === // |
257 | 56 | 56 | ||
258 | 57 | uint32_t EditorHistory::undo_action(const Widelands::World& world) { | 57 | uint32_t EditorHistory::undo_action(const Widelands::World& world) { |
260 | 58 | if (undo_stack.empty()) | 58 | if (undo_stack_.empty()) |
261 | 59 | return 0; | 59 | return 0; |
262 | 60 | 60 | ||
266 | 61 | EditorToolAction uac = undo_stack.front(); | 61 | EditorToolAction uac = undo_stack_.front(); |
267 | 62 | undo_stack.pop_front(); | 62 | undo_stack_.pop_front(); |
268 | 63 | redo_stack.push_front(uac); | 63 | redo_stack_.push_front(uac); |
269 | 64 | 64 | ||
272 | 65 | m_undo_button.set_enabled(!undo_stack.empty()); | 65 | undo_button_.set_enabled(!undo_stack_.empty()); |
273 | 66 | m_redo_button.set_enabled(true); | 66 | redo_button_.set_enabled(true); |
274 | 67 | 67 | ||
275 | 68 | return uac.tool.handle_undo(static_cast<EditorTool::ToolIndex>(uac.i), | 68 | return uac.tool.handle_undo(static_cast<EditorTool::ToolIndex>(uac.i), |
276 | 69 | world, | 69 | world, |
277 | @@ -74,15 +74,15 @@ | |||
278 | 74 | } | 74 | } |
279 | 75 | 75 | ||
280 | 76 | uint32_t EditorHistory::redo_action(const Widelands::World& world) { | 76 | uint32_t EditorHistory::redo_action(const Widelands::World& world) { |
282 | 77 | if (redo_stack.empty()) | 77 | if (redo_stack_.empty()) |
283 | 78 | return 0; | 78 | return 0; |
284 | 79 | 79 | ||
288 | 80 | EditorToolAction rac = redo_stack.front(); | 80 | EditorToolAction rac = redo_stack_.front(); |
289 | 81 | redo_stack.pop_front(); | 81 | redo_stack_.pop_front(); |
290 | 82 | undo_stack.push_front(rac); | 82 | undo_stack_.push_front(rac); |
291 | 83 | 83 | ||
294 | 84 | m_undo_button.set_enabled(true); | 84 | undo_button_.set_enabled(true); |
295 | 85 | m_redo_button.set_enabled(!redo_stack.empty()); | 85 | redo_button_.set_enabled(!redo_stack_.empty()); |
296 | 86 | 86 | ||
297 | 87 | return rac.tool.handle_click(static_cast<EditorTool::ToolIndex>(rac.i), | 87 | return rac.tool.handle_click(static_cast<EditorTool::ToolIndex>(rac.i), |
298 | 88 | world, | 88 | world, |
299 | @@ -102,33 +102,33 @@ | |||
300 | 102 | EditorToolAction ac | 102 | EditorToolAction ac |
301 | 103 | (tool, static_cast<uint32_t>(ind), | 103 | (tool, static_cast<uint32_t>(ind), |
302 | 104 | map, center, parent, tool.format_args(ind, parent)); | 104 | map, center, parent, tool.format_args(ind, parent)); |
304 | 105 | if (draw && tool.is_unduable()) { | 105 | if (draw && tool.is_undoable()) { |
305 | 106 | if | 106 | if |
308 | 107 | (undo_stack.empty() || | 107 | (undo_stack_.empty() || |
309 | 108 | undo_stack.front().tool.get_sel_impl() != std::string(m_draw_tool.get_sel_impl())) | 108 | undo_stack_.front().tool.get_sel_impl() != std::string(draw_tool_.get_sel_impl())) |
310 | 109 | { | 109 | { |
311 | 110 | EditorToolAction da | 110 | EditorToolAction da |
313 | 111 | (m_draw_tool, EditorTool::First, | 111 | (draw_tool_, EditorTool::First, |
314 | 112 | map, center, parent, | 112 | map, center, parent, |
316 | 113 | m_draw_tool.format_args(EditorTool::First, parent)); | 113 | draw_tool_.format_args(EditorTool::First, parent)); |
317 | 114 | 114 | ||
321 | 115 | if (!undo_stack.empty()) { | 115 | if (!undo_stack_.empty()) { |
322 | 116 | m_draw_tool.add_action(undo_stack.front(), *da.args); | 116 | draw_tool_.add_action(undo_stack_.front(), *da.args); |
323 | 117 | undo_stack.pop_front(); | 117 | undo_stack_.pop_front(); |
324 | 118 | } | 118 | } |
325 | 119 | 119 | ||
330 | 120 | redo_stack.clear(); | 120 | redo_stack_.clear(); |
331 | 121 | undo_stack.push_front(da); | 121 | undo_stack_.push_front(da); |
332 | 122 | m_undo_button.set_enabled(true); | 122 | undo_button_.set_enabled(true); |
333 | 123 | m_redo_button.set_enabled(false); | 123 | redo_button_.set_enabled(false); |
334 | 124 | } | 124 | } |
335 | 125 | dynamic_cast<EditorDrawTool *> | 125 | dynamic_cast<EditorDrawTool *> |
342 | 126 | (&(undo_stack.front().tool))->add_action(ac, *undo_stack.front().args); | 126 | (&(undo_stack_.front().tool))->add_action(ac, *undo_stack_.front().args); |
343 | 127 | } else if (tool.is_unduable()) { | 127 | } else if (tool.is_undoable()) { |
344 | 128 | redo_stack.clear(); | 128 | redo_stack_.clear(); |
345 | 129 | undo_stack.push_front(ac); | 129 | undo_stack_.push_front(ac); |
346 | 130 | m_undo_button.set_enabled(true); | 130 | undo_button_.set_enabled(true); |
347 | 131 | m_redo_button.set_enabled(false); | 131 | redo_button_.set_enabled(false); |
348 | 132 | } | 132 | } |
349 | 133 | return tool.handle_click(ind, world, center, parent, ac.args, &map); | 133 | return tool.handle_click(ind, world, center, parent, ac.args, &map); |
350 | 134 | } | 134 | } |
351 | 135 | 135 | ||
352 | === modified file 'src/editor/tools/editor_history.h' | |||
353 | --- src/editor/tools/editor_history.h 2016-01-16 12:55:14 +0000 | |||
354 | +++ src/editor/tools/editor_history.h 2016-03-18 12:52:47 +0000 | |||
355 | @@ -35,7 +35,7 @@ | |||
356 | 35 | */ | 35 | */ |
357 | 36 | struct EditorHistory { | 36 | struct EditorHistory { |
358 | 37 | EditorHistory(UI::Button & undo, UI::Button & redo): | 37 | EditorHistory(UI::Button & undo, UI::Button & redo): |
360 | 38 | m_undo_button(undo), m_redo_button(redo) {} | 38 | undo_button_(undo), redo_button_(redo) {} |
361 | 39 | 39 | ||
362 | 40 | uint32_t do_action(EditorTool& tool, | 40 | uint32_t do_action(EditorTool& tool, |
363 | 41 | EditorTool::ToolIndex ind, | 41 | EditorTool::ToolIndex ind, |
364 | @@ -48,13 +48,13 @@ | |||
365 | 48 | uint32_t redo_action(const Widelands::World& world); | 48 | uint32_t redo_action(const Widelands::World& world); |
366 | 49 | 49 | ||
367 | 50 | private: | 50 | private: |
375 | 51 | UI::Button & m_undo_button; | 51 | UI::Button & undo_button_; |
376 | 52 | UI::Button & m_redo_button; | 52 | UI::Button & redo_button_; |
377 | 53 | 53 | ||
378 | 54 | EditorDrawTool m_draw_tool; | 54 | EditorDrawTool draw_tool_; |
379 | 55 | 55 | ||
380 | 56 | std::deque<EditorToolAction> undo_stack; | 56 | std::deque<EditorToolAction> undo_stack_; |
381 | 57 | std::deque<EditorToolAction> redo_stack; | 57 | std::deque<EditorToolAction> redo_stack_; |
382 | 58 | }; | 58 | }; |
383 | 59 | 59 | ||
384 | 60 | 60 | ||
385 | 61 | 61 | ||
386 | === modified file 'src/editor/tools/editor_increase_height_tool.cc' | |||
387 | --- src/editor/tools/editor_increase_height_tool.cc 2016-01-04 20:50:19 +0000 | |||
388 | +++ src/editor/tools/editor_increase_height_tool.cc 2016-03-18 12:52:47 +0000 | |||
389 | @@ -30,14 +30,14 @@ | |||
390 | 30 | EditorInteractive& /* parent */, | 30 | EditorInteractive& /* parent */, |
391 | 31 | EditorActionArgs* args, | 31 | EditorActionArgs* args, |
392 | 32 | Widelands::Map* map) { | 32 | Widelands::Map* map) { |
394 | 33 | if (args->origHights.empty()) { | 33 | if (args->original_heights.empty()) { |
395 | 34 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords>> mr( | 34 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords>> mr( |
396 | 35 | *map, | 35 | *map, |
397 | 36 | Widelands::Area<Widelands::FCoords>( | 36 | Widelands::Area<Widelands::FCoords>( |
398 | 37 | map->get_fcoords(center.node), | 37 | map->get_fcoords(center.node), |
399 | 38 | args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); | 38 | args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); |
400 | 39 | do { | 39 | do { |
402 | 40 | args->origHights.push_back(mr.location().field->get_height()); | 40 | args->original_heights.push_back(mr.location().field->get_height()); |
403 | 41 | } while (mr.advance(*map)); | 41 | } while (mr.advance(*map)); |
404 | 42 | } | 42 | } |
405 | 43 | 43 | ||
406 | @@ -52,12 +52,12 @@ | |||
407 | 52 | EditorInteractive& parent, | 52 | EditorInteractive& parent, |
408 | 53 | EditorActionArgs* args, | 53 | EditorActionArgs* args, |
409 | 54 | Widelands::Map* map) { | 54 | Widelands::Map* map) { |
411 | 55 | return m_decrease_tool.handle_undo_impl(world, center, parent, args, map); | 55 | return decrease_tool_.handle_undo_impl(world, center, parent, args, map); |
412 | 56 | } | 56 | } |
413 | 57 | 57 | ||
414 | 58 | EditorActionArgs EditorIncreaseHeightTool::format_args_impl(EditorInteractive & parent) | 58 | EditorActionArgs EditorIncreaseHeightTool::format_args_impl(EditorInteractive & parent) |
415 | 59 | { | 59 | { |
416 | 60 | EditorActionArgs a(parent); | 60 | EditorActionArgs a(parent); |
418 | 61 | a.change_by = m_change_by; | 61 | a.change_by = change_by_; |
419 | 62 | return a; | 62 | return a; |
420 | 63 | } | 63 | } |
421 | 64 | 64 | ||
422 | === modified file 'src/editor/tools/editor_increase_height_tool.h' | |||
423 | --- src/editor/tools/editor_increase_height_tool.h 2016-01-28 05:24:34 +0000 | |||
424 | +++ src/editor/tools/editor_increase_height_tool.h 2016-03-18 12:52:47 +0000 | |||
425 | @@ -30,8 +30,8 @@ | |||
426 | 30 | EditorSetHeightTool & the_set_tool) | 30 | EditorSetHeightTool & the_set_tool) |
427 | 31 | : | 31 | : |
428 | 32 | EditorTool(the_decrease_tool, the_set_tool), | 32 | EditorTool(the_decrease_tool, the_set_tool), |
431 | 33 | m_decrease_tool(the_decrease_tool), m_set_tool(the_set_tool), | 33 | decrease_tool_(the_decrease_tool), set_tool_(the_set_tool), |
432 | 34 | m_change_by(1) | 34 | change_by_(1) |
433 | 35 | {} | 35 | {} |
434 | 36 | 36 | ||
435 | 37 | int32_t handle_click_impl(const Widelands::World& world, | 37 | int32_t handle_click_impl(const Widelands::World& world, |
436 | @@ -52,18 +52,18 @@ | |||
437 | 52 | return "images/wui/editor/fsel_editor_increase_height.png"; | 52 | return "images/wui/editor/fsel_editor_increase_height.png"; |
438 | 53 | } | 53 | } |
439 | 54 | 54 | ||
442 | 55 | int32_t get_change_by() const {return m_change_by;} | 55 | int32_t get_change_by() const {return change_by_;} |
443 | 56 | void set_change_by(const int32_t n) {m_change_by = n;} | 56 | void set_change_by(const int32_t n) {change_by_ = n;} |
444 | 57 | 57 | ||
445 | 58 | EditorDecreaseHeightTool & decrease_tool() const { | 58 | EditorDecreaseHeightTool & decrease_tool() const { |
447 | 59 | return m_decrease_tool; | 59 | return decrease_tool_; |
448 | 60 | } | 60 | } |
450 | 61 | EditorSetHeightTool & set_tool() const {return m_set_tool;} | 61 | EditorSetHeightTool & set_tool() const {return set_tool_;} |
451 | 62 | 62 | ||
452 | 63 | private: | 63 | private: |
456 | 64 | EditorDecreaseHeightTool & m_decrease_tool; | 64 | EditorDecreaseHeightTool& decrease_tool_; |
457 | 65 | EditorSetHeightTool & m_set_tool; | 65 | EditorSetHeightTool& set_tool_; |
458 | 66 | int32_t m_change_by; | 66 | int32_t change_by_; |
459 | 67 | }; | 67 | }; |
460 | 68 | 68 | ||
461 | 69 | #endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_INCREASE_HEIGHT_TOOL_H | 69 | #endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_INCREASE_HEIGHT_TOOL_H |
462 | 70 | 70 | ||
463 | === modified file 'src/editor/tools/editor_increase_resources_tool.cc' | |||
464 | --- src/editor/tools/editor_increase_resources_tool.cc 2016-03-17 12:14:57 +0000 | |||
465 | +++ src/editor/tools/editor_increase_resources_tool.cc 2016-03-18 12:52:47 +0000 | |||
466 | @@ -40,25 +40,25 @@ | |||
467 | 40 | (map->get_fcoords(center.node), args->sel_radius)); | 40 | (map->get_fcoords(center.node), args->sel_radius)); |
468 | 41 | do { | 41 | do { |
469 | 42 | int32_t amount = mr.location().field->get_resources_amount(); | 42 | int32_t amount = mr.location().field->get_resources_amount(); |
472 | 43 | int32_t max_amount = args->cur_res != Widelands::kNoResource ? | 43 | int32_t max_amount = args->current_resource != Widelands::kNoResource ? |
473 | 44 | world.get_resource(args->cur_res)->max_amount() : 0; | 44 | world.get_resource(args->current_resource)->max_amount() : 0; |
474 | 45 | 45 | ||
475 | 46 | amount += args->change_by; | 46 | amount += args->change_by; |
476 | 47 | if (amount > max_amount) | 47 | if (amount > max_amount) |
477 | 48 | amount = max_amount; | 48 | amount = max_amount; |
478 | 49 | 49 | ||
480 | 50 | if ((mr.location().field->get_resources() == args->cur_res || | 50 | if ((mr.location().field->get_resources() == args->current_resource || |
481 | 51 | !mr.location().field->get_resources_amount()) && | 51 | !mr.location().field->get_resources_amount()) && |
483 | 52 | map->is_resource_valid(world, mr.location(), args->cur_res) && | 52 | map->is_resource_valid(world, mr.location(), args->current_resource) && |
484 | 53 | mr.location().field->get_resources_amount() != max_amount) { | 53 | mr.location().field->get_resources_amount() != max_amount) { |
485 | 54 | 54 | ||
487 | 55 | args->orgRes.push_back(EditorActionArgs::ResourceState{ | 55 | args->original_resource.push_back(EditorActionArgs::ResourceState{ |
488 | 56 | mr.location(), | 56 | mr.location(), |
489 | 57 | mr.location().field->get_resources(), | 57 | mr.location().field->get_resources(), |
490 | 58 | mr.location().field->get_resources_amount() | 58 | mr.location().field->get_resources_amount() |
491 | 59 | }); | 59 | }); |
492 | 60 | 60 | ||
494 | 61 | map->initialize_resources(mr.location(), args->cur_res, amount); | 61 | map->initialize_resources(mr.location(), args->current_resource, amount); |
495 | 62 | } | 62 | } |
496 | 63 | } while (mr.advance(*map)); | 63 | } while (mr.advance(*map)); |
497 | 64 | return mr.radius(); | 64 | return mr.radius(); |
498 | @@ -69,13 +69,13 @@ | |||
499 | 69 | EditorInteractive& parent, | 69 | EditorInteractive& parent, |
500 | 70 | EditorActionArgs* args, | 70 | EditorActionArgs* args, |
501 | 71 | Widelands::Map* map) { | 71 | Widelands::Map* map) { |
503 | 72 | return m_set_tool.handle_undo_impl(world, center, parent, args, map); | 72 | return set_tool_.handle_undo_impl(world, center, parent, args, map); |
504 | 73 | } | 73 | } |
505 | 74 | 74 | ||
506 | 75 | EditorActionArgs EditorIncreaseResourcesTool::format_args_impl(EditorInteractive & parent) | 75 | EditorActionArgs EditorIncreaseResourcesTool::format_args_impl(EditorInteractive & parent) |
507 | 76 | { | 76 | { |
508 | 77 | EditorActionArgs a(parent); | 77 | EditorActionArgs a(parent); |
511 | 78 | a.change_by = m_change_by; | 78 | a.change_by = change_by_; |
512 | 79 | a.cur_res = m_cur_res; | 79 | a.current_resource = cur_res_; |
513 | 80 | return a; | 80 | return a; |
514 | 81 | } | 81 | } |
515 | 82 | 82 | ||
516 | === modified file 'src/editor/tools/editor_increase_resources_tool.h' | |||
517 | --- src/editor/tools/editor_increase_resources_tool.h 2016-01-28 05:24:34 +0000 | |||
518 | +++ src/editor/tools/editor_increase_resources_tool.h 2016-03-18 12:52:47 +0000 | |||
519 | @@ -29,10 +29,10 @@ | |||
520 | 29 | EditorIncreaseResourcesTool(EditorDecreaseResourcesTool& the_decrease_tool, | 29 | EditorIncreaseResourcesTool(EditorDecreaseResourcesTool& the_decrease_tool, |
521 | 30 | EditorSetResourcesTool& the_set_to_tool) | 30 | EditorSetResourcesTool& the_set_to_tool) |
522 | 31 | : EditorTool(the_decrease_tool, the_set_to_tool), | 31 | : EditorTool(the_decrease_tool, the_set_to_tool), |
527 | 32 | m_decrease_tool(the_decrease_tool), | 32 | decrease_tool_(the_decrease_tool), |
528 | 33 | m_set_tool(the_set_to_tool), | 33 | set_tool_(the_set_to_tool), |
529 | 34 | m_change_by(1), | 34 | change_by_(1), |
530 | 35 | m_cur_res(0) { | 35 | cur_res_(0) { |
531 | 36 | } | 36 | } |
532 | 37 | 37 | ||
533 | 38 | /*** | 38 | /*** |
534 | @@ -57,23 +57,23 @@ | |||
535 | 57 | return "images/wui/editor/fsel_editor_increase_resources.png"; | 57 | return "images/wui/editor/fsel_editor_increase_resources.png"; |
536 | 58 | } | 58 | } |
537 | 59 | 59 | ||
541 | 60 | int32_t get_change_by() const {return m_change_by;} | 60 | int32_t get_change_by() const {return change_by_;} |
542 | 61 | void set_change_by(const int32_t n) {m_change_by = n;} | 61 | void set_change_by(const int32_t n) {change_by_ = n;} |
543 | 62 | Widelands::DescriptionIndex get_cur_res() const {return m_cur_res;} | 62 | Widelands::DescriptionIndex get_cur_res() const {return cur_res_;} |
544 | 63 | void set_cur_res(Widelands::DescriptionIndex const res) { | 63 | void set_cur_res(Widelands::DescriptionIndex const res) { |
546 | 64 | m_cur_res = res; | 64 | cur_res_ = res; |
547 | 65 | } | 65 | } |
548 | 66 | 66 | ||
549 | 67 | EditorDecreaseResourcesTool & decrease_tool() const { | 67 | EditorDecreaseResourcesTool & decrease_tool() const { |
551 | 68 | return m_decrease_tool; | 68 | return decrease_tool_; |
552 | 69 | } | 69 | } |
554 | 70 | EditorSetResourcesTool & set_tool() const {return m_set_tool;} | 70 | EditorSetResourcesTool & set_tool() const {return set_tool_;} |
555 | 71 | 71 | ||
556 | 72 | private: | 72 | private: |
561 | 73 | EditorDecreaseResourcesTool & m_decrease_tool; | 73 | EditorDecreaseResourcesTool& decrease_tool_; |
562 | 74 | EditorSetResourcesTool& m_set_tool; | 74 | EditorSetResourcesTool& set_tool_; |
563 | 75 | int32_t m_change_by; | 75 | int32_t change_by_; |
564 | 76 | Widelands::DescriptionIndex m_cur_res; | 76 | Widelands::DescriptionIndex cur_res_; |
565 | 77 | }; | 77 | }; |
566 | 78 | 78 | ||
567 | 79 | 79 | ||
568 | 80 | 80 | ||
569 | === modified file 'src/editor/tools/editor_make_infrastructure_tool.cc' | |||
570 | --- src/editor/tools/editor_make_infrastructure_tool.cc 2016-01-04 20:50:19 +0000 | |||
571 | +++ src/editor/tools/editor_make_infrastructure_tool.cc 2016-03-18 12:52:47 +0000 | |||
572 | @@ -52,7 +52,7 @@ | |||
573 | 52 | EditorActionArgs* /* args */, | 52 | EditorActionArgs* /* args */, |
574 | 53 | Widelands::Map*) { | 53 | Widelands::Map*) { |
575 | 54 | show_field_action | 54 | show_field_action |
577 | 55 | (&parent, parent.egbase().get_player(m_player), &m_registry); | 55 | (&parent, parent.egbase().get_player(player_), ®istry_); |
578 | 56 | 56 | ||
579 | 57 | // Not really needed, since Player Immovables are taken care of while | 57 | // Not really needed, since Player Immovables are taken care of while |
580 | 58 | // placing on map. | 58 | // placing on map. |
581 | 59 | 59 | ||
582 | === modified file 'src/editor/tools/editor_make_infrastructure_tool.h' | |||
583 | --- src/editor/tools/editor_make_infrastructure_tool.h 2016-01-28 05:24:34 +0000 | |||
584 | +++ src/editor/tools/editor_make_infrastructure_tool.h 2016-03-18 12:52:47 +0000 | |||
585 | @@ -32,12 +32,12 @@ | |||
586 | 32 | */ | 32 | */ |
587 | 33 | // TODO(unknown): Implement undo for this tool | 33 | // TODO(unknown): Implement undo for this tool |
588 | 34 | struct EditorMakeInfrastructureTool : public EditorTool { | 34 | struct EditorMakeInfrastructureTool : public EditorTool { |
590 | 35 | EditorMakeInfrastructureTool() : EditorTool(*this, *this, false), m_player(0) {} | 35 | EditorMakeInfrastructureTool() : EditorTool(*this, *this, false), player_(0) {} |
591 | 36 | 36 | ||
592 | 37 | void set_player(Widelands::PlayerNumber const n) | 37 | void set_player(Widelands::PlayerNumber const n) |
594 | 38 | {m_player = n;} | 38 | {player_ = n;} |
595 | 39 | Widelands::PlayerNumber get_player() const | 39 | Widelands::PlayerNumber get_player() const |
597 | 40 | {return m_player;} | 40 | {return player_;} |
598 | 41 | 41 | ||
599 | 42 | int32_t handle_click_impl(const Widelands::World& world, | 42 | int32_t handle_click_impl(const Widelands::World& world, |
600 | 43 | Widelands::NodeAndTriangle<> center, | 43 | Widelands::NodeAndTriangle<> center, |
601 | @@ -49,8 +49,8 @@ | |||
602 | 49 | {return "images/ui_basic/fsel.png";} // Standard sel icon, most complex tool of all | 49 | {return "images/ui_basic/fsel.png";} // Standard sel icon, most complex tool of all |
603 | 50 | 50 | ||
604 | 51 | private: | 51 | private: |
607 | 52 | Widelands::PlayerNumber m_player; | 52 | Widelands::PlayerNumber player_; |
608 | 53 | UI::UniqueWindow::Registry m_registry; | 53 | UI::UniqueWindow::Registry registry_; |
609 | 54 | }; | 54 | }; |
610 | 55 | 55 | ||
611 | 56 | int32_t editor_make_infrastructure_tool_callback | 56 | int32_t editor_make_infrastructure_tool_callback |
612 | 57 | 57 | ||
613 | === modified file 'src/editor/tools/editor_noise_height_tool.cc' | |||
614 | --- src/editor/tools/editor_noise_height_tool.cc 2016-01-04 20:50:19 +0000 | |||
615 | +++ src/editor/tools/editor_noise_height_tool.cc 2016-03-18 12:52:47 +0000 | |||
616 | @@ -32,13 +32,13 @@ | |||
617 | 32 | EditorInteractive& /* parent */, | 32 | EditorInteractive& /* parent */, |
618 | 33 | EditorActionArgs* args, | 33 | EditorActionArgs* args, |
619 | 34 | Widelands::Map* map) { | 34 | Widelands::Map* map) { |
621 | 35 | if (args->origHights.empty()) { | 35 | if (args->original_heights.empty()) { |
622 | 36 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr | 36 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr |
623 | 37 | (*map, | 37 | (*map, |
624 | 38 | Widelands::Area<Widelands::FCoords> | 38 | Widelands::Area<Widelands::FCoords> |
625 | 39 | (map->get_fcoords(center.node), | 39 | (map->get_fcoords(center.node), |
626 | 40 | args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); | 40 | args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); |
628 | 41 | do args->origHights.push_back(mr.location().field->get_height()); | 41 | do args->original_heights.push_back(mr.location().field->get_height()); |
629 | 42 | while (mr.advance(*map)); | 42 | while (mr.advance(*map)); |
630 | 43 | } | 43 | } |
631 | 44 | 44 | ||
632 | @@ -53,9 +53,9 @@ | |||
633 | 53 | max, | 53 | max, |
634 | 54 | map->set_height(world, | 54 | map->set_height(world, |
635 | 55 | mr.location(), | 55 | mr.location(), |
637 | 56 | args->m_interval.min + | 56 | args->interval.min + |
638 | 57 | static_cast<int32_t>( | 57 | static_cast<int32_t>( |
640 | 58 | static_cast<double>(args->m_interval.max - args->m_interval.min + 1) * | 58 | static_cast<double>(args->interval.max - args->interval.min + 1) * |
641 | 59 | rand() / (RAND_MAX + 1.0)))); | 59 | rand() / (RAND_MAX + 1.0)))); |
642 | 60 | } while (mr.advance(*map)); | 60 | } while (mr.advance(*map)); |
643 | 61 | return mr.radius() + max; | 61 | return mr.radius() + max; |
644 | @@ -67,12 +67,12 @@ | |||
645 | 67 | EditorInteractive& parent, | 67 | EditorInteractive& parent, |
646 | 68 | EditorActionArgs* args, | 68 | EditorActionArgs* args, |
647 | 69 | Widelands::Map* map) { | 69 | Widelands::Map* map) { |
649 | 70 | return m_set_tool.handle_undo_impl(world, center, parent, args, map); | 70 | return set_tool_.handle_undo_impl(world, center, parent, args, map); |
650 | 71 | } | 71 | } |
651 | 72 | 72 | ||
652 | 73 | EditorActionArgs EditorNoiseHeightTool::format_args_impl(EditorInteractive & parent) | 73 | EditorActionArgs EditorNoiseHeightTool::format_args_impl(EditorInteractive & parent) |
653 | 74 | { | 74 | { |
654 | 75 | EditorActionArgs a(parent); | 75 | EditorActionArgs a(parent); |
656 | 76 | a.m_interval = m_interval; | 76 | a.interval = interval_; |
657 | 77 | return a; | 77 | return a; |
658 | 78 | } | 78 | } |
659 | 79 | 79 | ||
660 | === modified file 'src/editor/tools/editor_noise_height_tool.h' | |||
661 | --- src/editor/tools/editor_noise_height_tool.h 2016-01-28 05:24:34 +0000 | |||
662 | +++ src/editor/tools/editor_noise_height_tool.h 2016-03-18 12:52:47 +0000 | |||
663 | @@ -30,8 +30,8 @@ | |||
664 | 30 | Widelands::HeightInterval(10, 14)) | 30 | Widelands::HeightInterval(10, 14)) |
665 | 31 | : | 31 | : |
666 | 32 | EditorTool(the_set_tool, the_set_tool), | 32 | EditorTool(the_set_tool, the_set_tool), |
669 | 33 | m_set_tool(the_set_tool), | 33 | set_tool_(the_set_tool), |
670 | 34 | m_interval(the_interval) | 34 | interval_(the_interval) |
671 | 35 | {} | 35 | {} |
672 | 36 | 36 | ||
673 | 37 | int32_t handle_click_impl(const Widelands::World& world, | 37 | int32_t handle_click_impl(const Widelands::World& world, |
674 | @@ -53,17 +53,17 @@ | |||
675 | 53 | } | 53 | } |
676 | 54 | 54 | ||
677 | 55 | Widelands::HeightInterval get_interval() const { | 55 | Widelands::HeightInterval get_interval() const { |
679 | 56 | return m_interval; | 56 | return interval_; |
680 | 57 | } | 57 | } |
681 | 58 | void set_interval(Widelands::HeightInterval const i) { | 58 | void set_interval(Widelands::HeightInterval const i) { |
683 | 59 | m_interval = i; | 59 | interval_ = i; |
684 | 60 | } | 60 | } |
685 | 61 | 61 | ||
687 | 62 | EditorSetHeightTool & set_tool() const {return m_set_tool;} | 62 | EditorSetHeightTool & set_tool() const {return set_tool_;} |
688 | 63 | 63 | ||
689 | 64 | private: | 64 | private: |
692 | 65 | EditorSetHeightTool & m_set_tool; | 65 | EditorSetHeightTool & set_tool_; |
693 | 66 | Widelands::HeightInterval m_interval; | 66 | Widelands::HeightInterval interval_; |
694 | 67 | }; | 67 | }; |
695 | 68 | 68 | ||
696 | 69 | #endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_NOISE_HEIGHT_TOOL_H | 69 | #endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_NOISE_HEIGHT_TOOL_H |
697 | 70 | 70 | ||
698 | === modified file 'src/editor/tools/editor_place_bob_tool.cc' | |||
699 | --- src/editor/tools/editor_place_bob_tool.cc 2016-01-06 19:11:20 +0000 | |||
700 | +++ src/editor/tools/editor_place_bob_tool.cc 2016-03-18 12:52:47 +0000 | |||
701 | @@ -36,25 +36,25 @@ | |||
702 | 36 | EditorActionArgs* args, | 36 | EditorActionArgs* args, |
703 | 37 | Widelands::Map* map) { | 37 | Widelands::Map* map) { |
704 | 38 | 38 | ||
706 | 39 | if (get_nr_enabled() && args->obob_type.empty()) { | 39 | if (get_nr_enabled() && args->old_bob_type.empty()) { |
707 | 40 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr | 40 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr |
708 | 41 | (*map, | 41 | (*map, |
709 | 42 | Widelands::Area<Widelands::FCoords> | 42 | Widelands::Area<Widelands::FCoords> |
710 | 43 | (map->get_fcoords(center.node), args->sel_radius)); | 43 | (map->get_fcoords(center.node), args->sel_radius)); |
711 | 44 | do { | 44 | do { |
712 | 45 | Widelands::Bob * const mbob = mr.location().field->get_first_bob(); | 45 | Widelands::Bob * const mbob = mr.location().field->get_first_bob(); |
715 | 46 | args->obob_type.push_back((mbob ? &mbob->descr() : nullptr)); | 46 | args->old_bob_type.push_back((mbob ? &mbob->descr() : nullptr)); |
716 | 47 | args->nbob_type.push_back(world.get_bob_descr(get_random_enabled())); | 47 | args->new_bob_type.push_back(world.get_bob_descr(get_random_enabled())); |
717 | 48 | } while (mr.advance(*map)); | 48 | } while (mr.advance(*map)); |
718 | 49 | } | 49 | } |
719 | 50 | 50 | ||
721 | 51 | if (!args->nbob_type.empty()) { | 51 | if (!args->new_bob_type.empty()) { |
722 | 52 | Widelands::EditorGameBase & egbase = parent.egbase(); | 52 | Widelands::EditorGameBase & egbase = parent.egbase(); |
723 | 53 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr | 53 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr |
724 | 54 | (*map, | 54 | (*map, |
725 | 55 | Widelands::Area<Widelands::FCoords> | 55 | Widelands::Area<Widelands::FCoords> |
726 | 56 | (map->get_fcoords(center.node), args->sel_radius)); | 56 | (map->get_fcoords(center.node), args->sel_radius)); |
728 | 57 | std::list< const Widelands::BobDescr * >::iterator i = args->nbob_type.begin(); | 57 | std::list< const Widelands::BobDescr * >::iterator i = args->new_bob_type.begin(); |
729 | 58 | do { | 58 | do { |
730 | 59 | const Widelands::BobDescr & descr = *(*i); | 59 | const Widelands::BobDescr & descr = *(*i); |
731 | 60 | if (mr.location().field->nodecaps() & descr.movecaps()) { | 60 | if (mr.location().field->nodecaps() & descr.movecaps()) { |
732 | @@ -75,13 +75,13 @@ | |||
733 | 75 | EditorInteractive& parent, | 75 | EditorInteractive& parent, |
734 | 76 | EditorActionArgs* args, | 76 | EditorActionArgs* args, |
735 | 77 | Widelands::Map* map) { | 77 | Widelands::Map* map) { |
737 | 78 | if (!args->nbob_type.empty()) { | 78 | if (!args->new_bob_type.empty()) { |
738 | 79 | Widelands::EditorGameBase & egbase = parent.egbase(); | 79 | Widelands::EditorGameBase & egbase = parent.egbase(); |
739 | 80 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr | 80 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr |
740 | 81 | (*map, | 81 | (*map, |
741 | 82 | Widelands::Area<Widelands::FCoords> | 82 | Widelands::Area<Widelands::FCoords> |
742 | 83 | (map->get_fcoords(center.node), args->sel_radius)); | 83 | (map->get_fcoords(center.node), args->sel_radius)); |
744 | 84 | std::list<const Widelands::BobDescr *>::iterator i = args->obob_type.begin(); | 84 | std::list<const Widelands::BobDescr *>::iterator i = args->old_bob_type.begin(); |
745 | 85 | do { | 85 | do { |
746 | 86 | if (*i) { | 86 | if (*i) { |
747 | 87 | const Widelands::BobDescr & descr = *(*i); | 87 | const Widelands::BobDescr & descr = *(*i); |
748 | 88 | 88 | ||
749 | === modified file 'src/editor/tools/editor_place_immovable_tool.cc' | |||
750 | --- src/editor/tools/editor_place_immovable_tool.cc 2016-01-06 19:11:20 +0000 | |||
751 | +++ src/editor/tools/editor_place_immovable_tool.cc 2016-03-18 12:52:47 +0000 | |||
752 | @@ -41,7 +41,7 @@ | |||
753 | 41 | if (!get_nr_enabled()) | 41 | if (!get_nr_enabled()) |
754 | 42 | return radius; | 42 | return radius; |
755 | 43 | Widelands::EditorGameBase & egbase = parent.egbase(); | 43 | Widelands::EditorGameBase & egbase = parent.egbase(); |
757 | 44 | if (args->oimmov_types.empty()) | 44 | if (args->old_immovable_types.empty()) |
758 | 45 | { | 45 | { |
759 | 46 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr | 46 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr |
760 | 47 | (*map, | 47 | (*map, |
761 | @@ -49,18 +49,18 @@ | |||
762 | 49 | (map->get_fcoords(center.node), radius)); | 49 | (map->get_fcoords(center.node), radius)); |
763 | 50 | do { | 50 | do { |
764 | 51 | const Widelands::BaseImmovable * im = mr.location().field->get_immovable(); | 51 | const Widelands::BaseImmovable * im = mr.location().field->get_immovable(); |
767 | 52 | args->oimmov_types.push_back((im ? im->descr().name() : "")); | 52 | args->old_immovable_types.push_back((im ? im->descr().name() : "")); |
768 | 53 | args->nimmov_types.push_back(get_random_enabled()); | 53 | args->new_immovable_types.push_back(get_random_enabled()); |
769 | 54 | } while (mr.advance(*map)); | 54 | } while (mr.advance(*map)); |
770 | 55 | } | 55 | } |
771 | 56 | 56 | ||
773 | 57 | if (!args->nimmov_types.empty()) | 57 | if (!args->new_immovable_types.empty()) |
774 | 58 | { | 58 | { |
775 | 59 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr | 59 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr |
776 | 60 | (*map, | 60 | (*map, |
777 | 61 | Widelands::Area<Widelands::FCoords> | 61 | Widelands::Area<Widelands::FCoords> |
778 | 62 | (map->get_fcoords(center.node), radius)); | 62 | (map->get_fcoords(center.node), radius)); |
780 | 63 | std::list<int32_t>::iterator i = args->nimmov_types.begin(); | 63 | std::list<int32_t>::iterator i = args->new_immovable_types.begin(); |
781 | 64 | do { | 64 | do { |
782 | 65 | if | 65 | if |
783 | 66 | (!mr.location().field->get_immovable() | 66 | (!mr.location().field->get_immovable() |
784 | @@ -79,7 +79,7 @@ | |||
785 | 79 | EditorActionArgs* args, | 79 | EditorActionArgs* args, |
786 | 80 | Widelands::Map* map) { | 80 | Widelands::Map* map) { |
787 | 81 | const int32_t radius = args->sel_radius; | 81 | const int32_t radius = args->sel_radius; |
789 | 82 | if (args->oimmov_types.empty()) | 82 | if (args->old_immovable_types.empty()) |
790 | 83 | return radius; | 83 | return radius; |
791 | 84 | 84 | ||
792 | 85 | Widelands::EditorGameBase & egbase = parent.egbase(); | 85 | Widelands::EditorGameBase & egbase = parent.egbase(); |
793 | @@ -87,7 +87,7 @@ | |||
794 | 87 | (*map, | 87 | (*map, |
795 | 88 | Widelands::Area<Widelands::FCoords> | 88 | Widelands::Area<Widelands::FCoords> |
796 | 89 | (map->get_fcoords(center.node), radius)); | 89 | (map->get_fcoords(center.node), radius)); |
798 | 90 | std::list<std::string>::iterator i = args->oimmov_types.begin(); | 90 | std::list<std::string>::iterator i = args->old_immovable_types.begin(); |
799 | 91 | do { | 91 | do { |
800 | 92 | if | 92 | if |
801 | 93 | (upcast(Widelands::Immovable, immovable, | 93 | (upcast(Widelands::Immovable, immovable, |
802 | 94 | 94 | ||
803 | === modified file 'src/editor/tools/editor_set_height_tool.cc' | |||
804 | --- src/editor/tools/editor_set_height_tool.cc 2016-01-04 20:50:19 +0000 | |||
805 | +++ src/editor/tools/editor_set_height_tool.cc 2016-03-18 12:52:47 +0000 | |||
806 | @@ -31,19 +31,19 @@ | |||
807 | 31 | EditorInteractive& /* parent */, | 31 | EditorInteractive& /* parent */, |
808 | 32 | EditorActionArgs* args, | 32 | EditorActionArgs* args, |
809 | 33 | Widelands::Map* map) { | 33 | Widelands::Map* map) { |
811 | 34 | if (args->origHights.empty()) | 34 | if (args->original_heights.empty()) |
812 | 35 | { | 35 | { |
813 | 36 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr | 36 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr |
814 | 37 | (*map, | 37 | (*map, |
815 | 38 | Widelands::Area<Widelands::FCoords> | 38 | Widelands::Area<Widelands::FCoords> |
816 | 39 | (map->get_fcoords(center.node), args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); | 39 | (map->get_fcoords(center.node), args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); |
818 | 40 | do args->origHights.push_back(mr.location().field->get_height()); | 40 | do args->original_heights.push_back(mr.location().field->get_height()); |
819 | 41 | while (mr.advance(*map)); | 41 | while (mr.advance(*map)); |
820 | 42 | } | 42 | } |
821 | 43 | return map->set_height( | 43 | return map->set_height( |
822 | 44 | world, | 44 | world, |
823 | 45 | Widelands::Area<Widelands::FCoords>(map->get_fcoords(center.node), args->sel_radius), | 45 | Widelands::Area<Widelands::FCoords>(map->get_fcoords(center.node), args->sel_radius), |
825 | 46 | args->m_interval); | 46 | args->interval); |
826 | 47 | } | 47 | } |
827 | 48 | 48 | ||
828 | 49 | int32_t | 49 | int32_t |
829 | @@ -58,7 +58,7 @@ | |||
830 | 58 | (map->get_fcoords(center.node), | 58 | (map->get_fcoords(center.node), |
831 | 59 | args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); | 59 | args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); |
832 | 60 | 60 | ||
834 | 61 | std::list<Widelands::Field::Height>::iterator i = args->origHights.begin(); | 61 | std::list<Widelands::Field::Height>::iterator i = args->original_heights.begin(); |
835 | 62 | 62 | ||
836 | 63 | do { | 63 | do { |
837 | 64 | mr.location().field->set_height(*i); ++i; | 64 | mr.location().field->set_height(*i); ++i; |
838 | @@ -75,6 +75,6 @@ | |||
839 | 75 | EditorActionArgs EditorSetHeightTool::format_args_impl(EditorInteractive & parent) | 75 | EditorActionArgs EditorSetHeightTool::format_args_impl(EditorInteractive & parent) |
840 | 76 | { | 76 | { |
841 | 77 | EditorActionArgs a(parent); | 77 | EditorActionArgs a(parent); |
843 | 78 | a.m_interval = m_interval; | 78 | a.interval = interval_; |
844 | 79 | return a; | 79 | return a; |
845 | 80 | } | 80 | } |
846 | 81 | 81 | ||
847 | === modified file 'src/editor/tools/editor_set_height_tool.h' | |||
848 | --- src/editor/tools/editor_set_height_tool.h 2016-01-28 05:24:34 +0000 | |||
849 | +++ src/editor/tools/editor_set_height_tool.h 2016-03-18 12:52:47 +0000 | |||
850 | @@ -27,7 +27,7 @@ | |||
851 | 27 | /// Ensures that the height of a node is within an interval. | 27 | /// Ensures that the height of a node is within an interval. |
852 | 28 | struct EditorSetHeightTool : public EditorTool { | 28 | struct EditorSetHeightTool : public EditorTool { |
853 | 29 | EditorSetHeightTool() | 29 | EditorSetHeightTool() |
855 | 30 | : EditorTool(*this, *this), m_interval(10, 10) | 30 | : EditorTool(*this, *this), interval_(10, 10) |
856 | 31 | {} | 31 | {} |
857 | 32 | 32 | ||
858 | 33 | int32_t handle_click_impl(const Widelands::World& world, | 33 | int32_t handle_click_impl(const Widelands::World& world, |
859 | @@ -49,14 +49,14 @@ | |||
860 | 49 | } | 49 | } |
861 | 50 | 50 | ||
862 | 51 | Widelands::HeightInterval get_interval() const { | 51 | Widelands::HeightInterval get_interval() const { |
864 | 52 | return m_interval; | 52 | return interval_; |
865 | 53 | } | 53 | } |
866 | 54 | void set_interval(Widelands::HeightInterval const i) { | 54 | void set_interval(Widelands::HeightInterval const i) { |
868 | 55 | m_interval = i; | 55 | interval_ = i; |
869 | 56 | } | 56 | } |
870 | 57 | 57 | ||
871 | 58 | private: | 58 | private: |
873 | 59 | Widelands::HeightInterval m_interval; | 59 | Widelands::HeightInterval interval_; |
874 | 60 | }; | 60 | }; |
875 | 61 | 61 | ||
876 | 62 | #endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_SET_HEIGHT_TOOL_H | 62 | #endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_SET_HEIGHT_TOOL_H |
877 | 63 | 63 | ||
878 | === modified file 'src/editor/tools/editor_set_resources_tool.cc' | |||
879 | --- src/editor/tools/editor_set_resources_tool.cc 2016-03-17 12:14:57 +0000 | |||
880 | +++ src/editor/tools/editor_set_resources_tool.cc 2016-03-18 12:52:47 +0000 | |||
881 | @@ -39,23 +39,23 @@ | |||
882 | 39 | (map->get_fcoords(center.node), args->sel_radius)); | 39 | (map->get_fcoords(center.node), args->sel_radius)); |
883 | 40 | do { | 40 | do { |
884 | 41 | int32_t amount = args->set_to; | 41 | int32_t amount = args->set_to; |
887 | 42 | int32_t max_amount = args->cur_res != Widelands::kNoResource ? | 42 | int32_t max_amount = args->current_resource != Widelands::kNoResource ? |
888 | 43 | world.get_resource(args->cur_res)->max_amount() : 0; | 43 | world.get_resource(args->current_resource)->max_amount() : 0; |
889 | 44 | if (amount < 0) | 44 | if (amount < 0) |
890 | 45 | amount = 0; | 45 | amount = 0; |
891 | 46 | else if (amount > max_amount) | 46 | else if (amount > max_amount) |
892 | 47 | amount = max_amount; | 47 | amount = max_amount; |
893 | 48 | 48 | ||
895 | 49 | if (map->is_resource_valid(world, mr.location(), args->cur_res) && | 49 | if (map->is_resource_valid(world, mr.location(), args->current_resource) && |
896 | 50 | mr.location().field->get_resources_amount() != amount) { | 50 | mr.location().field->get_resources_amount() != amount) { |
897 | 51 | 51 | ||
899 | 52 | args->orgRes.push_back(EditorActionArgs::ResourceState{ | 52 | args->original_resource.push_back(EditorActionArgs::ResourceState{ |
900 | 53 | mr.location(), | 53 | mr.location(), |
901 | 54 | mr.location().field->get_resources(), | 54 | mr.location().field->get_resources(), |
902 | 55 | mr.location().field->get_resources_amount() | 55 | mr.location().field->get_resources_amount() |
903 | 56 | }); | 56 | }); |
904 | 57 | 57 | ||
906 | 58 | map->initialize_resources(mr.location(), args->cur_res, amount); | 58 | map->initialize_resources(mr.location(), args->current_resource, amount); |
907 | 59 | } | 59 | } |
908 | 60 | } while (mr.advance(*map)); | 60 | } while (mr.advance(*map)); |
909 | 61 | return mr.radius(); | 61 | return mr.radius(); |
910 | @@ -67,9 +67,9 @@ | |||
911 | 67 | EditorInteractive& /* parent */, | 67 | EditorInteractive& /* parent */, |
912 | 68 | EditorActionArgs* args, | 68 | EditorActionArgs* args, |
913 | 69 | Widelands::Map* map) { | 69 | Widelands::Map* map) { |
915 | 70 | for (const auto & res : args->orgRes) { | 70 | for (const auto & res : args->original_resource) { |
916 | 71 | int32_t amount = res.amount; | 71 | int32_t amount = res.amount; |
918 | 72 | int32_t max_amount = world.get_resource(args->cur_res)->max_amount(); | 72 | int32_t max_amount = world.get_resource(args->current_resource)->max_amount(); |
919 | 73 | 73 | ||
920 | 74 | if (amount < 0) | 74 | if (amount < 0) |
921 | 75 | amount = 0; | 75 | amount = 0; |
922 | @@ -79,14 +79,14 @@ | |||
923 | 79 | map->initialize_resources(res.location, res.idx, amount); | 79 | map->initialize_resources(res.location, res.idx, amount); |
924 | 80 | } | 80 | } |
925 | 81 | 81 | ||
927 | 82 | args->orgRes.clear(); | 82 | args->original_resource.clear(); |
928 | 83 | return args->sel_radius; | 83 | return args->sel_radius; |
929 | 84 | } | 84 | } |
930 | 85 | 85 | ||
931 | 86 | EditorActionArgs EditorSetResourcesTool::format_args_impl(EditorInteractive & parent) | 86 | EditorActionArgs EditorSetResourcesTool::format_args_impl(EditorInteractive & parent) |
932 | 87 | { | 87 | { |
933 | 88 | EditorActionArgs a(parent); | 88 | EditorActionArgs a(parent); |
936 | 89 | a.cur_res = m_cur_res; | 89 | a.current_resource = cur_res_; |
937 | 90 | a.set_to = m_set_to; | 90 | a.set_to = set_to_; |
938 | 91 | return a; | 91 | return a; |
939 | 92 | } | 92 | } |
940 | 93 | 93 | ||
941 | === modified file 'src/editor/tools/editor_set_resources_tool.h' | |||
942 | --- src/editor/tools/editor_set_resources_tool.h 2016-01-28 05:24:34 +0000 | |||
943 | +++ src/editor/tools/editor_set_resources_tool.h 2016-03-18 12:52:47 +0000 | |||
944 | @@ -27,7 +27,7 @@ | |||
945 | 27 | /// Decreases the resources of a node by a value. | 27 | /// Decreases the resources of a node by a value. |
946 | 28 | struct EditorSetResourcesTool : public EditorTool { | 28 | struct EditorSetResourcesTool : public EditorTool { |
947 | 29 | EditorSetResourcesTool() | 29 | EditorSetResourcesTool() |
949 | 30 | : EditorTool(*this, *this), m_cur_res(0), m_set_to(0) | 30 | : EditorTool(*this, *this), cur_res_(0), set_to_(0) |
950 | 31 | {} | 31 | {} |
951 | 32 | 32 | ||
952 | 33 | /** | 33 | /** |
953 | @@ -51,15 +51,15 @@ | |||
954 | 51 | return "images/wui/editor/fsel_editor_set_resources.png"; | 51 | return "images/wui/editor/fsel_editor_set_resources.png"; |
955 | 52 | } | 52 | } |
956 | 53 | 53 | ||
960 | 54 | uint8_t get_set_to() const {return m_set_to;} | 54 | uint8_t get_set_to() const {return set_to_;} |
961 | 55 | void set_set_to(uint8_t const n) {m_set_to = n;} | 55 | void set_set_to(uint8_t const n) {set_to_ = n;} |
962 | 56 | Widelands::DescriptionIndex get_cur_res() const {return m_cur_res;} | 56 | Widelands::DescriptionIndex get_cur_res() const {return cur_res_;} |
963 | 57 | void set_cur_res(Widelands::DescriptionIndex const res) | 57 | void set_cur_res(Widelands::DescriptionIndex const res) |
965 | 58 | {m_cur_res = res;} | 58 | {cur_res_ = res;} |
966 | 59 | 59 | ||
967 | 60 | private: | 60 | private: |
970 | 61 | Widelands::DescriptionIndex m_cur_res; | 61 | Widelands::DescriptionIndex cur_res_; |
971 | 62 | uint8_t m_set_to; | 62 | uint8_t set_to_; |
972 | 63 | }; | 63 | }; |
973 | 64 | 64 | ||
974 | 65 | 65 | ||
975 | 66 | 66 | ||
976 | === modified file 'src/editor/tools/editor_set_starting_pos_tool.cc' | |||
977 | --- src/editor/tools/editor_set_starting_pos_tool.cc 2016-01-28 05:24:34 +0000 | |||
978 | +++ src/editor/tools/editor_set_starting_pos_tool.cc 2016-03-18 12:52:47 +0000 | |||
979 | @@ -49,7 +49,7 @@ | |||
980 | 49 | } // namespace | 49 | } // namespace |
981 | 50 | 50 | ||
982 | 51 | // global variable to pass data from callback to class | 51 | // global variable to pass data from callback to class |
984 | 52 | static int32_t m_current_player; | 52 | static int32_t current_player_; |
985 | 53 | 53 | ||
986 | 54 | /* | 54 | /* |
987 | 55 | * static callback function for overlay calculation | 55 | * static callback function for overlay calculation |
988 | @@ -59,7 +59,7 @@ | |||
989 | 59 | { | 59 | { |
990 | 60 | // Area around already placed players | 60 | // Area around already placed players |
991 | 61 | Widelands::PlayerNumber const nr_players = map.get_nrplayers(); | 61 | Widelands::PlayerNumber const nr_players = map.get_nrplayers(); |
993 | 62 | for (Widelands::PlayerNumber p = 1, last = m_current_player - 1;; ++p) { | 62 | for (Widelands::PlayerNumber p = 1, last = current_player_ - 1;; ++p) { |
994 | 63 | for (; p <= last; ++p) | 63 | for (; p <= last; ++p) |
995 | 64 | if (Widelands::Coords const sp = map.get_starting_pos(p)) | 64 | if (Widelands::Coords const sp = map.get_starting_pos(p)) |
996 | 65 | if (map.calc_distance(sp, c) < MIN_PLACE_AROUND_PLAYERS) | 65 | if (map.calc_distance(sp, c) < MIN_PLACE_AROUND_PLAYERS) |
997 | @@ -78,10 +78,10 @@ | |||
998 | 78 | } | 78 | } |
999 | 79 | 79 | ||
1000 | 80 | EditorSetStartingPosTool::EditorSetStartingPosTool() | 80 | EditorSetStartingPosTool::EditorSetStartingPosTool() |
1002 | 81 | : EditorTool(*this, *this, false), m_current_sel_pic(nullptr) | 81 | : EditorTool(*this, *this, false), current_sel_pic_(nullptr) |
1003 | 82 | { | 82 | { |
1006 | 83 | m_current_player = 0; | 83 | current_player_ = 0; |
1007 | 84 | fsel_picsname = "images/players/fsel_editor_set_player_01_pos.png"; | 84 | fsel_picsname_ = "images/players/fsel_editor_set_player_01_pos.png"; |
1008 | 85 | } | 85 | } |
1009 | 86 | 86 | ||
1010 | 87 | int32_t EditorSetStartingPosTool::handle_click_impl(const Widelands::World&, | 87 | int32_t EditorSetStartingPosTool::handle_click_impl(const Widelands::World&, |
1011 | @@ -93,18 +93,18 @@ | |||
1012 | 93 | assert(center.node.x < map->get_width()); | 93 | assert(center.node.x < map->get_width()); |
1013 | 94 | assert(0 <= center.node.y); | 94 | assert(0 <= center.node.y); |
1014 | 95 | assert(center.node.y < map->get_height()); | 95 | assert(center.node.y < map->get_height()); |
1017 | 96 | if (m_current_player) { | 96 | if (current_player_) { |
1018 | 97 | if (map->get_nrplayers() < m_current_player) { | 97 | if (map->get_nrplayers() < current_player_) { |
1019 | 98 | // Mmh, my current player is not valid. Maybe the user has loaded a | 98 | // Mmh, my current player is not valid. Maybe the user has loaded a |
1020 | 99 | // new map while this tool was active. We set the new player to a | 99 | // new map while this tool was active. We set the new player to a |
1021 | 100 | // valid one. The sel pointer is the only thing that stays wrong, but | 100 | // valid one. The sel pointer is the only thing that stays wrong, but |
1022 | 101 | // this is not important | 101 | // this is not important |
1024 | 102 | m_current_player = 1; | 102 | current_player_ = 1; |
1025 | 103 | } | 103 | } |
1026 | 104 | 104 | ||
1028 | 105 | Widelands::Coords const old_sp = map->get_starting_pos(m_current_player); | 105 | Widelands::Coords const old_sp = map->get_starting_pos(current_player_); |
1029 | 106 | 106 | ||
1031 | 107 | const Image* player_image = g_gr->images().get(player_pictures[m_current_player - 1]); | 107 | const Image* player_image = g_gr->images().get(player_pictures[current_player_ - 1]); |
1032 | 108 | assert(player_image); | 108 | assert(player_image); |
1033 | 109 | 109 | ||
1034 | 110 | // check if field is valid | 110 | // check if field is valid |
1035 | @@ -118,7 +118,7 @@ | |||
1036 | 118 | center.node, player_image, 4, Point(player_image->width() / 2, STARTING_POS_HOTSPOT_Y)); | 118 | center.node, player_image, 4, Point(player_image->width() / 2, STARTING_POS_HOTSPOT_Y)); |
1037 | 119 | 119 | ||
1038 | 120 | // set new player pos | 120 | // set new player pos |
1040 | 121 | map->set_starting_pos(m_current_player, center.node); | 121 | map->set_starting_pos(current_player_, center.node); |
1041 | 122 | } | 122 | } |
1042 | 123 | } | 123 | } |
1043 | 124 | return 1; | 124 | return 1; |
1044 | @@ -127,12 +127,12 @@ | |||
1045 | 127 | Widelands::PlayerNumber EditorSetStartingPosTool::get_current_player | 127 | Widelands::PlayerNumber EditorSetStartingPosTool::get_current_player |
1046 | 128 | () const | 128 | () const |
1047 | 129 | { | 129 | { |
1049 | 130 | return m_current_player; | 130 | return current_player_; |
1050 | 131 | } | 131 | } |
1051 | 132 | 132 | ||
1052 | 133 | 133 | ||
1053 | 134 | void EditorSetStartingPosTool::set_current_player(int32_t const i) { | 134 | void EditorSetStartingPosTool::set_current_player(int32_t const i) { |
1057 | 135 | m_current_player = i; | 135 | current_player_ = i; |
1058 | 136 | fsel_picsname = player_pictures_small[m_current_player - 1]; | 136 | fsel_picsname_ = player_pictures_small[current_player_ - 1]; |
1059 | 137 | m_current_sel_pic = fsel_picsname; | 137 | current_sel_pic_ = fsel_picsname_; |
1060 | 138 | } | 138 | } |
1061 | 139 | 139 | ||
1062 | === modified file 'src/editor/tools/editor_set_starting_pos_tool.h' | |||
1063 | --- src/editor/tools/editor_set_starting_pos_tool.h 2016-01-28 05:24:34 +0000 | |||
1064 | +++ src/editor/tools/editor_set_starting_pos_tool.h 2016-03-18 12:52:47 +0000 | |||
1065 | @@ -38,15 +38,15 @@ | |||
1066 | 38 | EditorActionArgs*, | 38 | EditorActionArgs*, |
1067 | 39 | Widelands::Map*) override; | 39 | Widelands::Map*) override; |
1068 | 40 | char const * get_sel_impl() const override | 40 | char const * get_sel_impl() const override |
1070 | 41 | {return m_current_sel_pic;} | 41 | {return current_sel_pic_;} |
1071 | 42 | 42 | ||
1072 | 43 | Widelands::PlayerNumber get_current_player() const; | 43 | Widelands::PlayerNumber get_current_player() const; |
1073 | 44 | void set_current_player(int32_t); | 44 | void set_current_player(int32_t); |
1074 | 45 | bool has_size_one() const override {return true;} | 45 | bool has_size_one() const override {return true;} |
1075 | 46 | 46 | ||
1076 | 47 | private: | 47 | private: |
1079 | 48 | char const * fsel_picsname; | 48 | char const * fsel_picsname_; |
1080 | 49 | char const * m_current_sel_pic; | 49 | char const * current_sel_pic_; |
1081 | 50 | }; | 50 | }; |
1082 | 51 | 51 | ||
1083 | 52 | int32_t editor_tool_set_starting_pos_callback | 52 | int32_t editor_tool_set_starting_pos_callback |
1084 | 53 | 53 | ||
1085 | === modified file 'src/editor/tools/editor_set_terrain_tool.cc' | |||
1086 | --- src/editor/tools/editor_set_terrain_tool.cc 2016-01-04 20:50:19 +0000 | |||
1087 | +++ src/editor/tools/editor_set_terrain_tool.cc 2016-03-18 12:52:47 +0000 | |||
1088 | @@ -35,7 +35,7 @@ | |||
1089 | 35 | uint16_t const radius = args->sel_radius; | 35 | uint16_t const radius = args->sel_radius; |
1090 | 36 | int32_t max = 0; | 36 | int32_t max = 0; |
1091 | 37 | 37 | ||
1093 | 38 | if (get_nr_enabled() && args->terrainType.empty()) { | 38 | if (get_nr_enabled() && args->terrain_type.empty()) { |
1094 | 39 | Widelands::MapTriangleRegion<TCoords<Widelands::FCoords> > mr | 39 | Widelands::MapTriangleRegion<TCoords<Widelands::FCoords> > mr |
1095 | 40 | (*map, Widelands::Area<TCoords<Widelands::FCoords> > | 40 | (*map, Widelands::Area<TCoords<Widelands::FCoords> > |
1096 | 41 | (TCoords<Widelands::FCoords> | 41 | (TCoords<Widelands::FCoords> |
1097 | @@ -43,21 +43,21 @@ | |||
1098 | 43 | static_cast<TCoords<Widelands::FCoords>::TriangleIndex>(center.triangle.t)), | 43 | static_cast<TCoords<Widelands::FCoords>::TriangleIndex>(center.triangle.t)), |
1099 | 44 | radius)); | 44 | radius)); |
1100 | 45 | do { | 45 | do { |
1102 | 46 | args->origTerrainType.push_back | 46 | args->original_terrain_type.push_back |
1103 | 47 | ((mr.location().t == TCoords<Widelands::FCoords>::D) | 47 | ((mr.location().t == TCoords<Widelands::FCoords>::D) |
1104 | 48 | ? mr.location().field->terrain_d() : mr.location().field->terrain_r()); | 48 | ? mr.location().field->terrain_d() : mr.location().field->terrain_r()); |
1106 | 49 | args->terrainType.push_back(get_random_enabled()); | 49 | args->terrain_type.push_back(get_random_enabled()); |
1107 | 50 | } while (mr.advance(*map)); | 50 | } while (mr.advance(*map)); |
1108 | 51 | } | 51 | } |
1109 | 52 | 52 | ||
1111 | 53 | if (!args->terrainType.empty()) { | 53 | if (!args->terrain_type.empty()) { |
1112 | 54 | Widelands::MapTriangleRegion<TCoords<Widelands::FCoords> > mr | 54 | Widelands::MapTriangleRegion<TCoords<Widelands::FCoords> > mr |
1113 | 55 | (*map, Widelands::Area<TCoords<Widelands::FCoords> > | 55 | (*map, Widelands::Area<TCoords<Widelands::FCoords> > |
1114 | 56 | (TCoords<Widelands::FCoords> | 56 | (TCoords<Widelands::FCoords> |
1115 | 57 | (Widelands::FCoords(map->get_fcoords(center.triangle)), | 57 | (Widelands::FCoords(map->get_fcoords(center.triangle)), |
1116 | 58 | static_cast<TCoords<Widelands::FCoords>::TriangleIndex>(center.triangle.t)), | 58 | static_cast<TCoords<Widelands::FCoords>::TriangleIndex>(center.triangle.t)), |
1117 | 59 | radius)); | 59 | radius)); |
1119 | 60 | std::list<Widelands::DescriptionIndex>::iterator i = args->terrainType.begin(); | 60 | std::list<Widelands::DescriptionIndex>::iterator i = args->terrain_type.begin(); |
1120 | 61 | do { | 61 | do { |
1121 | 62 | max = std::max | 62 | max = std::max |
1122 | 63 | (max, map->change_terrain(world, mr.location(), *i)); | 63 | (max, map->change_terrain(world, mr.location(), *i)); |
1123 | @@ -76,7 +76,7 @@ | |||
1124 | 76 | assert | 76 | assert |
1125 | 77 | (center.triangle.t == TCoords<>::D || center.triangle.t == TCoords<>::R); | 77 | (center.triangle.t == TCoords<>::D || center.triangle.t == TCoords<>::R); |
1126 | 78 | uint16_t const radius = args->sel_radius; | 78 | uint16_t const radius = args->sel_radius; |
1128 | 79 | if (!args->terrainType.empty()) { | 79 | if (!args->terrain_type.empty()) { |
1129 | 80 | int32_t max = 0; | 80 | int32_t max = 0; |
1130 | 81 | Widelands::MapTriangleRegion<TCoords<Widelands::FCoords> > mr | 81 | Widelands::MapTriangleRegion<TCoords<Widelands::FCoords> > mr |
1131 | 82 | (*map, | 82 | (*map, |
1132 | @@ -87,7 +87,7 @@ | |||
1133 | 87 | (center.triangle.t)), | 87 | (center.triangle.t)), |
1134 | 88 | radius)); | 88 | radius)); |
1135 | 89 | 89 | ||
1137 | 90 | std::list<Widelands::DescriptionIndex>::iterator i = args->origTerrainType.begin(); | 90 | std::list<Widelands::DescriptionIndex>::iterator i = args->original_terrain_type.begin(); |
1138 | 91 | do { | 91 | do { |
1139 | 92 | max = std::max | 92 | max = std::max |
1140 | 93 | (max, map->change_terrain(world, mr.location(), *i)); | 93 | (max, map->change_terrain(world, mr.location(), *i)); |
1141 | 94 | 94 | ||
1142 | === modified file 'src/editor/tools/editor_tool.h' | |||
1143 | --- src/editor/tools/editor_tool.h 2016-02-01 08:21:18 +0000 | |||
1144 | +++ src/editor/tools/editor_tool.h 2016-03-18 12:52:47 +0000 | |||
1145 | @@ -41,7 +41,7 @@ | |||
1146 | 41 | class EditorTool { | 41 | class EditorTool { |
1147 | 42 | public: | 42 | public: |
1148 | 43 | EditorTool(EditorTool & second, EditorTool & third, bool uda = true) : | 43 | EditorTool(EditorTool & second, EditorTool & third, bool uda = true) : |
1150 | 44 | m_second(second), m_third(third), undoable(uda) | 44 | second_(second), third_(third), undoable_(uda) |
1151 | 45 | {} | 45 | {} |
1152 | 46 | virtual ~EditorTool() {} | 46 | virtual ~EditorTool() {} |
1153 | 47 | 47 | ||
1154 | @@ -52,7 +52,7 @@ | |||
1155 | 52 | EditorInteractive& parent, EditorActionArgs* args, Widelands::Map* map) | 52 | EditorInteractive& parent, EditorActionArgs* args, Widelands::Map* map) |
1156 | 53 | { | 53 | { |
1157 | 54 | return | 54 | return |
1159 | 55 | (i == First ? *this : i == Second ? m_second : m_third) | 55 | (i == First ? *this : i == Second ? second_ : third_) |
1160 | 56 | .handle_click_impl(world, center, parent, args, map); | 56 | .handle_click_impl(world, center, parent, args, map); |
1161 | 57 | } | 57 | } |
1162 | 58 | 58 | ||
1163 | @@ -62,23 +62,23 @@ | |||
1164 | 62 | EditorInteractive& parent, EditorActionArgs* args, Widelands::Map* map) | 62 | EditorInteractive& parent, EditorActionArgs* args, Widelands::Map* map) |
1165 | 63 | { | 63 | { |
1166 | 64 | return | 64 | return |
1168 | 65 | (i == First ? *this : i == Second ? m_second : m_third) | 65 | (i == First ? *this : i == Second ? second_ : third_) |
1169 | 66 | .handle_undo_impl(world, center, parent, args, map); | 66 | .handle_undo_impl(world, center, parent, args, map); |
1170 | 67 | } | 67 | } |
1171 | 68 | 68 | ||
1172 | 69 | const char * get_sel(const ToolIndex i) { | 69 | const char * get_sel(const ToolIndex i) { |
1173 | 70 | return | 70 | return |
1175 | 71 | (i == First ? *this : i == Second ? m_second : m_third) | 71 | (i == First ? *this : i == Second ? second_ : third_) |
1176 | 72 | .get_sel_impl(); | 72 | .get_sel_impl(); |
1177 | 73 | } | 73 | } |
1178 | 74 | 74 | ||
1179 | 75 | EditorActionArgs format_args(const ToolIndex i, EditorInteractive & parent) { | 75 | EditorActionArgs format_args(const ToolIndex i, EditorInteractive & parent) { |
1180 | 76 | return | 76 | return |
1182 | 77 | (i == First ? *this : i == Second ? m_second : m_third) | 77 | (i == First ? *this : i == Second ? second_ : third_) |
1183 | 78 | .format_args_impl(parent); | 78 | .format_args_impl(parent); |
1184 | 79 | } | 79 | } |
1185 | 80 | 80 | ||
1187 | 81 | bool is_unduable() {return undoable;} | 81 | bool is_undoable() {return undoable_;} |
1188 | 82 | virtual bool has_size_one() const {return false;} | 82 | virtual bool has_size_one() const {return false;} |
1189 | 83 | virtual EditorActionArgs format_args_impl(EditorInteractive & parent) { | 83 | virtual EditorActionArgs format_args_impl(EditorInteractive & parent) { |
1190 | 84 | return EditorActionArgs(parent); | 84 | return EditorActionArgs(parent); |
1191 | @@ -99,8 +99,8 @@ | |||
1192 | 99 | virtual bool operates_on_triangles() const {return false;} | 99 | virtual bool operates_on_triangles() const {return false;} |
1193 | 100 | 100 | ||
1194 | 101 | protected: | 101 | protected: |
1197 | 102 | EditorTool & m_second, & m_third; | 102 | EditorTool & second_, & third_; |
1198 | 103 | bool undoable; | 103 | bool undoable_; |
1199 | 104 | 104 | ||
1200 | 105 | private: | 105 | private: |
1201 | 106 | DISALLOW_COPY_AND_ASSIGN(EditorTool); | 106 | DISALLOW_COPY_AND_ASSIGN(EditorTool); |
1202 | 107 | 107 | ||
1203 | === modified file 'src/editor/tools/multi_select.h' | |||
1204 | --- src/editor/tools/multi_select.h 2014-07-05 16:41:51 +0000 | |||
1205 | +++ src/editor/tools/multi_select.h 2016-03-18 12:52:47 +0000 | |||
1206 | @@ -34,28 +34,28 @@ | |||
1207 | 34 | * This is a helper class, no Editor Tool (might be usable in game too) | 34 | * This is a helper class, no Editor Tool (might be usable in game too) |
1208 | 35 | */ | 35 | */ |
1209 | 36 | struct MultiSelect { | 36 | struct MultiSelect { |
1211 | 37 | MultiSelect() : m_nr_enabled(0) {} | 37 | MultiSelect() : nr_enabled_(0) {} |
1212 | 38 | ~MultiSelect() {} | 38 | ~MultiSelect() {} |
1213 | 39 | 39 | ||
1214 | 40 | void enable(int32_t n, bool t) { | 40 | void enable(int32_t n, bool t) { |
1217 | 41 | if (static_cast<int32_t>(m_enabled.size()) < n + 1) | 41 | if (static_cast<int32_t>(enabled_.size()) < n + 1) |
1218 | 42 | m_enabled.resize(n + 1, false); | 42 | enabled_.resize(n + 1, false); |
1219 | 43 | 43 | ||
1221 | 44 | if (m_enabled[n] == t) | 44 | if (enabled_[n] == t) |
1222 | 45 | return; | 45 | return; |
1224 | 46 | m_enabled[n] = t; | 46 | enabled_[n] = t; |
1225 | 47 | if (t) | 47 | if (t) |
1227 | 48 | ++m_nr_enabled; | 48 | ++nr_enabled_; |
1228 | 49 | else | 49 | else |
1231 | 50 | --m_nr_enabled; | 50 | --nr_enabled_; |
1232 | 51 | assert(0 <= m_nr_enabled); | 51 | assert(0 <= nr_enabled_); |
1233 | 52 | } | 52 | } |
1234 | 53 | bool is_enabled(int32_t n) const { | 53 | bool is_enabled(int32_t n) const { |
1236 | 54 | if (static_cast<int32_t>(m_enabled.size()) < n + 1) | 54 | if (static_cast<int32_t>(enabled_.size()) < n + 1) |
1237 | 55 | return false; | 55 | return false; |
1239 | 56 | return m_enabled[n]; | 56 | return enabled_[n]; |
1240 | 57 | } | 57 | } |
1242 | 58 | int32_t get_nr_enabled() const {return m_nr_enabled;} | 58 | int32_t get_nr_enabled() const {return nr_enabled_;} |
1243 | 59 | int32_t get_random_enabled() const { | 59 | int32_t get_random_enabled() const { |
1244 | 60 | const int32_t rand_value = | 60 | const int32_t rand_value = |
1245 | 61 | static_cast<int32_t> | 61 | static_cast<int32_t> |
1246 | @@ -69,8 +69,8 @@ | |||
1247 | 69 | } | 69 | } |
1248 | 70 | 70 | ||
1249 | 71 | private: | 71 | private: |
1252 | 72 | int32_t m_nr_enabled; | 72 | int32_t nr_enabled_; |
1253 | 73 | std::vector<bool> m_enabled; | 73 | std::vector<bool> enabled_; |
1254 | 74 | }; | 74 | }; |
1255 | 75 | 75 | ||
1256 | 76 | #endif // end of include guard: WL_EDITOR_TOOLS_MULTI_SELECT_H | 76 | #endif // end of include guard: WL_EDITOR_TOOLS_MULTI_SELECT_H |
1257 | 77 | 77 | ||
1258 | === modified file 'src/editor/ui_menus/editor_player_menu.cc' | |||
1259 | --- src/editor/ui_menus/editor_player_menu.cc 2016-01-31 10:57:58 +0000 | |||
1260 | +++ src/editor/ui_menus/editor_player_menu.cc 2016-03-18 12:52:47 +0000 | |||
1261 | @@ -70,24 +70,24 @@ | |||
1262 | 70 | : | 70 | : |
1263 | 71 | UI::UniqueWindow | 71 | UI::UniqueWindow |
1264 | 72 | (&parent, "players_menu", ®istry, 340, 400, _("Player Options")), | 72 | (&parent, "players_menu", ®istry, 340, 400, _("Player Options")), |
1266 | 73 | m_add_player | 73 | add_player_ |
1267 | 74 | (this, "add_player", | 74 | (this, "add_player", |
1268 | 75 | get_inner_w() - 5 - 20, 5, 20, 20, | 75 | get_inner_w() - 5 - 20, 5, 20, 20, |
1269 | 76 | g_gr->images().get("images/ui_basic/but1.png"), | 76 | g_gr->images().get("images/ui_basic/but1.png"), |
1270 | 77 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), | 77 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), |
1271 | 78 | _("Add player"), | 78 | _("Add player"), |
1272 | 79 | parent.egbase().map().get_nrplayers() < MAX_PLAYERS), | 79 | parent.egbase().map().get_nrplayers() < MAX_PLAYERS), |
1274 | 80 | m_remove_last_player | 80 | remove_last_player_ |
1275 | 81 | (this, "remove_last_player", | 81 | (this, "remove_last_player", |
1276 | 82 | 5, 5, 20, 20, | 82 | 5, 5, 20, 20, |
1277 | 83 | g_gr->images().get("images/ui_basic/but1.png"), | 83 | g_gr->images().get("images/ui_basic/but1.png"), |
1278 | 84 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), | 84 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), |
1279 | 85 | _("Remove last player"), | 85 | _("Remove last player"), |
1280 | 86 | 1 < parent.egbase().map().get_nrplayers()), | 86 | 1 < parent.egbase().map().get_nrplayers()), |
1282 | 87 | m_tribenames(eia().egbase().tribes().get_all_tribenames()) | 87 | tribenames_(eia().egbase().tribes().get_all_tribenames()) |
1283 | 88 | { | 88 | { |
1286 | 89 | m_add_player.sigclicked.connect(boost::bind(&EditorPlayerMenu::clicked_add_player, boost::ref(*this))); | 89 | add_player_.sigclicked.connect(boost::bind(&EditorPlayerMenu::clicked_add_player, boost::ref(*this))); |
1287 | 90 | m_remove_last_player.sigclicked.connect | 90 | remove_last_player_.sigclicked.connect |
1288 | 91 | (boost::bind(&EditorPlayerMenu::clicked_remove_last_player, boost::ref(*this))); | 91 | (boost::bind(&EditorPlayerMenu::clicked_remove_last_player, boost::ref(*this))); |
1289 | 92 | 92 | ||
1290 | 93 | int32_t const spacing = 5; | 93 | int32_t const spacing = 5; |
1291 | @@ -100,19 +100,19 @@ | |||
1292 | 100 | ta->set_pos(Point((get_inner_w() - ta->get_w()) / 2, posy + 5)); | 100 | ta->set_pos(Point((get_inner_w() - ta->get_w()) / 2, posy + 5)); |
1293 | 101 | posy += spacing + width; | 101 | posy += spacing + width; |
1294 | 102 | 102 | ||
1298 | 103 | m_nr_of_players_ta = new UI::Textarea(this, 0, 0, "5"); | 103 | nr_of_players_ta_ = new UI::Textarea(this, 0, 0, "5"); |
1299 | 104 | m_nr_of_players_ta->set_pos | 104 | nr_of_players_ta_->set_pos |
1300 | 105 | (Point((get_inner_w() - m_nr_of_players_ta->get_w()) / 2, posy + 5)); | 105 | (Point((get_inner_w() - nr_of_players_ta_->get_w()) / 2, posy + 5)); |
1301 | 106 | 106 | ||
1302 | 107 | posy += width + spacing + spacing; | 107 | posy += width + spacing + spacing; |
1303 | 108 | 108 | ||
1305 | 109 | m_posy = posy; | 109 | posy_ = posy; |
1306 | 110 | 110 | ||
1307 | 111 | for (Widelands::PlayerNumber i = 0; i < MAX_PLAYERS; ++i) { | 111 | for (Widelands::PlayerNumber i = 0; i < MAX_PLAYERS; ++i) { |
1312 | 112 | m_plr_names [i] = nullptr; | 112 | plr_names_ [i] = nullptr; |
1313 | 113 | m_plr_set_pos_buts [i] = nullptr; | 113 | plr_set_pos_buts_ [i] = nullptr; |
1314 | 114 | m_plr_set_tribes_buts[i] = nullptr; | 114 | plr_set_tribes_buts_[i] = nullptr; |
1315 | 115 | m_plr_make_infrastructure_buts[i] = nullptr; | 115 | plr_make_infrastructure_buts_[i] = nullptr; |
1316 | 116 | } | 116 | } |
1317 | 117 | update(); | 117 | update(); |
1318 | 118 | 118 | ||
1319 | @@ -147,75 +147,75 @@ | |||
1320 | 147 | text[0] = '0' + nr_players; | 147 | text[0] = '0' + nr_players; |
1321 | 148 | text[1] = '\0'; | 148 | text[1] = '\0'; |
1322 | 149 | } | 149 | } |
1324 | 150 | m_nr_of_players_ta->set_text(text); | 150 | nr_of_players_ta_->set_text(text); |
1325 | 151 | } | 151 | } |
1326 | 152 | 152 | ||
1327 | 153 | // Now remove all the unneeded stuff. | 153 | // Now remove all the unneeded stuff. |
1328 | 154 | for (Widelands::PlayerNumber i = nr_players; i < MAX_PLAYERS; ++i) { | 154 | for (Widelands::PlayerNumber i = nr_players; i < MAX_PLAYERS; ++i) { |
1332 | 155 | delete m_plr_names [i]; m_plr_names [i] = nullptr; | 155 | delete plr_names_ [i]; plr_names_ [i] = nullptr; |
1333 | 156 | delete m_plr_set_pos_buts [i]; m_plr_set_pos_buts [i] = nullptr; | 156 | delete plr_set_pos_buts_ [i]; plr_set_pos_buts_ [i] = nullptr; |
1334 | 157 | delete m_plr_set_tribes_buts[i]; m_plr_set_tribes_buts[i] = nullptr; | 157 | delete plr_set_tribes_buts_[i]; plr_set_tribes_buts_[i] = nullptr; |
1335 | 158 | } | 158 | } |
1337 | 159 | int32_t posy = m_posy; | 159 | int32_t posy = posy_; |
1338 | 160 | int32_t const spacing = 5; | 160 | int32_t const spacing = 5; |
1339 | 161 | int32_t const size = 20; | 161 | int32_t const size = 20; |
1340 | 162 | 162 | ||
1341 | 163 | iterate_player_numbers(p, nr_players) { | 163 | iterate_player_numbers(p, nr_players) { |
1342 | 164 | int32_t posx = spacing; | 164 | int32_t posx = spacing; |
1345 | 165 | if (!m_plr_names[p - 1]) { | 165 | if (!plr_names_[p - 1]) { |
1346 | 166 | m_plr_names[p - 1] = | 166 | plr_names_[p - 1] = |
1347 | 167 | new UI::EditBox | 167 | new UI::EditBox |
1348 | 168 | (this, posx, posy, 140, | 168 | (this, posx, posy, 140, |
1349 | 169 | g_gr->images().get("images/ui_basic/but0.png")); | 169 | g_gr->images().get("images/ui_basic/but0.png")); |
1351 | 170 | m_plr_names[p - 1]->changed.connect | 170 | plr_names_[p - 1]->changed.connect |
1352 | 171 | (boost::bind(&EditorPlayerMenu::name_changed, this, p - 1)); | 171 | (boost::bind(&EditorPlayerMenu::name_changed, this, p - 1)); |
1353 | 172 | posx += 140 + spacing; | 172 | posx += 140 + spacing; |
1355 | 173 | m_plr_names[p - 1]->set_text(map.get_scenario_player_name(p)); | 173 | plr_names_[p - 1]->set_text(map.get_scenario_player_name(p)); |
1356 | 174 | } | 174 | } |
1357 | 175 | 175 | ||
1360 | 176 | if (!m_plr_set_tribes_buts[p - 1]) { | 176 | if (!plr_set_tribes_buts_[p - 1]) { |
1361 | 177 | m_plr_set_tribes_buts[p - 1] = | 177 | plr_set_tribes_buts_[p - 1] = |
1362 | 178 | new UI::Button | 178 | new UI::Button |
1363 | 179 | (this, "tribe", | 179 | (this, "tribe", |
1364 | 180 | posx, posy, 140, size, | 180 | posx, posy, 140, size, |
1365 | 181 | g_gr->images().get("images/ui_basic/but0.png"), | 181 | g_gr->images().get("images/ui_basic/but0.png"), |
1366 | 182 | ""); | 182 | ""); |
1368 | 183 | m_plr_set_tribes_buts[p - 1]->sigclicked.connect | 183 | plr_set_tribes_buts_[p - 1]->sigclicked.connect |
1369 | 184 | (boost::bind(&EditorPlayerMenu::player_tribe_clicked, boost::ref(*this), p - 1)); | 184 | (boost::bind(&EditorPlayerMenu::player_tribe_clicked, boost::ref(*this), p - 1)); |
1370 | 185 | posx += 140 + spacing; | 185 | posx += 140 + spacing; |
1371 | 186 | } | 186 | } |
1372 | 187 | 187 | ||
1373 | 188 | // Get/Set (localized) tribe names | 188 | // Get/Set (localized) tribe names |
1374 | 189 | if (map.get_scenario_player_tribe(p) != UNDEFINED_TRIBE_NAME) { | 189 | if (map.get_scenario_player_tribe(p) != UNDEFINED_TRIBE_NAME) { |
1376 | 190 | m_selected_tribes[p - 1] = map.get_scenario_player_tribe(p); | 190 | selected_tribes_[p - 1] = map.get_scenario_player_tribe(p); |
1377 | 191 | } else { | 191 | } else { |
1380 | 192 | m_selected_tribes[p - 1] = m_tribenames[0]; | 192 | selected_tribes_[p - 1] = tribenames_[0]; |
1381 | 193 | map.set_scenario_player_tribe(p, m_selected_tribes[p - 1]); | 193 | map.set_scenario_player_tribe(p, selected_tribes_[p - 1]); |
1382 | 194 | } | 194 | } |
1383 | 195 | 195 | ||
1386 | 196 | m_plr_set_tribes_buts[p - 1] | 196 | plr_set_tribes_buts_[p - 1] |
1387 | 197 | ->set_title(eia().egbase().tribes().tribeinfo(m_selected_tribes[p - 1]).descname); | 197 | ->set_title(eia().egbase().tribes().tribeinfo(selected_tribes_[p - 1]).descname); |
1388 | 198 | 198 | ||
1389 | 199 | // Set default AI and closeable to false (always default - should be changed by hand) | 199 | // Set default AI and closeable to false (always default - should be changed by hand) |
1390 | 200 | map.set_scenario_player_ai(p, ""); | 200 | map.set_scenario_player_ai(p, ""); |
1391 | 201 | map.set_scenario_player_closeable(p, false); | 201 | map.set_scenario_player_closeable(p, false); |
1392 | 202 | 202 | ||
1393 | 203 | // Set Starting pos button. | 203 | // Set Starting pos button. |
1396 | 204 | if (!m_plr_set_pos_buts[p - 1]) { | 204 | if (!plr_set_pos_buts_[p - 1]) { |
1397 | 205 | m_plr_set_pos_buts[p - 1] = | 205 | plr_set_pos_buts_[p - 1] = |
1398 | 206 | new UI::Button | 206 | new UI::Button |
1399 | 207 | (this, "starting_pos", | 207 | (this, "starting_pos", |
1400 | 208 | posx, posy, size, size, | 208 | posx, posy, size, size, |
1401 | 209 | g_gr->images().get("images/ui_basic/but0.png"), | 209 | g_gr->images().get("images/ui_basic/but0.png"), |
1402 | 210 | nullptr, | 210 | nullptr, |
1403 | 211 | ""); | 211 | ""); |
1405 | 212 | m_plr_set_pos_buts[p - 1]->sigclicked.connect | 212 | plr_set_pos_buts_[p - 1]->sigclicked.connect |
1406 | 213 | (boost::bind(&EditorPlayerMenu::set_starting_pos_clicked, boost::ref(*this), p)); | 213 | (boost::bind(&EditorPlayerMenu::set_starting_pos_clicked, boost::ref(*this), p)); |
1407 | 214 | } | 214 | } |
1408 | 215 | const Image* player_image = g_gr->images().get(player_pictures_small[p - 1]); | 215 | const Image* player_image = g_gr->images().get(player_pictures_small[p - 1]); |
1409 | 216 | assert(player_image); | 216 | assert(player_image); |
1410 | 217 | 217 | ||
1412 | 218 | m_plr_set_pos_buts[p - 1]->set_pic(player_image); | 218 | plr_set_pos_buts_[p - 1]->set_pic(player_image); |
1413 | 219 | posy += size + spacing; | 219 | posy += size + spacing; |
1414 | 220 | } | 220 | } |
1415 | 221 | set_inner_size(get_inner_w(), posy + spacing); | 221 | set_inner_size(get_inner_w(), posy + spacing); |
1416 | @@ -232,10 +232,10 @@ | |||
1417 | 232 | const std::string name = (boost::format(_("Player %u")) % static_cast<unsigned int>(nr_players)).str(); | 232 | const std::string name = (boost::format(_("Player %u")) % static_cast<unsigned int>(nr_players)).str(); |
1418 | 233 | map.set_scenario_player_name(nr_players, name); | 233 | map.set_scenario_player_name(nr_players, name); |
1419 | 234 | } | 234 | } |
1421 | 235 | map.set_scenario_player_tribe(nr_players, m_tribenames[0]); | 235 | map.set_scenario_player_tribe(nr_players, tribenames_[0]); |
1422 | 236 | eia().set_need_save(true); | 236 | eia().set_need_save(true); |
1425 | 237 | m_add_player .set_enabled(nr_players < MAX_PLAYERS); | 237 | add_player_ .set_enabled(nr_players < MAX_PLAYERS); |
1426 | 238 | m_remove_last_player.set_enabled(true); | 238 | remove_last_player_.set_enabled(true); |
1427 | 239 | update(); | 239 | update(); |
1428 | 240 | } | 240 | } |
1429 | 241 | 241 | ||
1430 | @@ -259,8 +259,8 @@ | |||
1431 | 259 | set_starting_pos_clicked(nr_players); | 259 | set_starting_pos_clicked(nr_players); |
1432 | 260 | } | 260 | } |
1433 | 261 | map.set_nrplayers(nr_players); | 261 | map.set_nrplayers(nr_players); |
1436 | 262 | m_add_player .set_enabled(nr_players < MAX_PLAYERS); | 262 | add_player_ .set_enabled(nr_players < MAX_PLAYERS); |
1437 | 263 | m_remove_last_player.set_enabled(1 < nr_players); | 263 | remove_last_player_.set_enabled(1 < nr_players); |
1438 | 264 | 264 | ||
1439 | 265 | update(); | 265 | update(); |
1440 | 266 | // TODO(SirVer): Take steps when the player is referenced someplace. Not | 266 | // TODO(SirVer): Take steps when the player is referenced someplace. Not |
1441 | @@ -274,18 +274,18 @@ | |||
1442 | 274 | void EditorPlayerMenu::player_tribe_clicked(uint8_t n) { | 274 | void EditorPlayerMenu::player_tribe_clicked(uint8_t n) { |
1443 | 275 | EditorInteractive& menu = eia(); | 275 | EditorInteractive& menu = eia(); |
1444 | 276 | if (!menu.is_player_tribe_referenced(n + 1)) { | 276 | if (!menu.is_player_tribe_referenced(n + 1)) { |
1446 | 277 | if (!Widelands::Tribes::tribe_exists(m_selected_tribes[n])) { | 277 | if (!Widelands::Tribes::tribe_exists(selected_tribes_[n])) { |
1447 | 278 | throw wexception | 278 | throw wexception |
1449 | 279 | ("Map defines tribe %s, but it does not exist!", m_selected_tribes[n].c_str()); | 279 | ("Map defines tribe %s, but it does not exist!", selected_tribes_[n].c_str()); |
1450 | 280 | } | 280 | } |
1451 | 281 | uint32_t i; | 281 | uint32_t i; |
1454 | 282 | for (i = 0; i < m_tribenames.size(); ++i) { | 282 | for (i = 0; i < tribenames_.size(); ++i) { |
1455 | 283 | if (m_tribenames[i] == m_selected_tribes[n]) { | 283 | if (tribenames_[i] == selected_tribes_[n]) { |
1456 | 284 | break; | 284 | break; |
1457 | 285 | } | 285 | } |
1458 | 286 | } | 286 | } |
1461 | 287 | m_selected_tribes[n] = i == m_tribenames.size() - 1 ? m_tribenames[0] : m_tribenames[++i]; | 287 | selected_tribes_[n] = i == tribenames_.size() - 1 ? tribenames_[0] : tribenames_[++i]; |
1462 | 288 | menu.egbase().map().set_scenario_player_tribe(n + 1, m_selected_tribes[n]); | 288 | menu.egbase().map().set_scenario_player_tribe(n + 1, selected_tribes_[n]); |
1463 | 289 | menu.set_need_save(true); | 289 | menu.set_need_save(true); |
1464 | 290 | } else { | 290 | } else { |
1465 | 291 | UI::WLMessageBox mmb | 291 | UI::WLMessageBox mmb |
1466 | @@ -331,15 +331,15 @@ | |||
1467 | 331 | */ | 331 | */ |
1468 | 332 | void EditorPlayerMenu::name_changed(int32_t m) { | 332 | void EditorPlayerMenu::name_changed(int32_t m) { |
1469 | 333 | // Player name has been changed. | 333 | // Player name has been changed. |
1471 | 334 | std::string text = m_plr_names[m]->text(); | 334 | std::string text = plr_names_[m]->text(); |
1472 | 335 | EditorInteractive& menu = eia(); | 335 | EditorInteractive& menu = eia(); |
1473 | 336 | Widelands::Map & map = menu.egbase().map(); | 336 | Widelands::Map & map = menu.egbase().map(); |
1474 | 337 | if (text == "") { | 337 | if (text == "") { |
1475 | 338 | text = map.get_scenario_player_name(m + 1); | 338 | text = map.get_scenario_player_name(m + 1); |
1477 | 339 | m_plr_names[m]->set_text(text); | 339 | plr_names_[m]->set_text(text); |
1478 | 340 | } | 340 | } |
1479 | 341 | map.set_scenario_player_name(m + 1, text); | 341 | map.set_scenario_player_name(m + 1, text); |
1481 | 342 | m_plr_names[m]->set_text(map.get_scenario_player_name(m + 1)); | 342 | plr_names_[m]->set_text(map.get_scenario_player_name(m + 1)); |
1482 | 343 | menu.set_need_save(true); | 343 | menu.set_need_save(true); |
1483 | 344 | } | 344 | } |
1484 | 345 | 345 | ||
1485 | @@ -364,8 +364,8 @@ | |||
1486 | 364 | // so that this tribe can not be changed | 364 | // so that this tribe can not be changed |
1487 | 365 | egbase.add_player | 365 | egbase.add_player |
1488 | 366 | (n, 0, // TODO(SirVer): initialization index makes no sense here | 366 | (n, 0, // TODO(SirVer): initialization index makes no sense here |
1491 | 367 | eia().egbase().tribes().tribeinfo(m_selected_tribes[n]).descname, | 367 | eia().egbase().tribes().tribeinfo(selected_tribes_[n]).descname, |
1492 | 368 | m_plr_names[n - 1]->text()); | 368 | plr_names_[n - 1]->text()); |
1493 | 369 | 369 | ||
1494 | 370 | p = egbase.get_player(n); | 370 | p = egbase.get_player(n); |
1495 | 371 | } | 371 | } |
1496 | 372 | 372 | ||
1497 | === modified file 'src/editor/ui_menus/editor_player_menu.h' | |||
1498 | --- src/editor/ui_menus/editor_player_menu.h 2016-01-16 12:55:14 +0000 | |||
1499 | +++ src/editor/ui_menus/editor_player_menu.h 2016-03-18 12:52:47 +0000 | |||
1500 | @@ -46,22 +46,21 @@ | |||
1501 | 46 | 46 | ||
1502 | 47 | private: | 47 | private: |
1503 | 48 | EditorInteractive & eia(); | 48 | EditorInteractive & eia(); |
1513 | 49 | UI::UniqueWindow::Registry m_allow_buildings_menu; | 49 | UI::UniqueWindow::Registry allow_buildings_menu_; |
1514 | 50 | UI::Textarea * m_nr_of_players_ta; | 50 | UI::Textarea* nr_of_players_ta_; |
1515 | 51 | UI::EditBox * m_plr_names[MAX_PLAYERS]; | 51 | UI::EditBox* plr_names_[MAX_PLAYERS]; |
1516 | 52 | UI::Button | 52 | UI::Button add_player_, remove_last_player_; |
1517 | 53 | m_add_player, m_remove_last_player; | 53 | UI::Button |
1518 | 54 | UI::Button | 54 | * plr_make_infrastructure_buts_[MAX_PLAYERS], |
1519 | 55 | * m_plr_make_infrastructure_buts[MAX_PLAYERS], | 55 | * plr_set_pos_buts_ [MAX_PLAYERS], |
1520 | 56 | * m_plr_set_pos_buts [MAX_PLAYERS], | 56 | * plr_set_tribes_buts_ [MAX_PLAYERS]; |
1512 | 57 | * m_plr_set_tribes_buts [MAX_PLAYERS]; | ||
1521 | 58 | 57 | ||
1523 | 59 | std::vector<std::string> m_tribenames; | 58 | std::vector<std::string> tribenames_; |
1524 | 60 | 59 | ||
1525 | 61 | /// List of the tribes currently selected for all players | 60 | /// List of the tribes currently selected for all players |
1527 | 62 | std::string m_selected_tribes[MAX_PLAYERS]; | 61 | std::string selected_tribes_[MAX_PLAYERS]; |
1528 | 63 | 62 | ||
1530 | 64 | int32_t m_posy; | 63 | int32_t posy_; |
1531 | 65 | 64 | ||
1532 | 66 | void name_changed(int32_t); | 65 | void name_changed(int32_t); |
1533 | 67 | void clicked_add_player (); | 66 | void clicked_add_player (); |
1534 | 68 | 67 | ||
1535 | === modified file 'src/editor/ui_menus/editor_tool_change_height_options_menu.cc' | |||
1536 | --- src/editor/ui_menus/editor_tool_change_height_options_menu.cc 2016-01-29 08:37:22 +0000 | |||
1537 | +++ src/editor/ui_menus/editor_tool_change_height_options_menu.cc 2016-03-18 12:52:47 +0000 | |||
1538 | @@ -39,117 +39,117 @@ | |||
1539 | 39 | : | 39 | : |
1540 | 40 | EditorToolOptionsMenu | 40 | EditorToolOptionsMenu |
1541 | 41 | (parent, registry, 250, 135, _("Height Tools Options")), | 41 | (parent, registry, 250, 135, _("Height Tools Options")), |
1544 | 42 | m_increase_tool(increase_tool), | 42 | increase_tool_(increase_tool), |
1545 | 43 | m_change_by_label | 43 | change_by_label_ |
1546 | 44 | (this, | 44 | (this, |
1547 | 45 | hmargin(), vmargin(), get_inner_w() - 2 * hmargin(), height, | 45 | hmargin(), vmargin(), get_inner_w() - 2 * hmargin(), height, |
1548 | 46 | _("Increase/Decrease Value"), UI::Align::kBottomCenter), | 46 | _("Increase/Decrease Value"), UI::Align::kBottomCenter), |
1550 | 47 | m_change_by_increase | 47 | change_by_increase_ |
1551 | 48 | (this, "incr_change_by", | 48 | (this, "incr_change_by", |
1552 | 49 | get_inner_w() - hmargin() - width, | 49 | get_inner_w() - hmargin() - width, |
1554 | 50 | m_change_by_label.get_y() + m_change_by_label.get_h() + spacing(), | 50 | change_by_label_.get_y() + change_by_label_.get_h() + spacing(), |
1555 | 51 | width, height, | 51 | width, height, |
1556 | 52 | g_gr->images().get("images/ui_basic/but1.png"), | 52 | g_gr->images().get("images/ui_basic/but1.png"), |
1557 | 53 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), | 53 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), |
1558 | 54 | std::string(), | 54 | std::string(), |
1559 | 55 | increase_tool.get_change_by() < MAX_FIELD_HEIGHT_DIFF), | 55 | increase_tool.get_change_by() < MAX_FIELD_HEIGHT_DIFF), |
1561 | 56 | m_change_by_decrease | 56 | change_by_decrease_ |
1562 | 57 | (this, "decr_change_by", | 57 | (this, "decr_change_by", |
1563 | 58 | hmargin(), | 58 | hmargin(), |
1565 | 59 | m_change_by_increase.get_y(), | 59 | change_by_increase_.get_y(), |
1566 | 60 | width, height, | 60 | width, height, |
1567 | 61 | g_gr->images().get("images/ui_basic/but1.png"), | 61 | g_gr->images().get("images/ui_basic/but1.png"), |
1568 | 62 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), | 62 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), |
1569 | 63 | std::string(), | 63 | std::string(), |
1570 | 64 | 1 < increase_tool.get_change_by()), | 64 | 1 < increase_tool.get_change_by()), |
1572 | 65 | m_change_by_value | 65 | change_by_value_ |
1573 | 66 | (this, | 66 | (this, |
1575 | 67 | m_change_by_increase.get_x() + m_change_by_increase.get_w() + | 67 | change_by_increase_.get_x() + change_by_increase_.get_w() + |
1576 | 68 | hspacing(), | 68 | hspacing(), |
1579 | 69 | m_change_by_increase.get_y(), | 69 | change_by_increase_.get_y(), |
1580 | 70 | m_change_by_decrease.get_x() - hspacing() | 70 | change_by_decrease_.get_x() - hspacing() |
1581 | 71 | - | 71 | - |
1583 | 72 | (m_change_by_increase.get_x() + m_change_by_increase.get_w() + | 72 | (change_by_increase_.get_x() + change_by_increase_.get_w() + |
1584 | 73 | hspacing()), | 73 | hspacing()), |
1585 | 74 | height, | 74 | height, |
1586 | 75 | UI::Align::kBottomCenter), | 75 | UI::Align::kBottomCenter), |
1588 | 76 | m_set_to_label | 76 | set_to_label_ |
1589 | 77 | (this, | 77 | (this, |
1590 | 78 | vmargin(), | 78 | vmargin(), |
1592 | 79 | m_change_by_increase.get_y() + m_change_by_increase.get_h() + | 79 | change_by_increase_.get_y() + change_by_increase_.get_h() + |
1593 | 80 | vspacing(), | 80 | vspacing(), |
1594 | 81 | get_inner_w() - 2 * hmargin(), height, | 81 | get_inner_w() - 2 * hmargin(), height, |
1595 | 82 | _("Set Value"), UI::Align::kBottomCenter), | 82 | _("Set Value"), UI::Align::kBottomCenter), |
1597 | 83 | m_set_to_increase | 83 | set_to_increase_ |
1598 | 84 | (this, "incr_set_to", | 84 | (this, "incr_set_to", |
1601 | 85 | m_change_by_increase.get_x(), | 85 | change_by_increase_.get_x(), |
1602 | 86 | m_set_to_label.get_y() + m_set_to_label.get_h() + vspacing(), | 86 | set_to_label_.get_y() + set_to_label_.get_h() + vspacing(), |
1603 | 87 | width, height, | 87 | width, height, |
1604 | 88 | g_gr->images().get("images/ui_basic/but1.png"), | 88 | g_gr->images().get("images/ui_basic/but1.png"), |
1605 | 89 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), | 89 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), |
1606 | 90 | std::string(), | 90 | std::string(), |
1607 | 91 | increase_tool.set_tool().get_interval().min < MAX_FIELD_HEIGHT), | 91 | increase_tool.set_tool().get_interval().min < MAX_FIELD_HEIGHT), |
1609 | 92 | m_set_to_decrease | 92 | set_to_decrease_ |
1610 | 93 | (this, "decr_set_to", | 93 | (this, "decr_set_to", |
1611 | 94 | hmargin(), | 94 | hmargin(), |
1613 | 95 | m_set_to_increase.get_y(), | 95 | set_to_increase_.get_y(), |
1614 | 96 | width, height, | 96 | width, height, |
1615 | 97 | g_gr->images().get("images/ui_basic/but1.png"), | 97 | g_gr->images().get("images/ui_basic/but1.png"), |
1616 | 98 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), | 98 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), |
1617 | 99 | std::string(), | 99 | std::string(), |
1618 | 100 | 0 < increase_tool.set_tool().get_interval().min), | 100 | 0 < increase_tool.set_tool().get_interval().min), |
1620 | 101 | m_set_to_value | 101 | set_to_value_ |
1621 | 102 | (this, | 102 | (this, |
1624 | 103 | m_change_by_value.get_x(), m_set_to_increase.get_y(), | 103 | change_by_value_.get_x(), set_to_increase_.get_y(), |
1625 | 104 | m_change_by_value.get_w(), height, | 104 | change_by_value_.get_w(), height, |
1626 | 105 | UI::Align::kBottomCenter) | 105 | UI::Align::kBottomCenter) |
1627 | 106 | { | 106 | { |
1629 | 107 | m_change_by_increase.sigclicked.connect | 107 | change_by_increase_.sigclicked.connect |
1630 | 108 | (boost::bind | 108 | (boost::bind |
1631 | 109 | (&EditorToolChangeHeightOptionsMenu::clicked_change_by_increment, boost::ref(*this))); | 109 | (&EditorToolChangeHeightOptionsMenu::clicked_change_by_increment, boost::ref(*this))); |
1633 | 110 | m_change_by_decrease.sigclicked.connect | 110 | change_by_decrease_.sigclicked.connect |
1634 | 111 | (boost::bind | 111 | (boost::bind |
1635 | 112 | (&EditorToolChangeHeightOptionsMenu::clicked_change_by_decrement, boost::ref(*this))); | 112 | (&EditorToolChangeHeightOptionsMenu::clicked_change_by_decrement, boost::ref(*this))); |
1637 | 113 | m_set_to_increase.sigclicked.connect | 113 | set_to_increase_.sigclicked.connect |
1638 | 114 | (boost::bind(&EditorToolChangeHeightOptionsMenu::clicked_setto_increment, boost::ref(*this))); | 114 | (boost::bind(&EditorToolChangeHeightOptionsMenu::clicked_setto_increment, boost::ref(*this))); |
1640 | 115 | m_set_to_decrease.sigclicked.connect | 115 | set_to_decrease_.sigclicked.connect |
1641 | 116 | (boost::bind(&EditorToolChangeHeightOptionsMenu::clicked_setto_decrement, boost::ref(*this))); | 116 | (boost::bind(&EditorToolChangeHeightOptionsMenu::clicked_setto_decrement, boost::ref(*this))); |
1642 | 117 | 117 | ||
1647 | 118 | m_change_by_increase.set_repeating(true); | 118 | change_by_increase_.set_repeating(true); |
1648 | 119 | m_change_by_decrease.set_repeating(true); | 119 | change_by_decrease_.set_repeating(true); |
1649 | 120 | m_set_to_increase .set_repeating(true); | 120 | set_to_increase_ .set_repeating(true); |
1650 | 121 | m_set_to_decrease .set_repeating(true); | 121 | set_to_decrease_ .set_repeating(true); |
1651 | 122 | update(); | 122 | update(); |
1652 | 123 | } | 123 | } |
1653 | 124 | 124 | ||
1654 | 125 | 125 | ||
1655 | 126 | void EditorToolChangeHeightOptionsMenu::clicked_change_by_decrement() { | 126 | void EditorToolChangeHeightOptionsMenu::clicked_change_by_decrement() { |
1658 | 127 | int32_t change_by = m_increase_tool.get_change_by(); | 127 | int32_t change_by = increase_tool_.get_change_by(); |
1659 | 128 | assert(change_by == m_increase_tool.decrease_tool().get_change_by()); | 128 | assert(change_by == increase_tool_.decrease_tool().get_change_by()); |
1660 | 129 | assert(1 < change_by); | 129 | assert(1 < change_by); |
1661 | 130 | 130 | ||
1662 | 131 | --change_by; | 131 | --change_by; |
1663 | 132 | 132 | ||
1668 | 133 | m_increase_tool .set_change_by(change_by); | 133 | increase_tool_ .set_change_by(change_by); |
1669 | 134 | m_increase_tool.decrease_tool().set_change_by(change_by); | 134 | increase_tool_.decrease_tool().set_change_by(change_by); |
1670 | 135 | m_change_by_decrease.set_enabled(1 < change_by); | 135 | change_by_decrease_.set_enabled(1 < change_by); |
1671 | 136 | m_change_by_increase.set_enabled(true); | 136 | change_by_increase_.set_enabled(true); |
1672 | 137 | select_correct_tool(); | 137 | select_correct_tool(); |
1673 | 138 | update(); | 138 | update(); |
1674 | 139 | } | 139 | } |
1675 | 140 | 140 | ||
1676 | 141 | 141 | ||
1677 | 142 | void EditorToolChangeHeightOptionsMenu::clicked_change_by_increment() { | 142 | void EditorToolChangeHeightOptionsMenu::clicked_change_by_increment() { |
1680 | 143 | int32_t change_by = m_increase_tool.get_change_by(); | 143 | int32_t change_by = increase_tool_.get_change_by(); |
1681 | 144 | assert(change_by == m_increase_tool.decrease_tool().get_change_by()); | 144 | assert(change_by == increase_tool_.decrease_tool().get_change_by()); |
1682 | 145 | assert(change_by < MAX_FIELD_HEIGHT_DIFF); | 145 | assert(change_by < MAX_FIELD_HEIGHT_DIFF); |
1683 | 146 | 146 | ||
1684 | 147 | ++change_by; | 147 | ++change_by; |
1685 | 148 | 148 | ||
1690 | 149 | m_increase_tool .set_change_by(change_by); | 149 | increase_tool_ .set_change_by(change_by); |
1691 | 150 | m_increase_tool.decrease_tool().set_change_by(change_by); | 150 | increase_tool_.decrease_tool().set_change_by(change_by); |
1692 | 151 | m_change_by_decrease.set_enabled(true); | 151 | change_by_decrease_.set_enabled(true); |
1693 | 152 | m_change_by_increase.set_enabled(change_by < MAX_FIELD_HEIGHT_DIFF); | 152 | change_by_increase_.set_enabled(change_by < MAX_FIELD_HEIGHT_DIFF); |
1694 | 153 | select_correct_tool(); | 153 | select_correct_tool(); |
1695 | 154 | update(); | 154 | update(); |
1696 | 155 | } | 155 | } |
1697 | @@ -157,16 +157,16 @@ | |||
1698 | 157 | 157 | ||
1699 | 158 | void EditorToolChangeHeightOptionsMenu::clicked_setto_decrement() { | 158 | void EditorToolChangeHeightOptionsMenu::clicked_setto_decrement() { |
1700 | 159 | Widelands::Field::Height setto = | 159 | Widelands::Field::Height setto = |
1703 | 160 | m_increase_tool.set_tool().get_interval().min; | 160 | increase_tool_.set_tool().get_interval().min; |
1704 | 161 | assert(setto == m_increase_tool.set_tool().get_interval().max); | 161 | assert(setto == increase_tool_.set_tool().get_interval().max); |
1705 | 162 | assert(0 < setto); | 162 | assert(0 < setto); |
1706 | 163 | 163 | ||
1707 | 164 | --setto; | 164 | --setto; |
1708 | 165 | 165 | ||
1710 | 166 | m_increase_tool.set_tool().set_interval | 166 | increase_tool_.set_tool().set_interval |
1711 | 167 | (Widelands::HeightInterval(setto, setto)); | 167 | (Widelands::HeightInterval(setto, setto)); |
1714 | 168 | m_set_to_decrease.set_enabled(0 < setto); | 168 | set_to_decrease_.set_enabled(0 < setto); |
1715 | 169 | m_set_to_increase.set_enabled(true); | 169 | set_to_increase_.set_enabled(true); |
1716 | 170 | select_correct_tool(); | 170 | select_correct_tool(); |
1717 | 171 | update(); | 171 | update(); |
1718 | 172 | } | 172 | } |
1719 | @@ -174,16 +174,16 @@ | |||
1720 | 174 | 174 | ||
1721 | 175 | void EditorToolChangeHeightOptionsMenu::clicked_setto_increment() { | 175 | void EditorToolChangeHeightOptionsMenu::clicked_setto_increment() { |
1722 | 176 | Widelands::Field::Height setto = | 176 | Widelands::Field::Height setto = |
1725 | 177 | m_increase_tool.set_tool().get_interval().min; | 177 | increase_tool_.set_tool().get_interval().min; |
1726 | 178 | assert(setto == m_increase_tool.set_tool().get_interval().max); | 178 | assert(setto == increase_tool_.set_tool().get_interval().max); |
1727 | 179 | assert(setto < MAX_FIELD_HEIGHT); | 179 | assert(setto < MAX_FIELD_HEIGHT); |
1728 | 180 | 180 | ||
1729 | 181 | ++setto; | 181 | ++setto; |
1730 | 182 | 182 | ||
1732 | 183 | m_increase_tool.set_tool().set_interval | 183 | increase_tool_.set_tool().set_interval |
1733 | 184 | (Widelands::HeightInterval(setto, setto)); | 184 | (Widelands::HeightInterval(setto, setto)); |
1736 | 185 | m_set_to_decrease.set_enabled(true); | 185 | set_to_decrease_.set_enabled(true); |
1737 | 186 | m_set_to_increase.set_enabled(setto < MAX_FIELD_HEIGHT); | 186 | set_to_increase_.set_enabled(setto < MAX_FIELD_HEIGHT); |
1738 | 187 | select_correct_tool(); | 187 | select_correct_tool(); |
1739 | 188 | update(); | 188 | update(); |
1740 | 189 | } | 189 | } |
1741 | @@ -191,8 +191,8 @@ | |||
1742 | 191 | 191 | ||
1743 | 192 | /// Update all the textareas, so that they represent the correct values. | 192 | /// Update all the textareas, so that they represent the correct values. |
1744 | 193 | void EditorToolChangeHeightOptionsMenu::update() { | 193 | void EditorToolChangeHeightOptionsMenu::update() { |
1746 | 194 | m_change_by_value.set_text(std::to_string(m_increase_tool.get_change_by())); | 194 | change_by_value_.set_text(std::to_string(increase_tool_.get_change_by())); |
1747 | 195 | 195 | ||
1750 | 196 | m_set_to_value.set_text(std::to_string( | 196 | set_to_value_.set_text(std::to_string( |
1751 | 197 | static_cast<unsigned int>(m_increase_tool.set_tool().get_interval().min))); | 197 | static_cast<unsigned int>(increase_tool_.set_tool().get_interval().min))); |
1752 | 198 | } | 198 | } |
1753 | 199 | 199 | ||
1754 | === modified file 'src/editor/ui_menus/editor_tool_change_height_options_menu.h' | |||
1755 | --- src/editor/ui_menus/editor_tool_change_height_options_menu.h 2016-01-16 12:55:14 +0000 | |||
1756 | +++ src/editor/ui_menus/editor_tool_change_height_options_menu.h 2016-03-18 12:52:47 +0000 | |||
1757 | @@ -36,13 +36,13 @@ | |||
1758 | 36 | UI::UniqueWindow::Registry &); | 36 | UI::UniqueWindow::Registry &); |
1759 | 37 | 37 | ||
1760 | 38 | private: | 38 | private: |
1768 | 39 | EditorIncreaseHeightTool & m_increase_tool; | 39 | EditorIncreaseHeightTool& increase_tool_; |
1769 | 40 | UI::Textarea m_change_by_label; | 40 | UI::Textarea change_by_label_; |
1770 | 41 | UI::Button m_change_by_increase, m_change_by_decrease; | 41 | UI::Button change_by_increase_, change_by_decrease_; |
1771 | 42 | UI::Textarea m_change_by_value; | 42 | UI::Textarea change_by_value_; |
1772 | 43 | UI::Textarea m_set_to_label; | 43 | UI::Textarea set_to_label_; |
1773 | 44 | UI::Button m_set_to_increase, m_set_to_decrease; | 44 | UI::Button set_to_increase_, set_to_decrease_; |
1774 | 45 | UI::Textarea m_set_to_value; | 45 | UI::Textarea set_to_value_; |
1775 | 46 | 46 | ||
1776 | 47 | void clicked_change_by_decrement(); | 47 | void clicked_change_by_decrement(); |
1777 | 48 | void clicked_change_by_increment(); | 48 | void clicked_change_by_increment(); |
1778 | 49 | 49 | ||
1779 | === modified file 'src/editor/ui_menus/editor_tool_change_resources_options_menu.cc' | |||
1780 | --- src/editor/ui_menus/editor_tool_change_resources_options_menu.cc 2016-02-01 07:51:56 +0000 | |||
1781 | +++ src/editor/ui_menus/editor_tool_change_resources_options_menu.cc 2016-03-18 12:52:47 +0000 | |||
1782 | @@ -52,87 +52,87 @@ | |||
1783 | 52 | : | 52 | : |
1784 | 53 | EditorToolOptionsMenu | 53 | EditorToolOptionsMenu |
1785 | 54 | (parent, registry, 250, 120, _("Resources")), | 54 | (parent, registry, 250, 120, _("Resources")), |
1787 | 55 | m_change_by_label | 55 | change_by_label_ |
1788 | 56 | (this, | 56 | (this, |
1789 | 57 | hmargin(), vmargin(), get_inner_w() - 2 * hmargin(), BUTTON_HEIGHT, | 57 | hmargin(), vmargin(), get_inner_w() - 2 * hmargin(), BUTTON_HEIGHT, |
1790 | 58 | _("Increase/Decrease Value"), UI::Align::kBottomCenter), | 58 | _("Increase/Decrease Value"), UI::Align::kBottomCenter), |
1792 | 59 | m_change_by_increase | 59 | change_by_increase_ |
1793 | 60 | (this, "incr_change_by", | 60 | (this, "incr_change_by", |
1794 | 61 | get_inner_w() - hmargin() - BUTTON_WIDTH, | 61 | get_inner_w() - hmargin() - BUTTON_WIDTH, |
1796 | 62 | m_change_by_label.get_y() + m_change_by_label.get_h() + spacing(), | 62 | change_by_label_.get_y() + change_by_label_.get_h() + spacing(), |
1797 | 63 | BUTTON_WIDTH, BUTTON_HEIGHT, | 63 | BUTTON_WIDTH, BUTTON_HEIGHT, |
1798 | 64 | g_gr->images().get("images/ui_basic/but1.png"), | 64 | g_gr->images().get("images/ui_basic/but1.png"), |
1799 | 65 | g_gr->images().get("images/ui_basic/scrollbar_up.png")), | 65 | g_gr->images().get("images/ui_basic/scrollbar_up.png")), |
1801 | 66 | m_change_by_decrease | 66 | change_by_decrease_ |
1802 | 67 | (this, "decr_change_by", | 67 | (this, "decr_change_by", |
1803 | 68 | hmargin(), | 68 | hmargin(), |
1805 | 69 | m_change_by_increase.get_y(), | 69 | change_by_increase_.get_y(), |
1806 | 70 | BUTTON_WIDTH, BUTTON_HEIGHT, | 70 | BUTTON_WIDTH, BUTTON_HEIGHT, |
1807 | 71 | g_gr->images().get("images/ui_basic/but1.png"), | 71 | g_gr->images().get("images/ui_basic/but1.png"), |
1808 | 72 | g_gr->images().get("images/ui_basic/scrollbar_down.png")), | 72 | g_gr->images().get("images/ui_basic/scrollbar_down.png")), |
1810 | 73 | m_change_by_value | 73 | change_by_value_ |
1811 | 74 | (this, | 74 | (this, |
1813 | 75 | m_change_by_increase.get_x() + m_change_by_increase.get_w() + | 75 | change_by_increase_.get_x() + change_by_increase_.get_w() + |
1814 | 76 | hspacing(), | 76 | hspacing(), |
1817 | 77 | m_change_by_increase.get_y(), | 77 | change_by_increase_.get_y(), |
1818 | 78 | m_change_by_decrease.get_x() - hspacing() | 78 | change_by_decrease_.get_x() - hspacing() |
1819 | 79 | - | 79 | - |
1821 | 80 | (m_change_by_increase.get_x() + m_change_by_increase.get_w() + | 80 | (change_by_increase_.get_x() + change_by_increase_.get_w() + |
1822 | 81 | hspacing()), | 81 | hspacing()), |
1823 | 82 | BUTTON_HEIGHT, | 82 | BUTTON_HEIGHT, |
1824 | 83 | UI::Align::kBottomCenter), | 83 | UI::Align::kBottomCenter), |
1826 | 84 | m_set_to_label | 84 | set_to_label_ |
1827 | 85 | (this, | 85 | (this, |
1828 | 86 | vmargin(), | 86 | vmargin(), |
1830 | 87 | m_change_by_increase.get_y() + m_change_by_increase.get_h() + vspacing(), | 87 | change_by_increase_.get_y() + change_by_increase_.get_h() + vspacing(), |
1831 | 88 | get_inner_w() - 2 * hmargin(), BUTTON_HEIGHT, | 88 | get_inner_w() - 2 * hmargin(), BUTTON_HEIGHT, |
1832 | 89 | _("Set Value"), UI::Align::kBottomCenter), | 89 | _("Set Value"), UI::Align::kBottomCenter), |
1834 | 90 | m_set_to_increase | 90 | set_to_increase_ |
1835 | 91 | (this, "incr_set_to", | 91 | (this, "incr_set_to", |
1838 | 92 | m_change_by_increase.get_x(), | 92 | change_by_increase_.get_x(), |
1839 | 93 | m_set_to_label.get_y() + m_set_to_label.get_h() + vspacing(), | 93 | set_to_label_.get_y() + set_to_label_.get_h() + vspacing(), |
1840 | 94 | BUTTON_WIDTH, BUTTON_HEIGHT, | 94 | BUTTON_WIDTH, BUTTON_HEIGHT, |
1841 | 95 | g_gr->images().get("images/ui_basic/but1.png"), | 95 | g_gr->images().get("images/ui_basic/but1.png"), |
1842 | 96 | g_gr->images().get("images/ui_basic/scrollbar_up.png")), | 96 | g_gr->images().get("images/ui_basic/scrollbar_up.png")), |
1844 | 97 | m_set_to_decrease | 97 | set_to_decrease_ |
1845 | 98 | (this, "decr_set_to", | 98 | (this, "decr_set_to", |
1846 | 99 | hmargin(), | 99 | hmargin(), |
1848 | 100 | m_set_to_increase.get_y(), BUTTON_WIDTH, BUTTON_HEIGHT, | 100 | set_to_increase_.get_y(), BUTTON_WIDTH, BUTTON_HEIGHT, |
1849 | 101 | g_gr->images().get("images/ui_basic/but1.png"), | 101 | g_gr->images().get("images/ui_basic/but1.png"), |
1850 | 102 | g_gr->images().get("images/ui_basic/scrollbar_down.png")), | 102 | g_gr->images().get("images/ui_basic/scrollbar_down.png")), |
1852 | 103 | m_set_to_value | 103 | set_to_value_ |
1853 | 104 | (this, | 104 | (this, |
1856 | 105 | m_change_by_value.get_x(), m_set_to_increase.get_y(), | 105 | change_by_value_.get_x(), set_to_increase_.get_y(), |
1857 | 106 | m_change_by_value.get_w(), BUTTON_HEIGHT, | 106 | change_by_value_.get_w(), BUTTON_HEIGHT, |
1858 | 107 | UI::Align::kBottomCenter), | 107 | UI::Align::kBottomCenter), |
1861 | 108 | m_cur_selection(this, 0, 0, _("Current Selection"), UI::Align::kBottomCenter), | 108 | cur_selection_(this, 0, 0, _("Current Selection"), UI::Align::kBottomCenter), |
1862 | 109 | m_increase_tool(increase_tool) | 109 | increase_tool_(increase_tool) |
1863 | 110 | { | 110 | { |
1865 | 111 | m_change_by_increase.sigclicked.connect | 111 | change_by_increase_.sigclicked.connect |
1866 | 112 | (boost::bind | 112 | (boost::bind |
1867 | 113 | (&EditorToolChangeResourcesOptionsMenu::clicked_button, | 113 | (&EditorToolChangeResourcesOptionsMenu::clicked_button, |
1868 | 114 | boost::ref(*this), | 114 | boost::ref(*this), |
1869 | 115 | Change_By_Increase)); | 115 | Change_By_Increase)); |
1871 | 116 | m_change_by_decrease.sigclicked.connect | 116 | change_by_decrease_.sigclicked.connect |
1872 | 117 | (boost::bind | 117 | (boost::bind |
1873 | 118 | (&EditorToolChangeResourcesOptionsMenu::clicked_button, | 118 | (&EditorToolChangeResourcesOptionsMenu::clicked_button, |
1874 | 119 | boost::ref(*this), | 119 | boost::ref(*this), |
1875 | 120 | Change_By_Decrease)); | 120 | Change_By_Decrease)); |
1877 | 121 | m_set_to_increase.sigclicked.connect | 121 | set_to_increase_.sigclicked.connect |
1878 | 122 | (boost::bind | 122 | (boost::bind |
1879 | 123 | (&EditorToolChangeResourcesOptionsMenu::clicked_button, | 123 | (&EditorToolChangeResourcesOptionsMenu::clicked_button, |
1880 | 124 | boost::ref(*this), | 124 | boost::ref(*this), |
1881 | 125 | Set_To_Increase)); | 125 | Set_To_Increase)); |
1883 | 126 | m_set_to_decrease.sigclicked.connect | 126 | set_to_decrease_.sigclicked.connect |
1884 | 127 | (boost::bind | 127 | (boost::bind |
1885 | 128 | (&EditorToolChangeResourcesOptionsMenu::clicked_button, | 128 | (&EditorToolChangeResourcesOptionsMenu::clicked_button, |
1886 | 129 | boost::ref(*this), | 129 | boost::ref(*this), |
1887 | 130 | Set_To_Decrease)); | 130 | Set_To_Decrease)); |
1888 | 131 | 131 | ||
1893 | 132 | m_change_by_increase.set_repeating(true); | 132 | change_by_increase_.set_repeating(true); |
1894 | 133 | m_change_by_decrease.set_repeating(true); | 133 | change_by_decrease_.set_repeating(true); |
1895 | 134 | m_set_to_increase .set_repeating(true); | 134 | set_to_increase_ .set_repeating(true); |
1896 | 135 | m_set_to_decrease .set_repeating(true); | 135 | set_to_decrease_ .set_repeating(true); |
1897 | 136 | const Widelands::World & world = parent.egbase().world(); | 136 | const Widelands::World & world = parent.egbase().world(); |
1898 | 137 | Widelands::DescriptionIndex const nr_resources = world.get_nr_resources(); | 137 | Widelands::DescriptionIndex const nr_resources = world.get_nr_resources(); |
1899 | 138 | 138 | ||
1900 | @@ -149,14 +149,14 @@ | |||
1901 | 149 | / | 149 | / |
1902 | 150 | (resource_pic_max_width + spacing()); | 150 | (resource_pic_max_width + spacing()); |
1903 | 151 | 151 | ||
1905 | 152 | m_radiogroup.changed.connect | 152 | radiogroup_.changed.connect |
1906 | 153 | (boost::bind(&EditorToolChangeResourcesOptionsMenu::selected, this)); | 153 | (boost::bind(&EditorToolChangeResourcesOptionsMenu::selected, this)); |
1908 | 154 | m_radiogroup.clicked.connect | 154 | radiogroup_.clicked.connect |
1909 | 155 | (boost::bind(&EditorToolChangeResourcesOptionsMenu::selected, this)); | 155 | (boost::bind(&EditorToolChangeResourcesOptionsMenu::selected, this)); |
1910 | 156 | 156 | ||
1911 | 157 | uint16_t cur_x = 0; | 157 | uint16_t cur_x = 0; |
1912 | 158 | Point pos | 158 | Point pos |
1914 | 159 | (hmargin(), m_set_to_value.get_y() + m_set_to_value.get_h() + vspacing()); | 159 | (hmargin(), set_to_value_.get_y() + set_to_value_.get_h() + vspacing()); |
1915 | 160 | for | 160 | for |
1916 | 161 | (Widelands::DescriptionIndex i = 0; | 161 | (Widelands::DescriptionIndex i = 0; |
1917 | 162 | i < nr_resources; | 162 | i < nr_resources; |
1918 | @@ -167,17 +167,17 @@ | |||
1919 | 167 | pos.x = hmargin(); | 167 | pos.x = hmargin(); |
1920 | 168 | pos.y += resource_pic_max_height + vspacing(); | 168 | pos.y += resource_pic_max_height + vspacing(); |
1921 | 169 | } | 169 | } |
1923 | 170 | m_radiogroup.add_button | 170 | radiogroup_.add_button |
1924 | 171 | (this, | 171 | (this, |
1925 | 172 | pos, | 172 | pos, |
1926 | 173 | g_gr->images().get(world.get_resource(i)->representative_image())); | 173 | g_gr->images().get(world.get_resource(i)->representative_image())); |
1927 | 174 | } | 174 | } |
1928 | 175 | pos.y += resource_pic_max_height + vspacing(); | 175 | pos.y += resource_pic_max_height + vspacing(); |
1929 | 176 | 176 | ||
1932 | 177 | set_inner_size(get_inner_w(), pos.y + m_cur_selection.get_h() + vmargin()); | 177 | set_inner_size(get_inner_w(), pos.y + cur_selection_.get_h() + vmargin()); |
1933 | 178 | m_cur_selection.set_pos(Point(get_inner_w() / 2, pos.y + hspacing())); | 178 | cur_selection_.set_pos(Point(get_inner_w() / 2, pos.y + hspacing())); |
1934 | 179 | 179 | ||
1936 | 180 | m_radiogroup.set_state(m_increase_tool.get_cur_res()); | 180 | radiogroup_.set_state(increase_tool_.get_cur_res()); |
1937 | 181 | 181 | ||
1938 | 182 | update(); | 182 | update(); |
1939 | 183 | } | 183 | } |
1940 | @@ -186,12 +186,12 @@ | |||
1941 | 186 | void EditorToolChangeResourcesOptionsMenu::clicked_button(Button const n) | 186 | void EditorToolChangeResourcesOptionsMenu::clicked_button(Button const n) |
1942 | 187 | { | 187 | { |
1943 | 188 | assert | 188 | assert |
1945 | 189 | (m_increase_tool.get_change_by() | 189 | (increase_tool_.get_change_by() |
1946 | 190 | == | 190 | == |
1948 | 191 | m_increase_tool.decrease_tool().get_change_by()); | 191 | increase_tool_.decrease_tool().get_change_by()); |
1949 | 192 | 192 | ||
1952 | 193 | int32_t change_by = m_increase_tool.get_change_by(); | 193 | int32_t change_by = increase_tool_.get_change_by(); |
1953 | 194 | int32_t set_to = m_increase_tool.set_tool().get_set_to(); | 194 | int32_t set_to = increase_tool_.set_tool().get_set_to(); |
1954 | 195 | 195 | ||
1955 | 196 | switch (n) { | 196 | switch (n) { |
1956 | 197 | case Change_By_Increase: change_by += change_by < 63; break; | 197 | case Change_By_Increase: change_by += change_by < 63; break; |
1957 | @@ -202,9 +202,9 @@ | |||
1958 | 202 | NEVER_HERE(); | 202 | NEVER_HERE(); |
1959 | 203 | break; | 203 | break; |
1960 | 204 | } | 204 | } |
1964 | 205 | m_increase_tool.set_change_by(change_by); | 205 | increase_tool_.set_change_by(change_by); |
1965 | 206 | m_increase_tool.decrease_tool().set_change_by(change_by); | 206 | increase_tool_.decrease_tool().set_change_by(change_by); |
1966 | 207 | m_increase_tool.set_tool().set_set_to(set_to); | 207 | increase_tool_.set_tool().set_set_to(set_to); |
1967 | 208 | 208 | ||
1968 | 209 | select_correct_tool(); | 209 | select_correct_tool(); |
1969 | 210 | update(); | 210 | update(); |
1970 | @@ -214,11 +214,11 @@ | |||
1971 | 214 | * called when a resource has been selected | 214 | * called when a resource has been selected |
1972 | 215 | */ | 215 | */ |
1973 | 216 | void EditorToolChangeResourcesOptionsMenu::selected() { | 216 | void EditorToolChangeResourcesOptionsMenu::selected() { |
1975 | 217 | const int32_t resIx = m_radiogroup.get_state(); | 217 | const int32_t resIx = radiogroup_.get_state(); |
1976 | 218 | 218 | ||
1980 | 219 | m_increase_tool.set_tool().set_cur_res(resIx); | 219 | increase_tool_.set_tool().set_cur_res(resIx); |
1981 | 220 | m_increase_tool.set_cur_res(resIx); | 220 | increase_tool_.set_cur_res(resIx); |
1982 | 221 | m_increase_tool.decrease_tool().set_cur_res(resIx); | 221 | increase_tool_.decrease_tool().set_cur_res(resIx); |
1983 | 222 | 222 | ||
1984 | 223 | Widelands::EditorGameBase& egbase = eia().egbase(); | 223 | Widelands::EditorGameBase& egbase = eia().egbase(); |
1985 | 224 | Widelands::Map & map = egbase.map(); | 224 | Widelands::Map & map = egbase.map(); |
1986 | @@ -241,25 +241,25 @@ | |||
1987 | 241 | */ | 241 | */ |
1988 | 242 | void EditorToolChangeResourcesOptionsMenu::update() { | 242 | void EditorToolChangeResourcesOptionsMenu::update() { |
1989 | 243 | 243 | ||
1998 | 244 | m_change_by_value.set_text(std::to_string(m_increase_tool.get_change_by())); | 244 | change_by_value_.set_text(std::to_string(increase_tool_.get_change_by())); |
1999 | 245 | 245 | ||
2000 | 246 | m_set_to_value.set_text(std::to_string( | 246 | set_to_value_.set_text(std::to_string( |
2001 | 247 | static_cast<unsigned int>(m_increase_tool.set_tool().get_set_to()))); | 247 | static_cast<unsigned int>(increase_tool_.set_tool().get_set_to()))); |
2002 | 248 | 248 | ||
2003 | 249 | m_cur_selection.set_text | 249 | cur_selection_.set_text |
2004 | 250 | (eia().egbase().world().get_resource(m_increase_tool.set_tool().get_cur_res())->descname()); | 250 | (eia().egbase().world().get_resource(increase_tool_.set_tool().get_cur_res())->descname()); |
2005 | 251 | m_cur_selection.set_pos | 251 | cur_selection_.set_pos |
2006 | 252 | (Point | 252 | (Point |
2008 | 253 | ((get_inner_w() - m_cur_selection.get_w()) / 2, get_inner_h() - 20)); | 253 | ((get_inner_w() - cur_selection_.get_w()) / 2, get_inner_h() - 20)); |
2009 | 254 | 254 | ||
2010 | 255 | { | 255 | { |
2014 | 256 | int32_t const change_by = m_increase_tool.get_change_by(); | 256 | int32_t const change_by = increase_tool_.get_change_by(); |
2015 | 257 | m_change_by_decrease.set_enabled(1 < change_by); | 257 | change_by_decrease_.set_enabled(1 < change_by); |
2016 | 258 | m_change_by_increase.set_enabled (change_by < 63); | 258 | change_by_increase_.set_enabled (change_by < 63); |
2017 | 259 | } | 259 | } |
2018 | 260 | { | 260 | { |
2022 | 261 | int32_t const set_to = m_increase_tool.set_tool().get_set_to(); | 261 | int32_t const set_to = increase_tool_.set_tool().get_set_to(); |
2023 | 262 | m_set_to_decrease .set_enabled(0 < set_to); | 262 | set_to_decrease_ .set_enabled(0 < set_to); |
2024 | 263 | m_set_to_increase .set_enabled (set_to < 63); | 263 | set_to_increase_ .set_enabled (set_to < 63); |
2025 | 264 | } | 264 | } |
2026 | 265 | } | 265 | } |
2027 | 266 | 266 | ||
2028 | === modified file 'src/editor/ui_menus/editor_tool_change_resources_options_menu.h' | |||
2029 | --- src/editor/ui_menus/editor_tool_change_resources_options_menu.h 2016-01-16 12:55:14 +0000 | |||
2030 | +++ src/editor/ui_menus/editor_tool_change_resources_options_menu.h 2016-03-18 12:52:47 +0000 | |||
2031 | @@ -45,15 +45,15 @@ | |||
2032 | 45 | }; | 45 | }; |
2033 | 46 | void clicked_button(Button); | 46 | void clicked_button(Button); |
2034 | 47 | void update(); | 47 | void update(); |
2044 | 48 | UI::Textarea m_change_by_label; | 48 | UI::Textarea change_by_label_; |
2045 | 49 | UI::Button m_change_by_increase, m_change_by_decrease; | 49 | UI::Button change_by_increase_, change_by_decrease_; |
2046 | 50 | UI::Textarea m_change_by_value; | 50 | UI::Textarea change_by_value_; |
2047 | 51 | UI::Textarea m_set_to_label; | 51 | UI::Textarea set_to_label_; |
2048 | 52 | UI::Button m_set_to_increase, m_set_to_decrease; | 52 | UI::Button set_to_increase_, set_to_decrease_; |
2049 | 53 | UI::Textarea m_set_to_value; | 53 | UI::Textarea set_to_value_; |
2050 | 54 | UI::Textarea m_cur_selection; | 54 | UI::Textarea cur_selection_; |
2051 | 55 | UI::Radiogroup m_radiogroup; | 55 | UI::Radiogroup radiogroup_; |
2052 | 56 | EditorIncreaseResourcesTool & m_increase_tool; | 56 | EditorIncreaseResourcesTool& increase_tool_; |
2053 | 57 | }; | 57 | }; |
2054 | 58 | 58 | ||
2055 | 59 | #endif // end of include guard: WL_EDITOR_UI_MENUS_EDITOR_TOOL_CHANGE_RESOURCES_OPTIONS_MENU_H | 59 | #endif // end of include guard: WL_EDITOR_UI_MENUS_EDITOR_TOOL_CHANGE_RESOURCES_OPTIONS_MENU_H |
2056 | 60 | 60 | ||
2057 | === modified file 'src/editor/ui_menus/editor_tool_noise_height_options_menu.cc' | |||
2058 | --- src/editor/ui_menus/editor_tool_noise_height_options_menu.cc 2016-01-29 08:37:22 +0000 | |||
2059 | +++ src/editor/ui_menus/editor_tool_noise_height_options_menu.cc 2016-03-18 12:52:47 +0000 | |||
2060 | @@ -43,99 +43,99 @@ | |||
2061 | 43 | : | 43 | : |
2062 | 44 | EditorToolOptionsMenu | 44 | EditorToolOptionsMenu |
2063 | 45 | (parent, registry, 250, 3 * height + 4 * vspacing() + 2 * vmargin(), _("Noise Height Options")), | 45 | (parent, registry, 250, 3 * height + 4 * vspacing() + 2 * vmargin(), _("Noise Height Options")), |
2066 | 46 | m_noise_tool(noise_tool), | 46 | noise_tool_(noise_tool), |
2067 | 47 | m_lower_label | 47 | lower_label_ |
2068 | 48 | (this, | 48 | (this, |
2069 | 49 | hmargin(), | 49 | hmargin(), |
2070 | 50 | vmargin(), | 50 | vmargin(), |
2071 | 51 | width, height, | 51 | width, height, |
2072 | 52 | UI::Align::kLeft), | 52 | UI::Align::kLeft), |
2074 | 53 | m_upper_label | 53 | upper_label_ |
2075 | 54 | (this, | 54 | (this, |
2076 | 55 | hmargin(), | 55 | hmargin(), |
2078 | 56 | m_lower_label.get_y() + m_lower_label.get_h() + 2 * vspacing(), | 56 | lower_label_.get_y() + lower_label_.get_h() + 2 * vspacing(), |
2079 | 57 | width, height, | 57 | width, height, |
2080 | 58 | UI::Align::kLeft), | 58 | UI::Align::kLeft), |
2082 | 59 | m_lower_decrease | 59 | lower_decrease_ |
2083 | 60 | (this, "decr_lower", | 60 | (this, "decr_lower", |
2084 | 61 | get_inner_w() - 2 * width - hspacing(), | 61 | get_inner_w() - 2 * width - hspacing(), |
2086 | 62 | m_lower_label.get_y(), | 62 | lower_label_.get_y(), |
2087 | 63 | width, height, | 63 | width, height, |
2088 | 64 | g_gr->images().get("images/ui_basic/but0.png"), | 64 | g_gr->images().get("images/ui_basic/but0.png"), |
2089 | 65 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), | 65 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), |
2090 | 66 | std::string(), | 66 | std::string(), |
2091 | 67 | 0 < noise_tool.get_interval().min), | 67 | 0 < noise_tool.get_interval().min), |
2093 | 68 | m_lower_increase | 68 | lower_increase_ |
2094 | 69 | (this, "incr_lower", | 69 | (this, "incr_lower", |
2095 | 70 | get_inner_w() - width - hspacing(), | 70 | get_inner_w() - width - hspacing(), |
2097 | 71 | m_lower_label.get_y(), | 71 | lower_label_.get_y(), |
2098 | 72 | width, height, | 72 | width, height, |
2099 | 73 | g_gr->images().get("images/ui_basic/but0.png"), | 73 | g_gr->images().get("images/ui_basic/but0.png"), |
2100 | 74 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), | 74 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), |
2101 | 75 | std::string(), | 75 | std::string(), |
2102 | 76 | noise_tool.get_interval().min < MAX_FIELD_HEIGHT), | 76 | noise_tool.get_interval().min < MAX_FIELD_HEIGHT), |
2104 | 77 | m_upper_decrease | 77 | upper_decrease_ |
2105 | 78 | (this, "decr_upper", | 78 | (this, "decr_upper", |
2106 | 79 | get_inner_w() - 2 * width - hspacing(), | 79 | get_inner_w() - 2 * width - hspacing(), |
2108 | 80 | m_upper_label.get_y(), | 80 | upper_label_.get_y(), |
2109 | 81 | width, height, | 81 | width, height, |
2110 | 82 | g_gr->images().get("images/ui_basic/but0.png"), | 82 | g_gr->images().get("images/ui_basic/but0.png"), |
2111 | 83 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), | 83 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), |
2112 | 84 | std::string(), | 84 | std::string(), |
2113 | 85 | 0 < noise_tool.get_interval().max), | 85 | 0 < noise_tool.get_interval().max), |
2115 | 86 | m_upper_increase | 86 | upper_increase_ |
2116 | 87 | (this, "incr_upper", | 87 | (this, "incr_upper", |
2117 | 88 | get_inner_w() - width - hspacing(), | 88 | get_inner_w() - width - hspacing(), |
2119 | 89 | m_upper_label.get_y(), | 89 | upper_label_.get_y(), |
2120 | 90 | width, height, | 90 | width, height, |
2121 | 91 | g_gr->images().get("images/ui_basic/but0.png"), | 91 | g_gr->images().get("images/ui_basic/but0.png"), |
2122 | 92 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), | 92 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), |
2123 | 93 | std::string(), | 93 | std::string(), |
2124 | 94 | noise_tool.get_interval().max < MAX_FIELD_HEIGHT), | 94 | noise_tool.get_interval().max < MAX_FIELD_HEIGHT), |
2126 | 95 | m_set_label | 95 | set_label_ |
2127 | 96 | (this, | 96 | (this, |
2128 | 97 | hmargin(), | 97 | hmargin(), |
2130 | 98 | m_upper_label.get_y() + m_upper_label.get_h() + 2 * vspacing(), | 98 | upper_label_.get_y() + upper_label_.get_h() + 2 * vspacing(), |
2131 | 99 | width, height, | 99 | width, height, |
2132 | 100 | UI::Align::kLeft), | 100 | UI::Align::kLeft), |
2134 | 101 | m_setto_decrease | 101 | setto_decrease_ |
2135 | 102 | (this, "decr_set_to", | 102 | (this, "decr_set_to", |
2136 | 103 | get_inner_w() - 2 * width - hspacing(), | 103 | get_inner_w() - 2 * width - hspacing(), |
2138 | 104 | m_set_label.get_y(), | 104 | set_label_.get_y(), |
2139 | 105 | width, height, | 105 | width, height, |
2140 | 106 | g_gr->images().get("images/ui_basic/but1.png"), | 106 | g_gr->images().get("images/ui_basic/but1.png"), |
2141 | 107 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), | 107 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), |
2142 | 108 | std::string(), | 108 | std::string(), |
2143 | 109 | 0 < noise_tool.set_tool().get_interval().min), | 109 | 0 < noise_tool.set_tool().get_interval().min), |
2145 | 110 | m_setto_increase | 110 | setto_increase_ |
2146 | 111 | (this, "incr_set_to", | 111 | (this, "incr_set_to", |
2147 | 112 | get_inner_w() - width - hspacing(), | 112 | get_inner_w() - width - hspacing(), |
2149 | 113 | m_set_label.get_y(), | 113 | set_label_.get_y(), |
2150 | 114 | width, height, | 114 | width, height, |
2151 | 115 | g_gr->images().get("images/ui_basic/but1.png"), | 115 | g_gr->images().get("images/ui_basic/but1.png"), |
2152 | 116 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), | 116 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), |
2153 | 117 | std::string(), | 117 | std::string(), |
2154 | 118 | noise_tool.set_tool().get_interval().max < MAX_FIELD_HEIGHT) | 118 | noise_tool.set_tool().get_interval().max < MAX_FIELD_HEIGHT) |
2155 | 119 | { | 119 | { |
2157 | 120 | m_lower_increase.sigclicked.connect | 120 | lower_increase_.sigclicked.connect |
2158 | 121 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_lower_increase, boost::ref(*this))); | 121 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_lower_increase, boost::ref(*this))); |
2160 | 122 | m_lower_decrease.sigclicked.connect | 122 | lower_decrease_.sigclicked.connect |
2161 | 123 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_lower_decrease, boost::ref(*this))); | 123 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_lower_decrease, boost::ref(*this))); |
2163 | 124 | m_upper_increase.sigclicked.connect | 124 | upper_increase_.sigclicked.connect |
2164 | 125 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_upper_increase, boost::ref(*this))); | 125 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_upper_increase, boost::ref(*this))); |
2166 | 126 | m_upper_decrease.sigclicked.connect | 126 | upper_decrease_.sigclicked.connect |
2167 | 127 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_upper_decrease, boost::ref(*this))); | 127 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_upper_decrease, boost::ref(*this))); |
2169 | 128 | m_setto_increase.sigclicked.connect | 128 | setto_increase_.sigclicked.connect |
2170 | 129 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_setto_increase, boost::ref(*this))); | 129 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_setto_increase, boost::ref(*this))); |
2172 | 130 | m_setto_decrease.sigclicked.connect | 130 | setto_decrease_.sigclicked.connect |
2173 | 131 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_setto_decrease, boost::ref(*this))); | 131 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_setto_decrease, boost::ref(*this))); |
2174 | 132 | 132 | ||
2181 | 133 | m_lower_increase.set_repeating(true); | 133 | lower_increase_.set_repeating(true); |
2182 | 134 | m_lower_decrease.set_repeating(true); | 134 | lower_decrease_.set_repeating(true); |
2183 | 135 | m_upper_increase.set_repeating(true); | 135 | upper_increase_.set_repeating(true); |
2184 | 136 | m_upper_decrease.set_repeating(true); | 136 | upper_decrease_.set_repeating(true); |
2185 | 137 | m_setto_increase.set_repeating(true); | 137 | setto_increase_.set_repeating(true); |
2186 | 138 | m_setto_decrease.set_repeating(true); | 138 | setto_decrease_.set_repeating(true); |
2187 | 139 | update(); | 139 | update(); |
2188 | 140 | } | 140 | } |
2189 | 141 | 141 | ||
2190 | @@ -143,23 +143,23 @@ | |||
2191 | 143 | * Update all textareas | 143 | * Update all textareas |
2192 | 144 | */ | 144 | */ |
2193 | 145 | void EditorToolNoiseHeightOptionsMenu::update() { | 145 | void EditorToolNoiseHeightOptionsMenu::update() { |
2195 | 146 | const Widelands::HeightInterval height_interval = m_noise_tool.get_interval(); | 146 | const Widelands::HeightInterval height_interval = noise_tool_.get_interval(); |
2196 | 147 | 147 | ||
2198 | 148 | m_lower_label.set_text((boost::format(_("Minimum: %u")) | 148 | lower_label_.set_text((boost::format(_("Minimum: %u")) |
2199 | 149 | % static_cast<unsigned int>(height_interval.min)).str()); | 149 | % static_cast<unsigned int>(height_interval.min)).str()); |
2200 | 150 | 150 | ||
2202 | 151 | m_upper_label.set_text((boost::format(_("Maximum: %u")) | 151 | upper_label_.set_text((boost::format(_("Maximum: %u")) |
2203 | 152 | % static_cast<unsigned int>(height_interval.max)).str()); | 152 | % static_cast<unsigned int>(height_interval.max)).str()); |
2204 | 153 | 153 | ||
2207 | 154 | m_set_label.set_text((boost::format(_("Set value: %u")) | 154 | set_label_.set_text((boost::format(_("Set value: %u")) |
2208 | 155 | % static_cast<unsigned int>(m_noise_tool.set_tool().get_interval().min)).str()); | 155 | % static_cast<unsigned int>(noise_tool_.set_tool().get_interval().min)).str()); |
2209 | 156 | 156 | ||
2210 | 157 | select_correct_tool(); | 157 | select_correct_tool(); |
2211 | 158 | } | 158 | } |
2212 | 159 | 159 | ||
2213 | 160 | 160 | ||
2214 | 161 | void EditorToolNoiseHeightOptionsMenu::clicked_lower_decrease() { | 161 | void EditorToolNoiseHeightOptionsMenu::clicked_lower_decrease() { |
2216 | 162 | Widelands::HeightInterval height_interval = m_noise_tool.get_interval(); | 162 | Widelands::HeightInterval height_interval = noise_tool_.get_interval(); |
2217 | 163 | 163 | ||
2218 | 164 | assert(height_interval.valid()); | 164 | assert(height_interval.valid()); |
2219 | 165 | assert(0 < height_interval.min); | 165 | assert(0 < height_interval.min); |
2220 | @@ -168,15 +168,15 @@ | |||
2221 | 168 | 168 | ||
2222 | 169 | assert(height_interval.valid()); | 169 | assert(height_interval.valid()); |
2223 | 170 | 170 | ||
2227 | 171 | m_noise_tool.set_interval(height_interval); | 171 | noise_tool_.set_interval(height_interval); |
2228 | 172 | m_lower_decrease.set_enabled(0 < height_interval.min); | 172 | lower_decrease_.set_enabled(0 < height_interval.min); |
2229 | 173 | m_lower_increase.set_enabled(true); | 173 | lower_increase_.set_enabled(true); |
2230 | 174 | update(); | 174 | update(); |
2231 | 175 | } | 175 | } |
2232 | 176 | 176 | ||
2233 | 177 | 177 | ||
2234 | 178 | void EditorToolNoiseHeightOptionsMenu::clicked_lower_increase() { | 178 | void EditorToolNoiseHeightOptionsMenu::clicked_lower_increase() { |
2236 | 179 | Widelands::HeightInterval height_interval = m_noise_tool.get_interval(); | 179 | Widelands::HeightInterval height_interval = noise_tool_.get_interval(); |
2237 | 180 | 180 | ||
2238 | 181 | assert(height_interval.valid()); | 181 | assert(height_interval.valid()); |
2239 | 182 | assert(height_interval.min < MAX_FIELD_HEIGHT); | 182 | assert(height_interval.min < MAX_FIELD_HEIGHT); |
2240 | @@ -186,55 +186,55 @@ | |||
2241 | 186 | 186 | ||
2242 | 187 | assert(height_interval.valid()); | 187 | assert(height_interval.valid()); |
2243 | 188 | 188 | ||
2249 | 189 | m_noise_tool.set_interval(height_interval); | 189 | noise_tool_.set_interval(height_interval); |
2250 | 190 | m_lower_decrease.set_enabled(true); | 190 | lower_decrease_.set_enabled(true); |
2251 | 191 | m_lower_increase.set_enabled(height_interval.min < MAX_FIELD_HEIGHT); | 191 | lower_increase_.set_enabled(height_interval.min < MAX_FIELD_HEIGHT); |
2252 | 192 | m_upper_decrease.set_enabled(true); | 192 | upper_decrease_.set_enabled(true); |
2253 | 193 | m_upper_increase.set_enabled(height_interval.max < MAX_FIELD_HEIGHT); | 193 | upper_increase_.set_enabled(height_interval.max < MAX_FIELD_HEIGHT); |
2254 | 194 | 194 | ||
2255 | 195 | update(); | 195 | update(); |
2256 | 196 | } | 196 | } |
2257 | 197 | 197 | ||
2258 | 198 | 198 | ||
2259 | 199 | void EditorToolNoiseHeightOptionsMenu::clicked_upper_decrease() { | 199 | void EditorToolNoiseHeightOptionsMenu::clicked_upper_decrease() { |
2261 | 200 | Widelands::HeightInterval height_interval = m_noise_tool.get_interval(); | 200 | Widelands::HeightInterval height_interval = noise_tool_.get_interval(); |
2262 | 201 | 201 | ||
2263 | 202 | assert(height_interval.valid()); | 202 | assert(height_interval.valid()); |
2265 | 203 | assert(0 < m_noise_tool.get_interval().max); | 203 | assert(0 < noise_tool_.get_interval().max); |
2266 | 204 | 204 | ||
2267 | 205 | --height_interval.max; | 205 | --height_interval.max; |
2268 | 206 | height_interval.min = std::min(height_interval.min, height_interval.max); | 206 | height_interval.min = std::min(height_interval.min, height_interval.max); |
2269 | 207 | 207 | ||
2270 | 208 | assert(height_interval.valid()); | 208 | assert(height_interval.valid()); |
2271 | 209 | 209 | ||
2277 | 210 | m_noise_tool.set_interval(height_interval); | 210 | noise_tool_.set_interval(height_interval); |
2278 | 211 | m_lower_decrease.set_enabled(0 < height_interval.min); | 211 | lower_decrease_.set_enabled(0 < height_interval.min); |
2279 | 212 | m_lower_increase.set_enabled(true); | 212 | lower_increase_.set_enabled(true); |
2280 | 213 | m_upper_decrease.set_enabled(0 < height_interval.max); | 213 | upper_decrease_.set_enabled(0 < height_interval.max); |
2281 | 214 | m_upper_increase.set_enabled(true); | 214 | upper_increase_.set_enabled(true); |
2282 | 215 | update(); | 215 | update(); |
2283 | 216 | } | 216 | } |
2284 | 217 | 217 | ||
2285 | 218 | 218 | ||
2286 | 219 | void EditorToolNoiseHeightOptionsMenu::clicked_upper_increase() { | 219 | void EditorToolNoiseHeightOptionsMenu::clicked_upper_increase() { |
2288 | 220 | Widelands::HeightInterval height_interval = m_noise_tool.get_interval(); | 220 | Widelands::HeightInterval height_interval = noise_tool_.get_interval(); |
2289 | 221 | 221 | ||
2292 | 222 | assert(m_noise_tool.get_interval().valid()); | 222 | assert(noise_tool_.get_interval().valid()); |
2293 | 223 | assert(m_noise_tool.get_interval().max < MAX_FIELD_HEIGHT); | 223 | assert(noise_tool_.get_interval().max < MAX_FIELD_HEIGHT); |
2294 | 224 | 224 | ||
2295 | 225 | ++height_interval.max; | 225 | ++height_interval.max; |
2296 | 226 | 226 | ||
2298 | 227 | assert(m_noise_tool.get_interval().valid()); | 227 | assert(noise_tool_.get_interval().valid()); |
2299 | 228 | 228 | ||
2303 | 229 | m_noise_tool.set_interval(height_interval); | 229 | noise_tool_.set_interval(height_interval); |
2304 | 230 | m_upper_decrease.set_enabled(true); | 230 | upper_decrease_.set_enabled(true); |
2305 | 231 | m_upper_increase.set_enabled(height_interval.max < MAX_FIELD_HEIGHT); | 231 | upper_increase_.set_enabled(height_interval.max < MAX_FIELD_HEIGHT); |
2306 | 232 | update(); | 232 | update(); |
2307 | 233 | } | 233 | } |
2308 | 234 | 234 | ||
2309 | 235 | 235 | ||
2310 | 236 | void EditorToolNoiseHeightOptionsMenu::clicked_setto_decrease() { | 236 | void EditorToolNoiseHeightOptionsMenu::clicked_setto_decrease() { |
2312 | 237 | EditorSetHeightTool & set_tool = m_noise_tool.set_tool(); | 237 | EditorSetHeightTool & set_tool = noise_tool_.set_tool(); |
2313 | 238 | Field::Height h = set_tool.get_interval().min; | 238 | Field::Height h = set_tool.get_interval().min; |
2314 | 239 | 239 | ||
2315 | 240 | assert(h == set_tool.get_interval().max); | 240 | assert(h == set_tool.get_interval().max); |
2316 | @@ -243,14 +243,14 @@ | |||
2317 | 243 | --h; | 243 | --h; |
2318 | 244 | 244 | ||
2319 | 245 | set_tool.set_interval(Widelands::HeightInterval(h, h)); | 245 | set_tool.set_interval(Widelands::HeightInterval(h, h)); |
2322 | 246 | m_setto_decrease.set_enabled(0 < h); | 246 | setto_decrease_.set_enabled(0 < h); |
2323 | 247 | m_setto_increase.set_enabled(true); | 247 | setto_increase_.set_enabled(true); |
2324 | 248 | update(); | 248 | update(); |
2325 | 249 | } | 249 | } |
2326 | 250 | 250 | ||
2327 | 251 | 251 | ||
2328 | 252 | void EditorToolNoiseHeightOptionsMenu::clicked_setto_increase() { | 252 | void EditorToolNoiseHeightOptionsMenu::clicked_setto_increase() { |
2330 | 253 | EditorSetHeightTool & set_tool = m_noise_tool.set_tool(); | 253 | EditorSetHeightTool & set_tool = noise_tool_.set_tool(); |
2331 | 254 | Field::Height h = set_tool.get_interval().min; | 254 | Field::Height h = set_tool.get_interval().min; |
2332 | 255 | 255 | ||
2333 | 256 | assert(h == set_tool.get_interval().max); | 256 | assert(h == set_tool.get_interval().max); |
2334 | @@ -259,7 +259,7 @@ | |||
2335 | 259 | ++h; | 259 | ++h; |
2336 | 260 | 260 | ||
2337 | 261 | set_tool.set_interval(Widelands::HeightInterval(h, h)); | 261 | set_tool.set_interval(Widelands::HeightInterval(h, h)); |
2340 | 262 | m_setto_decrease.set_enabled(true); | 262 | setto_decrease_.set_enabled(true); |
2341 | 263 | m_setto_increase.set_enabled(h < MAX_FIELD_HEIGHT); | 263 | setto_increase_.set_enabled(h < MAX_FIELD_HEIGHT); |
2342 | 264 | update(); | 264 | update(); |
2343 | 265 | } | 265 | } |
2344 | 266 | 266 | ||
2345 | === modified file 'src/editor/ui_menus/editor_tool_noise_height_options_menu.h' | |||
2346 | --- src/editor/ui_menus/editor_tool_noise_height_options_menu.h 2016-01-16 12:55:14 +0000 | |||
2347 | +++ src/editor/ui_menus/editor_tool_noise_height_options_menu.h 2016-03-18 12:52:47 +0000 | |||
2348 | @@ -34,11 +34,11 @@ | |||
2349 | 34 | UI::UniqueWindow::Registry &); | 34 | UI::UniqueWindow::Registry &); |
2350 | 35 | 35 | ||
2351 | 36 | private: | 36 | private: |
2357 | 37 | EditorNoiseHeightTool & m_noise_tool; | 37 | EditorNoiseHeightTool& noise_tool_; |
2358 | 38 | UI::Textarea m_lower_label, m_upper_label; | 38 | UI::Textarea lower_label_, upper_label_; |
2359 | 39 | UI::Button m_lower_decrease, m_lower_increase, m_upper_decrease, m_upper_increase; | 39 | UI::Button lower_decrease_, lower_increase_, upper_decrease_, upper_increase_; |
2360 | 40 | UI::Textarea m_set_label; | 40 | UI::Textarea set_label_; |
2361 | 41 | UI::Button m_setto_decrease, m_setto_increase; | 41 | UI::Button setto_decrease_, setto_increase_; |
2362 | 42 | 42 | ||
2363 | 43 | void clicked_lower_decrease(); | 43 | void clicked_lower_decrease(); |
2364 | 44 | void clicked_lower_increase(); | 44 | void clicked_lower_increase(); |
2365 | 45 | 45 | ||
2366 | === modified file 'src/editor/ui_menus/editor_tool_options_menu.cc' | |||
2367 | --- src/editor/ui_menus/editor_tool_options_menu.cc 2016-01-16 12:55:14 +0000 | |||
2368 | +++ src/editor/ui_menus/editor_tool_options_menu.cc 2016-03-18 12:52:47 +0000 | |||
2369 | @@ -27,7 +27,7 @@ | |||
2370 | 27 | : | 27 | : |
2371 | 28 | UI::UniqueWindow | 28 | UI::UniqueWindow |
2372 | 29 | (&parent, "tool_options_menu", ®istry, width, height, title), | 29 | (&parent, "tool_options_menu", ®istry, width, height, title), |
2374 | 30 | m_current_pointer(parent.tools()->current_pointer) | 30 | current_pointer_(parent.tools()->current_pointer) |
2375 | 31 | { | 31 | { |
2376 | 32 | if (get_usedefaultpos()) | 32 | if (get_usedefaultpos()) |
2377 | 33 | center_to_parent(); | 33 | center_to_parent(); |
2378 | @@ -36,5 +36,5 @@ | |||
2379 | 36 | 36 | ||
2380 | 37 | void EditorToolOptionsMenu::select_correct_tool() { | 37 | void EditorToolOptionsMenu::select_correct_tool() { |
2381 | 38 | dynamic_cast<EditorInteractive&>(*get_parent()) | 38 | dynamic_cast<EditorInteractive&>(*get_parent()) |
2383 | 39 | .select_tool(*m_current_pointer, EditorTool::First); | 39 | .select_tool(*current_pointer_, EditorTool::First); |
2384 | 40 | } | 40 | } |
2385 | 41 | 41 | ||
2386 | === modified file 'src/editor/ui_menus/editor_tool_options_menu.h' | |||
2387 | --- src/editor/ui_menus/editor_tool_options_menu.h 2014-09-10 14:08:25 +0000 | |||
2388 | +++ src/editor/ui_menus/editor_tool_options_menu.h 2016-03-18 12:52:47 +0000 | |||
2389 | @@ -27,7 +27,7 @@ | |||
2390 | 27 | EditorToolOptionsMenu | 27 | EditorToolOptionsMenu |
2391 | 28 | (EditorInteractive & parent, | 28 | (EditorInteractive & parent, |
2392 | 29 | UI::UniqueWindow::Registry &, | 29 | UI::UniqueWindow::Registry &, |
2394 | 30 | const uint32_t widht, const uint32_t height, | 30 | const uint32_t width, const uint32_t height, |
2395 | 31 | char const * title); | 31 | char const * title); |
2396 | 32 | 32 | ||
2397 | 33 | /** | 33 | /** |
2398 | @@ -43,7 +43,7 @@ | |||
2399 | 43 | uint32_t vmargin () const {return spacing();} | 43 | uint32_t vmargin () const {return spacing();} |
2400 | 44 | 44 | ||
2401 | 45 | private: | 45 | private: |
2403 | 46 | EditorTool * m_current_pointer; | 46 | EditorTool * current_pointer_; |
2404 | 47 | }; | 47 | }; |
2405 | 48 | 48 | ||
2406 | 49 | #endif // end of include guard: WL_EDITOR_UI_MENUS_EDITOR_TOOL_OPTIONS_MENU_H | 49 | #endif // end of include guard: WL_EDITOR_UI_MENUS_EDITOR_TOOL_OPTIONS_MENU_H |
2407 | 50 | 50 | ||
2408 | === modified file 'src/editor/ui_menus/editor_tool_place_bob_options_menu.cc' | |||
2409 | --- src/editor/ui_menus/editor_tool_place_bob_options_menu.cc 2016-01-29 08:37:22 +0000 | |||
2410 | +++ src/editor/ui_menus/editor_tool_place_bob_options_menu.cc 2016-03-18 12:52:47 +0000 | |||
2411 | @@ -44,9 +44,9 @@ | |||
2412 | 44 | : | 44 | : |
2413 | 45 | EditorToolOptionsMenu(parent, registry, 100, 100, _("Animals")), | 45 | EditorToolOptionsMenu(parent, registry, 100, 100, _("Animals")), |
2414 | 46 | 46 | ||
2418 | 47 | m_tabpanel (this, 0, 0, g_gr->images().get("images/ui_basic/but1.png")), | 47 | tabpanel_ (this, 0, 0, g_gr->images().get("images/ui_basic/but1.png")), |
2419 | 48 | m_pit (pit), | 48 | pit_ (pit), |
2420 | 49 | m_click_recursion_protect(false) | 49 | click_recursion_protect_(false) |
2421 | 50 | { | 50 | { |
2422 | 51 | int32_t const space = 5; | 51 | int32_t const space = 5; |
2423 | 52 | const Widelands::World & world = parent.egbase().world(); | 52 | const Widelands::World & world = parent.egbase().world(); |
2424 | @@ -58,7 +58,7 @@ | |||
2425 | 58 | 24U), | 58 | 24U), |
2426 | 59 | 12U); | 59 | 12U); |
2427 | 60 | 60 | ||
2429 | 61 | set_center_panel(&m_tabpanel); | 61 | set_center_panel(&tabpanel_); |
2430 | 62 | 62 | ||
2431 | 63 | uint32_t width = 0, height = 0; | 63 | uint32_t width = 0, height = 0; |
2432 | 64 | for (int32_t j = 0; j < nr_bobs; ++j) { | 64 | for (int32_t j = 0; j < nr_bobs; ++j) { |
2433 | @@ -81,8 +81,8 @@ | |||
2434 | 81 | if (cur_x == bobs_in_row) { | 81 | if (cur_x == bobs_in_row) { |
2435 | 82 | cur_x = 0; | 82 | cur_x = 0; |
2436 | 83 | pos = Point(5, 15); | 83 | pos = Point(5, 15); |
2439 | 84 | box = new UI::Box(&m_tabpanel, 0, 0, UI::Box::Horizontal); | 84 | box = new UI::Box(&tabpanel_, 0, 0, UI::Box::Horizontal); |
2440 | 85 | m_tabpanel.add("icons", tab_icon, box); | 85 | tabpanel_.add("icons", tab_icon, box); |
2441 | 86 | } | 86 | } |
2442 | 87 | 87 | ||
2443 | 88 | const Widelands::BobDescr & descr = *world.get_bob_descr(i); | 88 | const Widelands::BobDescr & descr = *world.get_bob_descr(i); |
2444 | @@ -94,9 +94,9 @@ | |||
2445 | 94 | critter_descr ? critter_descr->descname() : std::string()); | 94 | critter_descr ? critter_descr->descname() : std::string()); |
2446 | 95 | 95 | ||
2447 | 96 | cb.set_desired_size(width, height); | 96 | cb.set_desired_size(width, height); |
2449 | 97 | cb.set_state(m_pit.is_enabled(i)); | 97 | cb.set_state(pit_.is_enabled(i)); |
2450 | 98 | cb.changedto.connect(boost::bind(&EditorToolPlaceBobOptionsMenu::clicked, this, i, _1)); | 98 | cb.changedto.connect(boost::bind(&EditorToolPlaceBobOptionsMenu::clicked, this, i, _1)); |
2452 | 99 | m_checkboxes.push_back(&cb); | 99 | checkboxes_.push_back(&cb); |
2453 | 100 | box->add(&cb, UI::Align::kLeft); | 100 | box->add(&cb, UI::Align::kLeft); |
2454 | 101 | box->add_space(space); | 101 | box->add_space(space); |
2455 | 102 | pos.x += width + 1 + space; | 102 | pos.x += width + 1 + space; |
2456 | @@ -104,7 +104,7 @@ | |||
2457 | 104 | ++i; | 104 | ++i; |
2458 | 105 | } | 105 | } |
2459 | 106 | 106 | ||
2461 | 107 | m_tabpanel.activate(0); | 107 | tabpanel_.activate(0); |
2462 | 108 | } | 108 | } |
2463 | 109 | 109 | ||
2464 | 110 | 110 | ||
2465 | @@ -114,7 +114,7 @@ | |||
2466 | 114 | void EditorToolPlaceBobOptionsMenu::clicked | 114 | void EditorToolPlaceBobOptionsMenu::clicked |
2467 | 115 | (int32_t const n, bool const t) | 115 | (int32_t const n, bool const t) |
2468 | 116 | { | 116 | { |
2470 | 117 | if (m_click_recursion_protect) | 117 | if (click_recursion_protect_) |
2471 | 118 | return; | 118 | return; |
2472 | 119 | 119 | ||
2473 | 120 | // TODO(unknown): This code is erroneous. It checks the current key state. What it | 120 | // TODO(unknown): This code is erroneous. It checks the current key state. What it |
2474 | @@ -122,23 +122,23 @@ | |||
2475 | 122 | // TODO(unknown): usage comment for get_key_state. | 122 | // TODO(unknown): usage comment for get_key_state. |
2476 | 123 | const bool multiselect = | 123 | const bool multiselect = |
2477 | 124 | get_key_state(SDL_SCANCODE_LCTRL) | get_key_state(SDL_SCANCODE_RCTRL); | 124 | get_key_state(SDL_SCANCODE_LCTRL) | get_key_state(SDL_SCANCODE_RCTRL); |
2480 | 125 | if (!t && (!multiselect || m_pit.get_nr_enabled() == 1)) { | 125 | if (!t && (!multiselect || pit_.get_nr_enabled() == 1)) { |
2481 | 126 | m_checkboxes[n]->set_state(true); | 126 | checkboxes_[n]->set_state(true); |
2482 | 127 | return; | 127 | return; |
2483 | 128 | } | 128 | } |
2484 | 129 | 129 | ||
2485 | 130 | if (!multiselect) { | 130 | if (!multiselect) { |
2487 | 131 | for (uint32_t i = 0; m_pit.get_nr_enabled(); ++i) m_pit.enable(i, false); | 131 | for (uint32_t i = 0; pit_.get_nr_enabled(); ++i) pit_.enable(i, false); |
2488 | 132 | 132 | ||
2489 | 133 | // disable all checkboxes | 133 | // disable all checkboxes |
2492 | 134 | m_click_recursion_protect = true; | 134 | click_recursion_protect_ = true; |
2493 | 135 | for (uint32_t i = 0; i < m_checkboxes.size(); ++i) { | 135 | for (uint32_t i = 0; i < checkboxes_.size(); ++i) { |
2494 | 136 | if (i != static_cast<uint32_t>(n)) | 136 | if (i != static_cast<uint32_t>(n)) |
2496 | 137 | m_checkboxes[i]->set_state(false); | 137 | checkboxes_[i]->set_state(false); |
2497 | 138 | } | 138 | } |
2499 | 139 | m_click_recursion_protect = false; | 139 | click_recursion_protect_ = false; |
2500 | 140 | } | 140 | } |
2501 | 141 | 141 | ||
2503 | 142 | m_pit.enable(n, t); | 142 | pit_.enable(n, t); |
2504 | 143 | select_correct_tool(); | 143 | select_correct_tool(); |
2505 | 144 | } | 144 | } |
2506 | 145 | 145 | ||
2507 | === modified file 'src/editor/ui_menus/editor_tool_place_bob_options_menu.h' | |||
2508 | --- src/editor/ui_menus/editor_tool_place_bob_options_menu.h 2014-09-10 14:48:40 +0000 | |||
2509 | +++ src/editor/ui_menus/editor_tool_place_bob_options_menu.h 2016-03-18 12:52:47 +0000 | |||
2510 | @@ -35,11 +35,12 @@ | |||
2511 | 35 | UI::UniqueWindow::Registry &); | 35 | UI::UniqueWindow::Registry &); |
2512 | 36 | 36 | ||
2513 | 37 | private: | 37 | private: |
2514 | 38 | UI::TabPanel m_tabpanel; | ||
2515 | 39 | std::vector<UI::Checkbox *> m_checkboxes; | ||
2516 | 40 | EditorPlaceBobTool & m_pit; | ||
2517 | 41 | void clicked(int32_t, bool); | 38 | void clicked(int32_t, bool); |
2519 | 42 | bool m_click_recursion_protect; | 39 | |
2520 | 40 | UI::TabPanel tabpanel_; | ||
2521 | 41 | std::vector<UI::Checkbox*> checkboxes_; | ||
2522 | 42 | EditorPlaceBobTool& pit_; | ||
2523 | 43 | bool click_recursion_protect_; | ||
2524 | 43 | }; | 44 | }; |
2525 | 44 | 45 | ||
2526 | 45 | #endif // end of include guard: WL_EDITOR_UI_MENUS_EDITOR_TOOL_PLACE_BOB_OPTIONS_MENU_H | 46 | #endif // end of include guard: WL_EDITOR_UI_MENUS_EDITOR_TOOL_PLACE_BOB_OPTIONS_MENU_H |
2527 | 46 | 47 | ||
2528 | === modified file 'src/editor/ui_menus/editor_toolsize_menu.cc' | |||
2529 | --- src/editor/ui_menus/editor_toolsize_menu.cc 2016-01-29 08:37:22 +0000 | |||
2530 | +++ src/editor/ui_menus/editor_toolsize_menu.cc 2016-03-18 12:52:47 +0000 | |||
2531 | @@ -41,15 +41,15 @@ | |||
2532 | 41 | : | 41 | : |
2533 | 42 | UI::UniqueWindow | 42 | UI::UniqueWindow |
2534 | 43 | (&parent, "toolsize_menu", ®istry, 250, 50, _("Tool Size")), | 43 | (&parent, "toolsize_menu", ®istry, 250, 50, _("Tool Size")), |
2537 | 44 | m_textarea(this, 5, 10, 240, 10, std::string(), UI::Align::kBottomCenter), | 44 | textarea_(this, 5, 10, 240, 10, std::string(), UI::Align::kBottomCenter), |
2538 | 45 | m_increase | 45 | increase_ |
2539 | 46 | (this, "incr", | 46 | (this, "incr", |
2540 | 47 | get_inner_w() / 2 - 10, 25, 20, 20, | 47 | get_inner_w() / 2 - 10, 25, 20, 20, |
2541 | 48 | g_gr->images().get("images/ui_basic/but0.png"), | 48 | g_gr->images().get("images/ui_basic/but0.png"), |
2542 | 49 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), | 49 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), |
2543 | 50 | std::string(), | 50 | std::string(), |
2544 | 51 | parent.get_sel_radius() < MAX_TOOL_AREA), | 51 | parent.get_sel_radius() < MAX_TOOL_AREA), |
2546 | 52 | m_decrease | 52 | decrease_ |
2547 | 53 | (this, "decr", | 53 | (this, "decr", |
2548 | 54 | get_inner_w() / 2 + 10, 25, 20, 20, | 54 | get_inner_w() / 2 + 10, 25, 20, 20, |
2549 | 55 | g_gr->images().get("images/ui_basic/but0.png"), | 55 | g_gr->images().get("images/ui_basic/but0.png"), |
2550 | @@ -58,11 +58,11 @@ | |||
2551 | 58 | 0 < parent.get_sel_radius()), | 58 | 0 < parent.get_sel_radius()), |
2552 | 59 | value_(0) | 59 | value_(0) |
2553 | 60 | { | 60 | { |
2556 | 61 | m_increase.sigclicked.connect(boost::bind(&EditorToolsizeMenu::increase_radius, boost::ref(*this))); | 61 | increase_.sigclicked.connect(boost::bind(&EditorToolsizeMenu::increase_radius, boost::ref(*this))); |
2557 | 62 | m_decrease.sigclicked.connect(boost::bind(&EditorToolsizeMenu::decrease_radius, boost::ref(*this))); | 62 | decrease_.sigclicked.connect(boost::bind(&EditorToolsizeMenu::decrease_radius, boost::ref(*this))); |
2558 | 63 | 63 | ||
2561 | 64 | m_increase.set_repeating(true); | 64 | increase_.set_repeating(true); |
2562 | 65 | m_decrease.set_repeating(true); | 65 | decrease_.set_repeating(true); |
2563 | 66 | update(parent.get_sel_radius()); | 66 | update(parent.get_sel_radius()); |
2564 | 67 | 67 | ||
2565 | 68 | if (eia().tools()->current().has_size_one()) { | 68 | if (eia().tools()->current().has_size_one()) { |
2566 | @@ -78,12 +78,12 @@ | |||
2567 | 78 | value_ = val; | 78 | value_ = val; |
2568 | 79 | eia().set_sel_radius(val); | 79 | eia().set_sel_radius(val); |
2569 | 80 | set_buttons_enabled(true); | 80 | set_buttons_enabled(true); |
2571 | 81 | m_textarea.set_text((boost::format(_("Current Size: %u")) % (val + 1)).str()); | 81 | textarea_.set_text((boost::format(_("Current Size: %u")) % (val + 1)).str()); |
2572 | 82 | } | 82 | } |
2573 | 83 | 83 | ||
2574 | 84 | void EditorToolsizeMenu::set_buttons_enabled(bool enable) { | 84 | void EditorToolsizeMenu::set_buttons_enabled(bool enable) { |
2577 | 85 | m_decrease.set_enabled(enable && 0 < value_); | 85 | decrease_.set_enabled(enable && 0 < value_); |
2578 | 86 | m_increase.set_enabled(enable && value_ < MAX_TOOL_AREA); | 86 | increase_.set_enabled(enable && value_ < MAX_TOOL_AREA); |
2579 | 87 | } | 87 | } |
2580 | 88 | 88 | ||
2581 | 89 | 89 | ||
2582 | 90 | 90 | ||
2583 | === modified file 'src/editor/ui_menus/editor_toolsize_menu.h' | |||
2584 | --- src/editor/ui_menus/editor_toolsize_menu.h 2016-01-16 12:55:14 +0000 | |||
2585 | +++ src/editor/ui_menus/editor_toolsize_menu.h 2016-03-18 12:52:47 +0000 | |||
2586 | @@ -40,8 +40,8 @@ | |||
2587 | 40 | void decrease_radius(); | 40 | void decrease_radius(); |
2588 | 41 | void increase_radius(); | 41 | void increase_radius(); |
2589 | 42 | 42 | ||
2592 | 43 | UI::Textarea m_textarea; | 43 | UI::Textarea textarea_; |
2593 | 44 | UI::Button m_increase, m_decrease; | 44 | UI::Button increase_, decrease_; |
2594 | 45 | uint32_t value_; | 45 | uint32_t value_; |
2595 | 46 | }; | 46 | }; |
2596 | 47 | 47 |
Found only intended renamings or improvements,
Added some comments about minor things.
New for me are warnings like: CMakeFiles/ logic.dir/ map_objects/ tribes/ requirements. cc.o src/logic/ map_objects/ tribes/ requirements. cc:247: 5: warning: format specifies type 'unsigned int' but the argument has underlying type 'uint8_t' (aka 'unsigned char') [-Wformat] TrainingAttribu te::kHealth,
[ 44%] Building CXX object src/logic/
.../bug-1395278-editor/
I think someone reenabled that clang warning.
Can be merged