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 | |
6 | uint32_t sel_radius; |
7 | |
8 | - int32_t change_by; // resources, hight change tools |
9 | - std::list<Widelands::Field::Height> origHights; // change hight tool |
10 | - uint8_t cur_res, set_to; // resources change tools |
11 | + int32_t change_by; // resources, change height tools |
12 | + std::list<Widelands::Field::Height> original_heights; // change height tool |
13 | + uint8_t current_resource, set_to; // resources change tools |
14 | |
15 | struct ResourceState { |
16 | Widelands::FCoords location; |
17 | @@ -58,14 +58,14 @@ |
18 | uint8_t amount; |
19 | }; |
20 | |
21 | - std::list<ResourceState> orgRes; // resources set tool |
22 | - std::list<const Widelands::BobDescr *> obob_type, nbob_type; // bob change tools |
23 | - std::list<std::string> oimmov_types; // immovable change tools |
24 | - std::list<int32_t> nimmov_types; // immovable change tools |
25 | - Widelands::HeightInterval m_interval; // noise hight tool |
26 | - std::list<Widelands::DescriptionIndex> terrainType, origTerrainType; // set terrain tool |
27 | + std::list<ResourceState> original_resource; // resources set tool |
28 | + std::list<const Widelands::BobDescr *> old_bob_type, new_bob_type; // bob change tools |
29 | + std::list<std::string> old_immovable_types; // immovable change tools |
30 | + std::list<int32_t> new_immovable_types; // immovable change tools |
31 | + Widelands::HeightInterval interval; // noise height tool |
32 | + std::list<Widelands::DescriptionIndex> terrain_type, original_terrain_type; // set terrain tool |
33 | |
34 | - std::list<EditorToolAction *> draw_actions; // draw tool |
35 | + std::list<EditorToolAction *> draw_actions; // draw tool |
36 | |
37 | uint32_t refcount; |
38 | }; |
39 | |
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 | EditorInteractive& /* parent */, |
45 | EditorActionArgs* args, |
46 | Widelands::Map* map) { |
47 | - if (args->origHights.empty()) { |
48 | + if (args->original_heights.empty()) { |
49 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr |
50 | (*map, |
51 | Widelands::Area<Widelands::FCoords> |
52 | (map->get_fcoords(center.node), args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); |
53 | - do args->origHights.push_back(mr.location().field->get_height()); |
54 | + do args->original_heights.push_back(mr.location().field->get_height()); |
55 | while (mr.advance(*map)); |
56 | } |
57 | |
58 | @@ -58,7 +58,7 @@ |
59 | (*map, |
60 | Widelands::Area<Widelands::FCoords> |
61 | (map->get_fcoords(center.node), args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); |
62 | - std::list<Widelands::Field::Height>::iterator i = args->origHights.begin(); |
63 | + std::list<Widelands::Field::Height>::iterator i = args->original_heights.begin(); |
64 | |
65 | do { |
66 | mr.location().field->set_height(*i); ++i; |
67 | @@ -75,6 +75,6 @@ |
68 | EditorActionArgs EditorDecreaseHeightTool::format_args_impl(EditorInteractive & parent) |
69 | { |
70 | EditorActionArgs a(parent); |
71 | - a.change_by = m_change_by; |
72 | + a.change_by = change_by_; |
73 | return a; |
74 | } |
75 | |
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 | |
81 | /// Decreases the height of a node by a value. |
82 | struct EditorDecreaseHeightTool : public EditorTool { |
83 | - EditorDecreaseHeightTool() : EditorTool(*this, *this), m_change_by(1) {} |
84 | + EditorDecreaseHeightTool() : EditorTool(*this, *this), change_by_(1) {} |
85 | |
86 | int32_t handle_click_impl |
87 | (const Widelands::World& world, |
88 | @@ -46,11 +46,11 @@ |
89 | return "images/wui/editor//fsel_editor_decrease_height.png"; |
90 | } |
91 | |
92 | - int32_t get_change_by() const {return m_change_by;} |
93 | - void set_change_by(const int32_t n) {m_change_by = n;} |
94 | + int32_t get_change_by() const {return change_by_;} |
95 | + void set_change_by(const int32_t n) {change_by_ = n;} |
96 | |
97 | private: |
98 | - int32_t m_change_by; |
99 | + int32_t change_by_; |
100 | }; |
101 | |
102 | #endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_DECREASE_HEIGHT_TOOL_H |
103 | |
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 | if (amount < 0) |
109 | amount = 0; |
110 | |
111 | - if (mr.location().field->get_resources() == args->cur_res && |
112 | - map->is_resource_valid(world, mr.location(), args->cur_res) && |
113 | + if (mr.location().field->get_resources() == args->current_resource && |
114 | + map->is_resource_valid(world, mr.location(), args->current_resource) && |
115 | mr.location().field->get_resources_amount() != 0) { |
116 | |
117 | - args->orgRes.push_back(EditorActionArgs::ResourceState{ |
118 | + args->original_resource.push_back(EditorActionArgs::ResourceState{ |
119 | mr.location(), |
120 | mr.location().field->get_resources(), |
121 | mr.location().field->get_resources_amount() |
122 | }); |
123 | |
124 | - map->initialize_resources(mr.location(), args->cur_res, amount); |
125 | + map->initialize_resources(mr.location(), args->current_resource, amount); |
126 | } |
127 | |
128 | } while (mr.advance(*map)); |
129 | @@ -78,7 +78,7 @@ |
130 | EditorActionArgs EditorDecreaseResourcesTool::format_args_impl(EditorInteractive & parent) |
131 | { |
132 | EditorActionArgs a(parent); |
133 | - a.change_by = m_change_by; |
134 | - a.cur_res = m_cur_res; |
135 | + a.change_by = change_by_; |
136 | + a.current_resource = cur_res_; |
137 | return a; |
138 | } |
139 | |
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 | /// Decreases the resources of a node by a value. |
145 | struct EditorDecreaseResourcesTool : public EditorTool { |
146 | EditorDecreaseResourcesTool() |
147 | - : EditorTool(*this, *this), m_cur_res(0), m_change_by(1) |
148 | + : EditorTool(*this, *this), cur_res_(0), change_by_(1) |
149 | {} |
150 | |
151 | int32_t handle_click_impl(const Widelands::World& world, |
152 | @@ -46,16 +46,16 @@ |
153 | return "images/wui/editor/fsel_editor_decrease_resources.png"; |
154 | } |
155 | |
156 | - int32_t get_change_by() const {return m_change_by;} |
157 | - void set_change_by(const int32_t n) {m_change_by = n;} |
158 | - Widelands::DescriptionIndex get_cur_res() const {return m_cur_res;} |
159 | + int32_t get_change_by() const {return change_by_;} |
160 | + void set_change_by(const int32_t n) {change_by_ = n;} |
161 | + Widelands::DescriptionIndex get_cur_res() const {return cur_res_;} |
162 | void set_cur_res(Widelands::DescriptionIndex const res) { |
163 | - m_cur_res = res; |
164 | + cur_res_ = res; |
165 | } |
166 | |
167 | private: |
168 | - Widelands::DescriptionIndex m_cur_res; |
169 | - int32_t m_change_by; |
170 | + Widelands::DescriptionIndex cur_res_; |
171 | + int32_t change_by_; |
172 | }; |
173 | |
174 | #endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_DECREASE_RESOURCES_TOOL_H |
175 | |
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 | (map->get_fcoords(center.node), radius)); |
181 | |
182 | do if (Widelands::Bob * const bob = mr.location().field->get_first_bob()) { |
183 | - args->obob_type.push_back(&bob->descr()); |
184 | + args->old_bob_type.push_back(&bob->descr()); |
185 | bob->remove(egbase); |
186 | } else { |
187 | - args->obob_type.push_back(nullptr); |
188 | + args->old_bob_type.push_back(nullptr); |
189 | } |
190 | while (mr.advance(*map)); |
191 | return radius + 2; |
192 | @@ -58,7 +58,7 @@ |
193 | Widelands::Map* map) { |
194 | |
195 | uint32_t ret = parent.tools()->place_bob.handle_undo_impl(world, center, parent, args, map); |
196 | - args->obob_type.clear(); |
197 | + args->old_bob_type.clear(); |
198 | return ret; |
199 | } |
200 | |
201 | |
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 | immovable, |
207 | mr.location().field->get_immovable())) |
208 | { |
209 | - args->oimmov_types.push_back(immovable->descr().name()); |
210 | + args->old_immovable_types.push_back(immovable->descr().name()); |
211 | immovable->remove(egbase); // Delete no buildings or stuff. |
212 | } else { |
213 | - args->oimmov_types.push_back(""); |
214 | + args->old_immovable_types.push_back(""); |
215 | } |
216 | while (mr.advance(*map)); |
217 | return mr.radius() + 2; |
218 | |
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 | EditorActionArgs::EditorActionArgs(EditorInteractive & base): |
224 | sel_radius(base.get_sel_radius()), |
225 | change_by(0), |
226 | - cur_res(0), |
227 | + current_resource(0), |
228 | set_to(0), |
229 | - m_interval(0, 0), |
230 | + interval(0, 0), |
231 | refcount(0) |
232 | {} |
233 | |
234 | @@ -42,28 +42,28 @@ |
235 | delete draw_actions.back(); |
236 | draw_actions.pop_back(); |
237 | } |
238 | - nbob_type.clear(); |
239 | - obob_type.clear(); |
240 | - nimmov_types.clear(); |
241 | - oimmov_types.clear(); |
242 | - orgRes.clear(); |
243 | - origHights.clear(); |
244 | - origTerrainType.clear(); |
245 | - terrainType.clear(); |
246 | + new_bob_type.clear(); |
247 | + old_bob_type.clear(); |
248 | + new_immovable_types.clear(); |
249 | + old_immovable_types.clear(); |
250 | + original_resource.clear(); |
251 | + original_heights.clear(); |
252 | + original_terrain_type.clear(); |
253 | + terrain_type.clear(); |
254 | } |
255 | |
256 | // === EditorHistory === // |
257 | |
258 | uint32_t EditorHistory::undo_action(const Widelands::World& world) { |
259 | - if (undo_stack.empty()) |
260 | + if (undo_stack_.empty()) |
261 | return 0; |
262 | |
263 | - EditorToolAction uac = undo_stack.front(); |
264 | - undo_stack.pop_front(); |
265 | - redo_stack.push_front(uac); |
266 | + EditorToolAction uac = undo_stack_.front(); |
267 | + undo_stack_.pop_front(); |
268 | + redo_stack_.push_front(uac); |
269 | |
270 | - m_undo_button.set_enabled(!undo_stack.empty()); |
271 | - m_redo_button.set_enabled(true); |
272 | + undo_button_.set_enabled(!undo_stack_.empty()); |
273 | + redo_button_.set_enabled(true); |
274 | |
275 | return uac.tool.handle_undo(static_cast<EditorTool::ToolIndex>(uac.i), |
276 | world, |
277 | @@ -74,15 +74,15 @@ |
278 | } |
279 | |
280 | uint32_t EditorHistory::redo_action(const Widelands::World& world) { |
281 | - if (redo_stack.empty()) |
282 | + if (redo_stack_.empty()) |
283 | return 0; |
284 | |
285 | - EditorToolAction rac = redo_stack.front(); |
286 | - redo_stack.pop_front(); |
287 | - undo_stack.push_front(rac); |
288 | + EditorToolAction rac = redo_stack_.front(); |
289 | + redo_stack_.pop_front(); |
290 | + undo_stack_.push_front(rac); |
291 | |
292 | - m_undo_button.set_enabled(true); |
293 | - m_redo_button.set_enabled(!redo_stack.empty()); |
294 | + undo_button_.set_enabled(true); |
295 | + redo_button_.set_enabled(!redo_stack_.empty()); |
296 | |
297 | return rac.tool.handle_click(static_cast<EditorTool::ToolIndex>(rac.i), |
298 | world, |
299 | @@ -102,33 +102,33 @@ |
300 | EditorToolAction ac |
301 | (tool, static_cast<uint32_t>(ind), |
302 | map, center, parent, tool.format_args(ind, parent)); |
303 | - if (draw && tool.is_unduable()) { |
304 | + if (draw && tool.is_undoable()) { |
305 | if |
306 | - (undo_stack.empty() || |
307 | - undo_stack.front().tool.get_sel_impl() != std::string(m_draw_tool.get_sel_impl())) |
308 | + (undo_stack_.empty() || |
309 | + undo_stack_.front().tool.get_sel_impl() != std::string(draw_tool_.get_sel_impl())) |
310 | { |
311 | EditorToolAction da |
312 | - (m_draw_tool, EditorTool::First, |
313 | + (draw_tool_, EditorTool::First, |
314 | map, center, parent, |
315 | - m_draw_tool.format_args(EditorTool::First, parent)); |
316 | + draw_tool_.format_args(EditorTool::First, parent)); |
317 | |
318 | - if (!undo_stack.empty()) { |
319 | - m_draw_tool.add_action(undo_stack.front(), *da.args); |
320 | - undo_stack.pop_front(); |
321 | + if (!undo_stack_.empty()) { |
322 | + draw_tool_.add_action(undo_stack_.front(), *da.args); |
323 | + undo_stack_.pop_front(); |
324 | } |
325 | |
326 | - redo_stack.clear(); |
327 | - undo_stack.push_front(da); |
328 | - m_undo_button.set_enabled(true); |
329 | - m_redo_button.set_enabled(false); |
330 | + redo_stack_.clear(); |
331 | + undo_stack_.push_front(da); |
332 | + undo_button_.set_enabled(true); |
333 | + redo_button_.set_enabled(false); |
334 | } |
335 | dynamic_cast<EditorDrawTool *> |
336 | - (&(undo_stack.front().tool))->add_action(ac, *undo_stack.front().args); |
337 | - } else if (tool.is_unduable()) { |
338 | - redo_stack.clear(); |
339 | - undo_stack.push_front(ac); |
340 | - m_undo_button.set_enabled(true); |
341 | - m_redo_button.set_enabled(false); |
342 | + (&(undo_stack_.front().tool))->add_action(ac, *undo_stack_.front().args); |
343 | + } else if (tool.is_undoable()) { |
344 | + redo_stack_.clear(); |
345 | + undo_stack_.push_front(ac); |
346 | + undo_button_.set_enabled(true); |
347 | + redo_button_.set_enabled(false); |
348 | } |
349 | return tool.handle_click(ind, world, center, parent, ac.args, &map); |
350 | } |
351 | |
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 | */ |
357 | struct EditorHistory { |
358 | EditorHistory(UI::Button & undo, UI::Button & redo): |
359 | - m_undo_button(undo), m_redo_button(redo) {} |
360 | + undo_button_(undo), redo_button_(redo) {} |
361 | |
362 | uint32_t do_action(EditorTool& tool, |
363 | EditorTool::ToolIndex ind, |
364 | @@ -48,13 +48,13 @@ |
365 | uint32_t redo_action(const Widelands::World& world); |
366 | |
367 | private: |
368 | - UI::Button & m_undo_button; |
369 | - UI::Button & m_redo_button; |
370 | - |
371 | - EditorDrawTool m_draw_tool; |
372 | - |
373 | - std::deque<EditorToolAction> undo_stack; |
374 | - std::deque<EditorToolAction> redo_stack; |
375 | + UI::Button & undo_button_; |
376 | + UI::Button & redo_button_; |
377 | + |
378 | + EditorDrawTool draw_tool_; |
379 | + |
380 | + std::deque<EditorToolAction> undo_stack_; |
381 | + std::deque<EditorToolAction> redo_stack_; |
382 | }; |
383 | |
384 | |
385 | |
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 | EditorInteractive& /* parent */, |
391 | EditorActionArgs* args, |
392 | Widelands::Map* map) { |
393 | - if (args->origHights.empty()) { |
394 | + if (args->original_heights.empty()) { |
395 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords>> mr( |
396 | *map, |
397 | Widelands::Area<Widelands::FCoords>( |
398 | map->get_fcoords(center.node), |
399 | args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); |
400 | do { |
401 | - args->origHights.push_back(mr.location().field->get_height()); |
402 | + args->original_heights.push_back(mr.location().field->get_height()); |
403 | } while (mr.advance(*map)); |
404 | } |
405 | |
406 | @@ -52,12 +52,12 @@ |
407 | EditorInteractive& parent, |
408 | EditorActionArgs* args, |
409 | Widelands::Map* map) { |
410 | - return m_decrease_tool.handle_undo_impl(world, center, parent, args, map); |
411 | + return decrease_tool_.handle_undo_impl(world, center, parent, args, map); |
412 | } |
413 | |
414 | EditorActionArgs EditorIncreaseHeightTool::format_args_impl(EditorInteractive & parent) |
415 | { |
416 | EditorActionArgs a(parent); |
417 | - a.change_by = m_change_by; |
418 | + a.change_by = change_by_; |
419 | return a; |
420 | } |
421 | |
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 | EditorSetHeightTool & the_set_tool) |
427 | : |
428 | EditorTool(the_decrease_tool, the_set_tool), |
429 | - m_decrease_tool(the_decrease_tool), m_set_tool(the_set_tool), |
430 | - m_change_by(1) |
431 | + decrease_tool_(the_decrease_tool), set_tool_(the_set_tool), |
432 | + change_by_(1) |
433 | {} |
434 | |
435 | int32_t handle_click_impl(const Widelands::World& world, |
436 | @@ -52,18 +52,18 @@ |
437 | return "images/wui/editor/fsel_editor_increase_height.png"; |
438 | } |
439 | |
440 | - int32_t get_change_by() const {return m_change_by;} |
441 | - void set_change_by(const int32_t n) {m_change_by = n;} |
442 | + int32_t get_change_by() const {return change_by_;} |
443 | + void set_change_by(const int32_t n) {change_by_ = n;} |
444 | |
445 | EditorDecreaseHeightTool & decrease_tool() const { |
446 | - return m_decrease_tool; |
447 | + return decrease_tool_; |
448 | } |
449 | - EditorSetHeightTool & set_tool() const {return m_set_tool;} |
450 | + EditorSetHeightTool & set_tool() const {return set_tool_;} |
451 | |
452 | private: |
453 | - EditorDecreaseHeightTool & m_decrease_tool; |
454 | - EditorSetHeightTool & m_set_tool; |
455 | - int32_t m_change_by; |
456 | + EditorDecreaseHeightTool& decrease_tool_; |
457 | + EditorSetHeightTool& set_tool_; |
458 | + int32_t change_by_; |
459 | }; |
460 | |
461 | #endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_INCREASE_HEIGHT_TOOL_H |
462 | |
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 | (map->get_fcoords(center.node), args->sel_radius)); |
468 | do { |
469 | int32_t amount = mr.location().field->get_resources_amount(); |
470 | - int32_t max_amount = args->cur_res != Widelands::kNoResource ? |
471 | - world.get_resource(args->cur_res)->max_amount() : 0; |
472 | + int32_t max_amount = args->current_resource != Widelands::kNoResource ? |
473 | + world.get_resource(args->current_resource)->max_amount() : 0; |
474 | |
475 | amount += args->change_by; |
476 | if (amount > max_amount) |
477 | amount = max_amount; |
478 | |
479 | - if ((mr.location().field->get_resources() == args->cur_res || |
480 | + if ((mr.location().field->get_resources() == args->current_resource || |
481 | !mr.location().field->get_resources_amount()) && |
482 | - map->is_resource_valid(world, mr.location(), args->cur_res) && |
483 | + map->is_resource_valid(world, mr.location(), args->current_resource) && |
484 | mr.location().field->get_resources_amount() != max_amount) { |
485 | |
486 | - args->orgRes.push_back(EditorActionArgs::ResourceState{ |
487 | + args->original_resource.push_back(EditorActionArgs::ResourceState{ |
488 | mr.location(), |
489 | mr.location().field->get_resources(), |
490 | mr.location().field->get_resources_amount() |
491 | }); |
492 | |
493 | - map->initialize_resources(mr.location(), args->cur_res, amount); |
494 | + map->initialize_resources(mr.location(), args->current_resource, amount); |
495 | } |
496 | } while (mr.advance(*map)); |
497 | return mr.radius(); |
498 | @@ -69,13 +69,13 @@ |
499 | EditorInteractive& parent, |
500 | EditorActionArgs* args, |
501 | Widelands::Map* map) { |
502 | - return m_set_tool.handle_undo_impl(world, center, parent, args, map); |
503 | + return set_tool_.handle_undo_impl(world, center, parent, args, map); |
504 | } |
505 | |
506 | EditorActionArgs EditorIncreaseResourcesTool::format_args_impl(EditorInteractive & parent) |
507 | { |
508 | EditorActionArgs a(parent); |
509 | - a.change_by = m_change_by; |
510 | - a.cur_res = m_cur_res; |
511 | + a.change_by = change_by_; |
512 | + a.current_resource = cur_res_; |
513 | return a; |
514 | } |
515 | |
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 | EditorIncreaseResourcesTool(EditorDecreaseResourcesTool& the_decrease_tool, |
521 | EditorSetResourcesTool& the_set_to_tool) |
522 | : EditorTool(the_decrease_tool, the_set_to_tool), |
523 | - m_decrease_tool(the_decrease_tool), |
524 | - m_set_tool(the_set_to_tool), |
525 | - m_change_by(1), |
526 | - m_cur_res(0) { |
527 | + decrease_tool_(the_decrease_tool), |
528 | + set_tool_(the_set_to_tool), |
529 | + change_by_(1), |
530 | + cur_res_(0) { |
531 | } |
532 | |
533 | /*** |
534 | @@ -57,23 +57,23 @@ |
535 | return "images/wui/editor/fsel_editor_increase_resources.png"; |
536 | } |
537 | |
538 | - int32_t get_change_by() const {return m_change_by;} |
539 | - void set_change_by(const int32_t n) {m_change_by = n;} |
540 | - Widelands::DescriptionIndex get_cur_res() const {return m_cur_res;} |
541 | + int32_t get_change_by() const {return change_by_;} |
542 | + void set_change_by(const int32_t n) {change_by_ = n;} |
543 | + Widelands::DescriptionIndex get_cur_res() const {return cur_res_;} |
544 | void set_cur_res(Widelands::DescriptionIndex const res) { |
545 | - m_cur_res = res; |
546 | + cur_res_ = res; |
547 | } |
548 | |
549 | EditorDecreaseResourcesTool & decrease_tool() const { |
550 | - return m_decrease_tool; |
551 | + return decrease_tool_; |
552 | } |
553 | - EditorSetResourcesTool & set_tool() const {return m_set_tool;} |
554 | + EditorSetResourcesTool & set_tool() const {return set_tool_;} |
555 | |
556 | private: |
557 | - EditorDecreaseResourcesTool & m_decrease_tool; |
558 | - EditorSetResourcesTool& m_set_tool; |
559 | - int32_t m_change_by; |
560 | - Widelands::DescriptionIndex m_cur_res; |
561 | + EditorDecreaseResourcesTool& decrease_tool_; |
562 | + EditorSetResourcesTool& set_tool_; |
563 | + int32_t change_by_; |
564 | + Widelands::DescriptionIndex cur_res_; |
565 | }; |
566 | |
567 | |
568 | |
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 | EditorActionArgs* /* args */, |
574 | Widelands::Map*) { |
575 | show_field_action |
576 | - (&parent, parent.egbase().get_player(m_player), &m_registry); |
577 | + (&parent, parent.egbase().get_player(player_), ®istry_); |
578 | |
579 | // Not really needed, since Player Immovables are taken care of while |
580 | // placing on map. |
581 | |
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 | */ |
587 | // TODO(unknown): Implement undo for this tool |
588 | struct EditorMakeInfrastructureTool : public EditorTool { |
589 | - EditorMakeInfrastructureTool() : EditorTool(*this, *this, false), m_player(0) {} |
590 | + EditorMakeInfrastructureTool() : EditorTool(*this, *this, false), player_(0) {} |
591 | |
592 | void set_player(Widelands::PlayerNumber const n) |
593 | - {m_player = n;} |
594 | + {player_ = n;} |
595 | Widelands::PlayerNumber get_player() const |
596 | - {return m_player;} |
597 | + {return player_;} |
598 | |
599 | int32_t handle_click_impl(const Widelands::World& world, |
600 | Widelands::NodeAndTriangle<> center, |
601 | @@ -49,8 +49,8 @@ |
602 | {return "images/ui_basic/fsel.png";} // Standard sel icon, most complex tool of all |
603 | |
604 | private: |
605 | - Widelands::PlayerNumber m_player; |
606 | - UI::UniqueWindow::Registry m_registry; |
607 | + Widelands::PlayerNumber player_; |
608 | + UI::UniqueWindow::Registry registry_; |
609 | }; |
610 | |
611 | int32_t editor_make_infrastructure_tool_callback |
612 | |
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 | EditorInteractive& /* parent */, |
618 | EditorActionArgs* args, |
619 | Widelands::Map* map) { |
620 | - if (args->origHights.empty()) { |
621 | + if (args->original_heights.empty()) { |
622 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr |
623 | (*map, |
624 | Widelands::Area<Widelands::FCoords> |
625 | (map->get_fcoords(center.node), |
626 | args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); |
627 | - do args->origHights.push_back(mr.location().field->get_height()); |
628 | + do args->original_heights.push_back(mr.location().field->get_height()); |
629 | while (mr.advance(*map)); |
630 | } |
631 | |
632 | @@ -53,9 +53,9 @@ |
633 | max, |
634 | map->set_height(world, |
635 | mr.location(), |
636 | - args->m_interval.min + |
637 | + args->interval.min + |
638 | static_cast<int32_t>( |
639 | - static_cast<double>(args->m_interval.max - args->m_interval.min + 1) * |
640 | + static_cast<double>(args->interval.max - args->interval.min + 1) * |
641 | rand() / (RAND_MAX + 1.0)))); |
642 | } while (mr.advance(*map)); |
643 | return mr.radius() + max; |
644 | @@ -67,12 +67,12 @@ |
645 | EditorInteractive& parent, |
646 | EditorActionArgs* args, |
647 | Widelands::Map* map) { |
648 | - return m_set_tool.handle_undo_impl(world, center, parent, args, map); |
649 | + return set_tool_.handle_undo_impl(world, center, parent, args, map); |
650 | } |
651 | |
652 | EditorActionArgs EditorNoiseHeightTool::format_args_impl(EditorInteractive & parent) |
653 | { |
654 | EditorActionArgs a(parent); |
655 | - a.m_interval = m_interval; |
656 | + a.interval = interval_; |
657 | return a; |
658 | } |
659 | |
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 | Widelands::HeightInterval(10, 14)) |
665 | : |
666 | EditorTool(the_set_tool, the_set_tool), |
667 | - m_set_tool(the_set_tool), |
668 | - m_interval(the_interval) |
669 | + set_tool_(the_set_tool), |
670 | + interval_(the_interval) |
671 | {} |
672 | |
673 | int32_t handle_click_impl(const Widelands::World& world, |
674 | @@ -53,17 +53,17 @@ |
675 | } |
676 | |
677 | Widelands::HeightInterval get_interval() const { |
678 | - return m_interval; |
679 | + return interval_; |
680 | } |
681 | void set_interval(Widelands::HeightInterval const i) { |
682 | - m_interval = i; |
683 | + interval_ = i; |
684 | } |
685 | |
686 | - EditorSetHeightTool & set_tool() const {return m_set_tool;} |
687 | + EditorSetHeightTool & set_tool() const {return set_tool_;} |
688 | |
689 | private: |
690 | - EditorSetHeightTool & m_set_tool; |
691 | - Widelands::HeightInterval m_interval; |
692 | + EditorSetHeightTool & set_tool_; |
693 | + Widelands::HeightInterval interval_; |
694 | }; |
695 | |
696 | #endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_NOISE_HEIGHT_TOOL_H |
697 | |
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 | EditorActionArgs* args, |
703 | Widelands::Map* map) { |
704 | |
705 | - if (get_nr_enabled() && args->obob_type.empty()) { |
706 | + if (get_nr_enabled() && args->old_bob_type.empty()) { |
707 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr |
708 | (*map, |
709 | Widelands::Area<Widelands::FCoords> |
710 | (map->get_fcoords(center.node), args->sel_radius)); |
711 | do { |
712 | Widelands::Bob * const mbob = mr.location().field->get_first_bob(); |
713 | - args->obob_type.push_back((mbob ? &mbob->descr() : nullptr)); |
714 | - args->nbob_type.push_back(world.get_bob_descr(get_random_enabled())); |
715 | + args->old_bob_type.push_back((mbob ? &mbob->descr() : nullptr)); |
716 | + args->new_bob_type.push_back(world.get_bob_descr(get_random_enabled())); |
717 | } while (mr.advance(*map)); |
718 | } |
719 | |
720 | - if (!args->nbob_type.empty()) { |
721 | + if (!args->new_bob_type.empty()) { |
722 | Widelands::EditorGameBase & egbase = parent.egbase(); |
723 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr |
724 | (*map, |
725 | Widelands::Area<Widelands::FCoords> |
726 | (map->get_fcoords(center.node), args->sel_radius)); |
727 | - std::list< const Widelands::BobDescr * >::iterator i = args->nbob_type.begin(); |
728 | + std::list< const Widelands::BobDescr * >::iterator i = args->new_bob_type.begin(); |
729 | do { |
730 | const Widelands::BobDescr & descr = *(*i); |
731 | if (mr.location().field->nodecaps() & descr.movecaps()) { |
732 | @@ -75,13 +75,13 @@ |
733 | EditorInteractive& parent, |
734 | EditorActionArgs* args, |
735 | Widelands::Map* map) { |
736 | - if (!args->nbob_type.empty()) { |
737 | + if (!args->new_bob_type.empty()) { |
738 | Widelands::EditorGameBase & egbase = parent.egbase(); |
739 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr |
740 | (*map, |
741 | Widelands::Area<Widelands::FCoords> |
742 | (map->get_fcoords(center.node), args->sel_radius)); |
743 | - std::list<const Widelands::BobDescr *>::iterator i = args->obob_type.begin(); |
744 | + std::list<const Widelands::BobDescr *>::iterator i = args->old_bob_type.begin(); |
745 | do { |
746 | if (*i) { |
747 | const Widelands::BobDescr & descr = *(*i); |
748 | |
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 | if (!get_nr_enabled()) |
754 | return radius; |
755 | Widelands::EditorGameBase & egbase = parent.egbase(); |
756 | - if (args->oimmov_types.empty()) |
757 | + if (args->old_immovable_types.empty()) |
758 | { |
759 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr |
760 | (*map, |
761 | @@ -49,18 +49,18 @@ |
762 | (map->get_fcoords(center.node), radius)); |
763 | do { |
764 | const Widelands::BaseImmovable * im = mr.location().field->get_immovable(); |
765 | - args->oimmov_types.push_back((im ? im->descr().name() : "")); |
766 | - args->nimmov_types.push_back(get_random_enabled()); |
767 | + args->old_immovable_types.push_back((im ? im->descr().name() : "")); |
768 | + args->new_immovable_types.push_back(get_random_enabled()); |
769 | } while (mr.advance(*map)); |
770 | } |
771 | |
772 | - if (!args->nimmov_types.empty()) |
773 | + if (!args->new_immovable_types.empty()) |
774 | { |
775 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr |
776 | (*map, |
777 | Widelands::Area<Widelands::FCoords> |
778 | (map->get_fcoords(center.node), radius)); |
779 | - std::list<int32_t>::iterator i = args->nimmov_types.begin(); |
780 | + std::list<int32_t>::iterator i = args->new_immovable_types.begin(); |
781 | do { |
782 | if |
783 | (!mr.location().field->get_immovable() |
784 | @@ -79,7 +79,7 @@ |
785 | EditorActionArgs* args, |
786 | Widelands::Map* map) { |
787 | const int32_t radius = args->sel_radius; |
788 | - if (args->oimmov_types.empty()) |
789 | + if (args->old_immovable_types.empty()) |
790 | return radius; |
791 | |
792 | Widelands::EditorGameBase & egbase = parent.egbase(); |
793 | @@ -87,7 +87,7 @@ |
794 | (*map, |
795 | Widelands::Area<Widelands::FCoords> |
796 | (map->get_fcoords(center.node), radius)); |
797 | - std::list<std::string>::iterator i = args->oimmov_types.begin(); |
798 | + std::list<std::string>::iterator i = args->old_immovable_types.begin(); |
799 | do { |
800 | if |
801 | (upcast(Widelands::Immovable, immovable, |
802 | |
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 | EditorInteractive& /* parent */, |
808 | EditorActionArgs* args, |
809 | Widelands::Map* map) { |
810 | - if (args->origHights.empty()) |
811 | + if (args->original_heights.empty()) |
812 | { |
813 | Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr |
814 | (*map, |
815 | Widelands::Area<Widelands::FCoords> |
816 | (map->get_fcoords(center.node), args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); |
817 | - do args->origHights.push_back(mr.location().field->get_height()); |
818 | + do args->original_heights.push_back(mr.location().field->get_height()); |
819 | while (mr.advance(*map)); |
820 | } |
821 | return map->set_height( |
822 | world, |
823 | Widelands::Area<Widelands::FCoords>(map->get_fcoords(center.node), args->sel_radius), |
824 | - args->m_interval); |
825 | + args->interval); |
826 | } |
827 | |
828 | int32_t |
829 | @@ -58,7 +58,7 @@ |
830 | (map->get_fcoords(center.node), |
831 | args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1)); |
832 | |
833 | - std::list<Widelands::Field::Height>::iterator i = args->origHights.begin(); |
834 | + std::list<Widelands::Field::Height>::iterator i = args->original_heights.begin(); |
835 | |
836 | do { |
837 | mr.location().field->set_height(*i); ++i; |
838 | @@ -75,6 +75,6 @@ |
839 | EditorActionArgs EditorSetHeightTool::format_args_impl(EditorInteractive & parent) |
840 | { |
841 | EditorActionArgs a(parent); |
842 | - a.m_interval = m_interval; |
843 | + a.interval = interval_; |
844 | return a; |
845 | } |
846 | |
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 | /// Ensures that the height of a node is within an interval. |
852 | struct EditorSetHeightTool : public EditorTool { |
853 | EditorSetHeightTool() |
854 | - : EditorTool(*this, *this), m_interval(10, 10) |
855 | + : EditorTool(*this, *this), interval_(10, 10) |
856 | {} |
857 | |
858 | int32_t handle_click_impl(const Widelands::World& world, |
859 | @@ -49,14 +49,14 @@ |
860 | } |
861 | |
862 | Widelands::HeightInterval get_interval() const { |
863 | - return m_interval; |
864 | + return interval_; |
865 | } |
866 | void set_interval(Widelands::HeightInterval const i) { |
867 | - m_interval = i; |
868 | + interval_ = i; |
869 | } |
870 | |
871 | private: |
872 | - Widelands::HeightInterval m_interval; |
873 | + Widelands::HeightInterval interval_; |
874 | }; |
875 | |
876 | #endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_SET_HEIGHT_TOOL_H |
877 | |
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 | (map->get_fcoords(center.node), args->sel_radius)); |
883 | do { |
884 | int32_t amount = args->set_to; |
885 | - int32_t max_amount = args->cur_res != Widelands::kNoResource ? |
886 | - world.get_resource(args->cur_res)->max_amount() : 0; |
887 | + int32_t max_amount = args->current_resource != Widelands::kNoResource ? |
888 | + world.get_resource(args->current_resource)->max_amount() : 0; |
889 | if (amount < 0) |
890 | amount = 0; |
891 | else if (amount > max_amount) |
892 | amount = max_amount; |
893 | |
894 | - if (map->is_resource_valid(world, mr.location(), args->cur_res) && |
895 | + if (map->is_resource_valid(world, mr.location(), args->current_resource) && |
896 | mr.location().field->get_resources_amount() != amount) { |
897 | |
898 | - args->orgRes.push_back(EditorActionArgs::ResourceState{ |
899 | + args->original_resource.push_back(EditorActionArgs::ResourceState{ |
900 | mr.location(), |
901 | mr.location().field->get_resources(), |
902 | mr.location().field->get_resources_amount() |
903 | }); |
904 | |
905 | - map->initialize_resources(mr.location(), args->cur_res, amount); |
906 | + map->initialize_resources(mr.location(), args->current_resource, amount); |
907 | } |
908 | } while (mr.advance(*map)); |
909 | return mr.radius(); |
910 | @@ -67,9 +67,9 @@ |
911 | EditorInteractive& /* parent */, |
912 | EditorActionArgs* args, |
913 | Widelands::Map* map) { |
914 | - for (const auto & res : args->orgRes) { |
915 | + for (const auto & res : args->original_resource) { |
916 | int32_t amount = res.amount; |
917 | - int32_t max_amount = world.get_resource(args->cur_res)->max_amount(); |
918 | + int32_t max_amount = world.get_resource(args->current_resource)->max_amount(); |
919 | |
920 | if (amount < 0) |
921 | amount = 0; |
922 | @@ -79,14 +79,14 @@ |
923 | map->initialize_resources(res.location, res.idx, amount); |
924 | } |
925 | |
926 | - args->orgRes.clear(); |
927 | + args->original_resource.clear(); |
928 | return args->sel_radius; |
929 | } |
930 | |
931 | EditorActionArgs EditorSetResourcesTool::format_args_impl(EditorInteractive & parent) |
932 | { |
933 | EditorActionArgs a(parent); |
934 | - a.cur_res = m_cur_res; |
935 | - a.set_to = m_set_to; |
936 | + a.current_resource = cur_res_; |
937 | + a.set_to = set_to_; |
938 | return a; |
939 | } |
940 | |
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 | /// Decreases the resources of a node by a value. |
946 | struct EditorSetResourcesTool : public EditorTool { |
947 | EditorSetResourcesTool() |
948 | - : EditorTool(*this, *this), m_cur_res(0), m_set_to(0) |
949 | + : EditorTool(*this, *this), cur_res_(0), set_to_(0) |
950 | {} |
951 | |
952 | /** |
953 | @@ -51,15 +51,15 @@ |
954 | return "images/wui/editor/fsel_editor_set_resources.png"; |
955 | } |
956 | |
957 | - uint8_t get_set_to() const {return m_set_to;} |
958 | - void set_set_to(uint8_t const n) {m_set_to = n;} |
959 | - Widelands::DescriptionIndex get_cur_res() const {return m_cur_res;} |
960 | + uint8_t get_set_to() const {return set_to_;} |
961 | + void set_set_to(uint8_t const n) {set_to_ = n;} |
962 | + Widelands::DescriptionIndex get_cur_res() const {return cur_res_;} |
963 | void set_cur_res(Widelands::DescriptionIndex const res) |
964 | - {m_cur_res = res;} |
965 | + {cur_res_ = res;} |
966 | |
967 | private: |
968 | - Widelands::DescriptionIndex m_cur_res; |
969 | - uint8_t m_set_to; |
970 | + Widelands::DescriptionIndex cur_res_; |
971 | + uint8_t set_to_; |
972 | }; |
973 | |
974 | |
975 | |
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 | } // namespace |
981 | |
982 | // global variable to pass data from callback to class |
983 | -static int32_t m_current_player; |
984 | +static int32_t current_player_; |
985 | |
986 | /* |
987 | * static callback function for overlay calculation |
988 | @@ -59,7 +59,7 @@ |
989 | { |
990 | // Area around already placed players |
991 | Widelands::PlayerNumber const nr_players = map.get_nrplayers(); |
992 | - for (Widelands::PlayerNumber p = 1, last = m_current_player - 1;; ++p) { |
993 | + for (Widelands::PlayerNumber p = 1, last = current_player_ - 1;; ++p) { |
994 | for (; p <= last; ++p) |
995 | if (Widelands::Coords const sp = map.get_starting_pos(p)) |
996 | if (map.calc_distance(sp, c) < MIN_PLACE_AROUND_PLAYERS) |
997 | @@ -78,10 +78,10 @@ |
998 | } |
999 | |
1000 | EditorSetStartingPosTool::EditorSetStartingPosTool() |
1001 | - : EditorTool(*this, *this, false), m_current_sel_pic(nullptr) |
1002 | + : EditorTool(*this, *this, false), current_sel_pic_(nullptr) |
1003 | { |
1004 | - m_current_player = 0; |
1005 | - fsel_picsname = "images/players/fsel_editor_set_player_01_pos.png"; |
1006 | + current_player_ = 0; |
1007 | + fsel_picsname_ = "images/players/fsel_editor_set_player_01_pos.png"; |
1008 | } |
1009 | |
1010 | int32_t EditorSetStartingPosTool::handle_click_impl(const Widelands::World&, |
1011 | @@ -93,18 +93,18 @@ |
1012 | assert(center.node.x < map->get_width()); |
1013 | assert(0 <= center.node.y); |
1014 | assert(center.node.y < map->get_height()); |
1015 | - if (m_current_player) { |
1016 | - if (map->get_nrplayers() < m_current_player) { |
1017 | + if (current_player_) { |
1018 | + if (map->get_nrplayers() < current_player_) { |
1019 | // Mmh, my current player is not valid. Maybe the user has loaded a |
1020 | // new map while this tool was active. We set the new player to a |
1021 | // valid one. The sel pointer is the only thing that stays wrong, but |
1022 | // this is not important |
1023 | - m_current_player = 1; |
1024 | + current_player_ = 1; |
1025 | } |
1026 | |
1027 | - Widelands::Coords const old_sp = map->get_starting_pos(m_current_player); |
1028 | + Widelands::Coords const old_sp = map->get_starting_pos(current_player_); |
1029 | |
1030 | - const Image* player_image = g_gr->images().get(player_pictures[m_current_player - 1]); |
1031 | + const Image* player_image = g_gr->images().get(player_pictures[current_player_ - 1]); |
1032 | assert(player_image); |
1033 | |
1034 | // check if field is valid |
1035 | @@ -118,7 +118,7 @@ |
1036 | center.node, player_image, 4, Point(player_image->width() / 2, STARTING_POS_HOTSPOT_Y)); |
1037 | |
1038 | // set new player pos |
1039 | - map->set_starting_pos(m_current_player, center.node); |
1040 | + map->set_starting_pos(current_player_, center.node); |
1041 | } |
1042 | } |
1043 | return 1; |
1044 | @@ -127,12 +127,12 @@ |
1045 | Widelands::PlayerNumber EditorSetStartingPosTool::get_current_player |
1046 | () const |
1047 | { |
1048 | - return m_current_player; |
1049 | + return current_player_; |
1050 | } |
1051 | |
1052 | |
1053 | void EditorSetStartingPosTool::set_current_player(int32_t const i) { |
1054 | - m_current_player = i; |
1055 | - fsel_picsname = player_pictures_small[m_current_player - 1]; |
1056 | - m_current_sel_pic = fsel_picsname; |
1057 | + current_player_ = i; |
1058 | + fsel_picsname_ = player_pictures_small[current_player_ - 1]; |
1059 | + current_sel_pic_ = fsel_picsname_; |
1060 | } |
1061 | |
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 | EditorActionArgs*, |
1067 | Widelands::Map*) override; |
1068 | char const * get_sel_impl() const override |
1069 | - {return m_current_sel_pic;} |
1070 | + {return current_sel_pic_;} |
1071 | |
1072 | Widelands::PlayerNumber get_current_player() const; |
1073 | void set_current_player(int32_t); |
1074 | bool has_size_one() const override {return true;} |
1075 | |
1076 | private: |
1077 | - char const * fsel_picsname; |
1078 | - char const * m_current_sel_pic; |
1079 | + char const * fsel_picsname_; |
1080 | + char const * current_sel_pic_; |
1081 | }; |
1082 | |
1083 | int32_t editor_tool_set_starting_pos_callback |
1084 | |
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 | uint16_t const radius = args->sel_radius; |
1090 | int32_t max = 0; |
1091 | |
1092 | - if (get_nr_enabled() && args->terrainType.empty()) { |
1093 | + if (get_nr_enabled() && args->terrain_type.empty()) { |
1094 | Widelands::MapTriangleRegion<TCoords<Widelands::FCoords> > mr |
1095 | (*map, Widelands::Area<TCoords<Widelands::FCoords> > |
1096 | (TCoords<Widelands::FCoords> |
1097 | @@ -43,21 +43,21 @@ |
1098 | static_cast<TCoords<Widelands::FCoords>::TriangleIndex>(center.triangle.t)), |
1099 | radius)); |
1100 | do { |
1101 | - args->origTerrainType.push_back |
1102 | + args->original_terrain_type.push_back |
1103 | ((mr.location().t == TCoords<Widelands::FCoords>::D) |
1104 | ? mr.location().field->terrain_d() : mr.location().field->terrain_r()); |
1105 | - args->terrainType.push_back(get_random_enabled()); |
1106 | + args->terrain_type.push_back(get_random_enabled()); |
1107 | } while (mr.advance(*map)); |
1108 | } |
1109 | |
1110 | - if (!args->terrainType.empty()) { |
1111 | + if (!args->terrain_type.empty()) { |
1112 | Widelands::MapTriangleRegion<TCoords<Widelands::FCoords> > mr |
1113 | (*map, Widelands::Area<TCoords<Widelands::FCoords> > |
1114 | (TCoords<Widelands::FCoords> |
1115 | (Widelands::FCoords(map->get_fcoords(center.triangle)), |
1116 | static_cast<TCoords<Widelands::FCoords>::TriangleIndex>(center.triangle.t)), |
1117 | radius)); |
1118 | - std::list<Widelands::DescriptionIndex>::iterator i = args->terrainType.begin(); |
1119 | + std::list<Widelands::DescriptionIndex>::iterator i = args->terrain_type.begin(); |
1120 | do { |
1121 | max = std::max |
1122 | (max, map->change_terrain(world, mr.location(), *i)); |
1123 | @@ -76,7 +76,7 @@ |
1124 | assert |
1125 | (center.triangle.t == TCoords<>::D || center.triangle.t == TCoords<>::R); |
1126 | uint16_t const radius = args->sel_radius; |
1127 | - if (!args->terrainType.empty()) { |
1128 | + if (!args->terrain_type.empty()) { |
1129 | int32_t max = 0; |
1130 | Widelands::MapTriangleRegion<TCoords<Widelands::FCoords> > mr |
1131 | (*map, |
1132 | @@ -87,7 +87,7 @@ |
1133 | (center.triangle.t)), |
1134 | radius)); |
1135 | |
1136 | - std::list<Widelands::DescriptionIndex>::iterator i = args->origTerrainType.begin(); |
1137 | + std::list<Widelands::DescriptionIndex>::iterator i = args->original_terrain_type.begin(); |
1138 | do { |
1139 | max = std::max |
1140 | (max, map->change_terrain(world, mr.location(), *i)); |
1141 | |
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 | class EditorTool { |
1147 | public: |
1148 | EditorTool(EditorTool & second, EditorTool & third, bool uda = true) : |
1149 | - m_second(second), m_third(third), undoable(uda) |
1150 | + second_(second), third_(third), undoable_(uda) |
1151 | {} |
1152 | virtual ~EditorTool() {} |
1153 | |
1154 | @@ -52,7 +52,7 @@ |
1155 | EditorInteractive& parent, EditorActionArgs* args, Widelands::Map* map) |
1156 | { |
1157 | return |
1158 | - (i == First ? *this : i == Second ? m_second : m_third) |
1159 | + (i == First ? *this : i == Second ? second_ : third_) |
1160 | .handle_click_impl(world, center, parent, args, map); |
1161 | } |
1162 | |
1163 | @@ -62,23 +62,23 @@ |
1164 | EditorInteractive& parent, EditorActionArgs* args, Widelands::Map* map) |
1165 | { |
1166 | return |
1167 | - (i == First ? *this : i == Second ? m_second : m_third) |
1168 | + (i == First ? *this : i == Second ? second_ : third_) |
1169 | .handle_undo_impl(world, center, parent, args, map); |
1170 | } |
1171 | |
1172 | const char * get_sel(const ToolIndex i) { |
1173 | return |
1174 | - (i == First ? *this : i == Second ? m_second : m_third) |
1175 | + (i == First ? *this : i == Second ? second_ : third_) |
1176 | .get_sel_impl(); |
1177 | } |
1178 | |
1179 | EditorActionArgs format_args(const ToolIndex i, EditorInteractive & parent) { |
1180 | return |
1181 | - (i == First ? *this : i == Second ? m_second : m_third) |
1182 | + (i == First ? *this : i == Second ? second_ : third_) |
1183 | .format_args_impl(parent); |
1184 | } |
1185 | |
1186 | - bool is_unduable() {return undoable;} |
1187 | + bool is_undoable() {return undoable_;} |
1188 | virtual bool has_size_one() const {return false;} |
1189 | virtual EditorActionArgs format_args_impl(EditorInteractive & parent) { |
1190 | return EditorActionArgs(parent); |
1191 | @@ -99,8 +99,8 @@ |
1192 | virtual bool operates_on_triangles() const {return false;} |
1193 | |
1194 | protected: |
1195 | - EditorTool & m_second, & m_third; |
1196 | - bool undoable; |
1197 | + EditorTool & second_, & third_; |
1198 | + bool undoable_; |
1199 | |
1200 | private: |
1201 | DISALLOW_COPY_AND_ASSIGN(EditorTool); |
1202 | |
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 | * This is a helper class, no Editor Tool (might be usable in game too) |
1208 | */ |
1209 | struct MultiSelect { |
1210 | - MultiSelect() : m_nr_enabled(0) {} |
1211 | + MultiSelect() : nr_enabled_(0) {} |
1212 | ~MultiSelect() {} |
1213 | |
1214 | void enable(int32_t n, bool t) { |
1215 | - if (static_cast<int32_t>(m_enabled.size()) < n + 1) |
1216 | - m_enabled.resize(n + 1, false); |
1217 | + if (static_cast<int32_t>(enabled_.size()) < n + 1) |
1218 | + enabled_.resize(n + 1, false); |
1219 | |
1220 | - if (m_enabled[n] == t) |
1221 | + if (enabled_[n] == t) |
1222 | return; |
1223 | - m_enabled[n] = t; |
1224 | + enabled_[n] = t; |
1225 | if (t) |
1226 | - ++m_nr_enabled; |
1227 | + ++nr_enabled_; |
1228 | else |
1229 | - --m_nr_enabled; |
1230 | - assert(0 <= m_nr_enabled); |
1231 | + --nr_enabled_; |
1232 | + assert(0 <= nr_enabled_); |
1233 | } |
1234 | bool is_enabled(int32_t n) const { |
1235 | - if (static_cast<int32_t>(m_enabled.size()) < n + 1) |
1236 | + if (static_cast<int32_t>(enabled_.size()) < n + 1) |
1237 | return false; |
1238 | - return m_enabled[n]; |
1239 | + return enabled_[n]; |
1240 | } |
1241 | - int32_t get_nr_enabled() const {return m_nr_enabled;} |
1242 | + int32_t get_nr_enabled() const {return nr_enabled_;} |
1243 | int32_t get_random_enabled() const { |
1244 | const int32_t rand_value = |
1245 | static_cast<int32_t> |
1246 | @@ -69,8 +69,8 @@ |
1247 | } |
1248 | |
1249 | private: |
1250 | - int32_t m_nr_enabled; |
1251 | - std::vector<bool> m_enabled; |
1252 | + int32_t nr_enabled_; |
1253 | + std::vector<bool> enabled_; |
1254 | }; |
1255 | |
1256 | #endif // end of include guard: WL_EDITOR_TOOLS_MULTI_SELECT_H |
1257 | |
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 | : |
1263 | UI::UniqueWindow |
1264 | (&parent, "players_menu", ®istry, 340, 400, _("Player Options")), |
1265 | - m_add_player |
1266 | + add_player_ |
1267 | (this, "add_player", |
1268 | get_inner_w() - 5 - 20, 5, 20, 20, |
1269 | g_gr->images().get("images/ui_basic/but1.png"), |
1270 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), |
1271 | _("Add player"), |
1272 | parent.egbase().map().get_nrplayers() < MAX_PLAYERS), |
1273 | - m_remove_last_player |
1274 | + remove_last_player_ |
1275 | (this, "remove_last_player", |
1276 | 5, 5, 20, 20, |
1277 | g_gr->images().get("images/ui_basic/but1.png"), |
1278 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), |
1279 | _("Remove last player"), |
1280 | 1 < parent.egbase().map().get_nrplayers()), |
1281 | - m_tribenames(eia().egbase().tribes().get_all_tribenames()) |
1282 | + tribenames_(eia().egbase().tribes().get_all_tribenames()) |
1283 | { |
1284 | - m_add_player.sigclicked.connect(boost::bind(&EditorPlayerMenu::clicked_add_player, boost::ref(*this))); |
1285 | - m_remove_last_player.sigclicked.connect |
1286 | + add_player_.sigclicked.connect(boost::bind(&EditorPlayerMenu::clicked_add_player, boost::ref(*this))); |
1287 | + remove_last_player_.sigclicked.connect |
1288 | (boost::bind(&EditorPlayerMenu::clicked_remove_last_player, boost::ref(*this))); |
1289 | |
1290 | int32_t const spacing = 5; |
1291 | @@ -100,19 +100,19 @@ |
1292 | ta->set_pos(Point((get_inner_w() - ta->get_w()) / 2, posy + 5)); |
1293 | posy += spacing + width; |
1294 | |
1295 | - m_nr_of_players_ta = new UI::Textarea(this, 0, 0, "5"); |
1296 | - m_nr_of_players_ta->set_pos |
1297 | - (Point((get_inner_w() - m_nr_of_players_ta->get_w()) / 2, posy + 5)); |
1298 | + nr_of_players_ta_ = new UI::Textarea(this, 0, 0, "5"); |
1299 | + nr_of_players_ta_->set_pos |
1300 | + (Point((get_inner_w() - nr_of_players_ta_->get_w()) / 2, posy + 5)); |
1301 | |
1302 | posy += width + spacing + spacing; |
1303 | |
1304 | - m_posy = posy; |
1305 | + posy_ = posy; |
1306 | |
1307 | for (Widelands::PlayerNumber i = 0; i < MAX_PLAYERS; ++i) { |
1308 | - m_plr_names [i] = nullptr; |
1309 | - m_plr_set_pos_buts [i] = nullptr; |
1310 | - m_plr_set_tribes_buts[i] = nullptr; |
1311 | - m_plr_make_infrastructure_buts[i] = nullptr; |
1312 | + plr_names_ [i] = nullptr; |
1313 | + plr_set_pos_buts_ [i] = nullptr; |
1314 | + plr_set_tribes_buts_[i] = nullptr; |
1315 | + plr_make_infrastructure_buts_[i] = nullptr; |
1316 | } |
1317 | update(); |
1318 | |
1319 | @@ -147,75 +147,75 @@ |
1320 | text[0] = '0' + nr_players; |
1321 | text[1] = '\0'; |
1322 | } |
1323 | - m_nr_of_players_ta->set_text(text); |
1324 | + nr_of_players_ta_->set_text(text); |
1325 | } |
1326 | |
1327 | // Now remove all the unneeded stuff. |
1328 | for (Widelands::PlayerNumber i = nr_players; i < MAX_PLAYERS; ++i) { |
1329 | - delete m_plr_names [i]; m_plr_names [i] = nullptr; |
1330 | - delete m_plr_set_pos_buts [i]; m_plr_set_pos_buts [i] = nullptr; |
1331 | - delete m_plr_set_tribes_buts[i]; m_plr_set_tribes_buts[i] = nullptr; |
1332 | + delete plr_names_ [i]; plr_names_ [i] = nullptr; |
1333 | + delete plr_set_pos_buts_ [i]; plr_set_pos_buts_ [i] = nullptr; |
1334 | + delete plr_set_tribes_buts_[i]; plr_set_tribes_buts_[i] = nullptr; |
1335 | } |
1336 | - int32_t posy = m_posy; |
1337 | + int32_t posy = posy_; |
1338 | int32_t const spacing = 5; |
1339 | int32_t const size = 20; |
1340 | |
1341 | iterate_player_numbers(p, nr_players) { |
1342 | int32_t posx = spacing; |
1343 | - if (!m_plr_names[p - 1]) { |
1344 | - m_plr_names[p - 1] = |
1345 | + if (!plr_names_[p - 1]) { |
1346 | + plr_names_[p - 1] = |
1347 | new UI::EditBox |
1348 | (this, posx, posy, 140, |
1349 | g_gr->images().get("images/ui_basic/but0.png")); |
1350 | - m_plr_names[p - 1]->changed.connect |
1351 | + plr_names_[p - 1]->changed.connect |
1352 | (boost::bind(&EditorPlayerMenu::name_changed, this, p - 1)); |
1353 | posx += 140 + spacing; |
1354 | - m_plr_names[p - 1]->set_text(map.get_scenario_player_name(p)); |
1355 | + plr_names_[p - 1]->set_text(map.get_scenario_player_name(p)); |
1356 | } |
1357 | |
1358 | - if (!m_plr_set_tribes_buts[p - 1]) { |
1359 | - m_plr_set_tribes_buts[p - 1] = |
1360 | + if (!plr_set_tribes_buts_[p - 1]) { |
1361 | + plr_set_tribes_buts_[p - 1] = |
1362 | new UI::Button |
1363 | (this, "tribe", |
1364 | posx, posy, 140, size, |
1365 | g_gr->images().get("images/ui_basic/but0.png"), |
1366 | ""); |
1367 | - m_plr_set_tribes_buts[p - 1]->sigclicked.connect |
1368 | + plr_set_tribes_buts_[p - 1]->sigclicked.connect |
1369 | (boost::bind(&EditorPlayerMenu::player_tribe_clicked, boost::ref(*this), p - 1)); |
1370 | posx += 140 + spacing; |
1371 | } |
1372 | |
1373 | // Get/Set (localized) tribe names |
1374 | if (map.get_scenario_player_tribe(p) != UNDEFINED_TRIBE_NAME) { |
1375 | - m_selected_tribes[p - 1] = map.get_scenario_player_tribe(p); |
1376 | + selected_tribes_[p - 1] = map.get_scenario_player_tribe(p); |
1377 | } else { |
1378 | - m_selected_tribes[p - 1] = m_tribenames[0]; |
1379 | - map.set_scenario_player_tribe(p, m_selected_tribes[p - 1]); |
1380 | + selected_tribes_[p - 1] = tribenames_[0]; |
1381 | + map.set_scenario_player_tribe(p, selected_tribes_[p - 1]); |
1382 | } |
1383 | |
1384 | - m_plr_set_tribes_buts[p - 1] |
1385 | - ->set_title(eia().egbase().tribes().tribeinfo(m_selected_tribes[p - 1]).descname); |
1386 | + plr_set_tribes_buts_[p - 1] |
1387 | + ->set_title(eia().egbase().tribes().tribeinfo(selected_tribes_[p - 1]).descname); |
1388 | |
1389 | // Set default AI and closeable to false (always default - should be changed by hand) |
1390 | map.set_scenario_player_ai(p, ""); |
1391 | map.set_scenario_player_closeable(p, false); |
1392 | |
1393 | // Set Starting pos button. |
1394 | - if (!m_plr_set_pos_buts[p - 1]) { |
1395 | - m_plr_set_pos_buts[p - 1] = |
1396 | + if (!plr_set_pos_buts_[p - 1]) { |
1397 | + plr_set_pos_buts_[p - 1] = |
1398 | new UI::Button |
1399 | (this, "starting_pos", |
1400 | posx, posy, size, size, |
1401 | g_gr->images().get("images/ui_basic/but0.png"), |
1402 | nullptr, |
1403 | ""); |
1404 | - m_plr_set_pos_buts[p - 1]->sigclicked.connect |
1405 | + plr_set_pos_buts_[p - 1]->sigclicked.connect |
1406 | (boost::bind(&EditorPlayerMenu::set_starting_pos_clicked, boost::ref(*this), p)); |
1407 | } |
1408 | const Image* player_image = g_gr->images().get(player_pictures_small[p - 1]); |
1409 | assert(player_image); |
1410 | |
1411 | - m_plr_set_pos_buts[p - 1]->set_pic(player_image); |
1412 | + plr_set_pos_buts_[p - 1]->set_pic(player_image); |
1413 | posy += size + spacing; |
1414 | } |
1415 | set_inner_size(get_inner_w(), posy + spacing); |
1416 | @@ -232,10 +232,10 @@ |
1417 | const std::string name = (boost::format(_("Player %u")) % static_cast<unsigned int>(nr_players)).str(); |
1418 | map.set_scenario_player_name(nr_players, name); |
1419 | } |
1420 | - map.set_scenario_player_tribe(nr_players, m_tribenames[0]); |
1421 | + map.set_scenario_player_tribe(nr_players, tribenames_[0]); |
1422 | eia().set_need_save(true); |
1423 | - m_add_player .set_enabled(nr_players < MAX_PLAYERS); |
1424 | - m_remove_last_player.set_enabled(true); |
1425 | + add_player_ .set_enabled(nr_players < MAX_PLAYERS); |
1426 | + remove_last_player_.set_enabled(true); |
1427 | update(); |
1428 | } |
1429 | |
1430 | @@ -259,8 +259,8 @@ |
1431 | set_starting_pos_clicked(nr_players); |
1432 | } |
1433 | map.set_nrplayers(nr_players); |
1434 | - m_add_player .set_enabled(nr_players < MAX_PLAYERS); |
1435 | - m_remove_last_player.set_enabled(1 < nr_players); |
1436 | + add_player_ .set_enabled(nr_players < MAX_PLAYERS); |
1437 | + remove_last_player_.set_enabled(1 < nr_players); |
1438 | |
1439 | update(); |
1440 | // TODO(SirVer): Take steps when the player is referenced someplace. Not |
1441 | @@ -274,18 +274,18 @@ |
1442 | void EditorPlayerMenu::player_tribe_clicked(uint8_t n) { |
1443 | EditorInteractive& menu = eia(); |
1444 | if (!menu.is_player_tribe_referenced(n + 1)) { |
1445 | - if (!Widelands::Tribes::tribe_exists(m_selected_tribes[n])) { |
1446 | + if (!Widelands::Tribes::tribe_exists(selected_tribes_[n])) { |
1447 | throw wexception |
1448 | - ("Map defines tribe %s, but it does not exist!", m_selected_tribes[n].c_str()); |
1449 | + ("Map defines tribe %s, but it does not exist!", selected_tribes_[n].c_str()); |
1450 | } |
1451 | uint32_t i; |
1452 | - for (i = 0; i < m_tribenames.size(); ++i) { |
1453 | - if (m_tribenames[i] == m_selected_tribes[n]) { |
1454 | + for (i = 0; i < tribenames_.size(); ++i) { |
1455 | + if (tribenames_[i] == selected_tribes_[n]) { |
1456 | break; |
1457 | } |
1458 | } |
1459 | - m_selected_tribes[n] = i == m_tribenames.size() - 1 ? m_tribenames[0] : m_tribenames[++i]; |
1460 | - menu.egbase().map().set_scenario_player_tribe(n + 1, m_selected_tribes[n]); |
1461 | + selected_tribes_[n] = i == tribenames_.size() - 1 ? tribenames_[0] : tribenames_[++i]; |
1462 | + menu.egbase().map().set_scenario_player_tribe(n + 1, selected_tribes_[n]); |
1463 | menu.set_need_save(true); |
1464 | } else { |
1465 | UI::WLMessageBox mmb |
1466 | @@ -331,15 +331,15 @@ |
1467 | */ |
1468 | void EditorPlayerMenu::name_changed(int32_t m) { |
1469 | // Player name has been changed. |
1470 | - std::string text = m_plr_names[m]->text(); |
1471 | + std::string text = plr_names_[m]->text(); |
1472 | EditorInteractive& menu = eia(); |
1473 | Widelands::Map & map = menu.egbase().map(); |
1474 | if (text == "") { |
1475 | text = map.get_scenario_player_name(m + 1); |
1476 | - m_plr_names[m]->set_text(text); |
1477 | + plr_names_[m]->set_text(text); |
1478 | } |
1479 | map.set_scenario_player_name(m + 1, text); |
1480 | - m_plr_names[m]->set_text(map.get_scenario_player_name(m + 1)); |
1481 | + plr_names_[m]->set_text(map.get_scenario_player_name(m + 1)); |
1482 | menu.set_need_save(true); |
1483 | } |
1484 | |
1485 | @@ -364,8 +364,8 @@ |
1486 | // so that this tribe can not be changed |
1487 | egbase.add_player |
1488 | (n, 0, // TODO(SirVer): initialization index makes no sense here |
1489 | - eia().egbase().tribes().tribeinfo(m_selected_tribes[n]).descname, |
1490 | - m_plr_names[n - 1]->text()); |
1491 | + eia().egbase().tribes().tribeinfo(selected_tribes_[n]).descname, |
1492 | + plr_names_[n - 1]->text()); |
1493 | |
1494 | p = egbase.get_player(n); |
1495 | } |
1496 | |
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 | |
1502 | private: |
1503 | EditorInteractive & eia(); |
1504 | - UI::UniqueWindow::Registry m_allow_buildings_menu; |
1505 | - UI::Textarea * m_nr_of_players_ta; |
1506 | - UI::EditBox * m_plr_names[MAX_PLAYERS]; |
1507 | - UI::Button |
1508 | - m_add_player, m_remove_last_player; |
1509 | - UI::Button |
1510 | - * m_plr_make_infrastructure_buts[MAX_PLAYERS], |
1511 | - * m_plr_set_pos_buts [MAX_PLAYERS], |
1512 | - * m_plr_set_tribes_buts [MAX_PLAYERS]; |
1513 | + UI::UniqueWindow::Registry allow_buildings_menu_; |
1514 | + UI::Textarea* nr_of_players_ta_; |
1515 | + UI::EditBox* plr_names_[MAX_PLAYERS]; |
1516 | + UI::Button add_player_, remove_last_player_; |
1517 | + UI::Button |
1518 | + * plr_make_infrastructure_buts_[MAX_PLAYERS], |
1519 | + * plr_set_pos_buts_ [MAX_PLAYERS], |
1520 | + * plr_set_tribes_buts_ [MAX_PLAYERS]; |
1521 | |
1522 | - std::vector<std::string> m_tribenames; |
1523 | + std::vector<std::string> tribenames_; |
1524 | |
1525 | /// List of the tribes currently selected for all players |
1526 | - std::string m_selected_tribes[MAX_PLAYERS]; |
1527 | + std::string selected_tribes_[MAX_PLAYERS]; |
1528 | |
1529 | - int32_t m_posy; |
1530 | + int32_t posy_; |
1531 | |
1532 | void name_changed(int32_t); |
1533 | void clicked_add_player (); |
1534 | |
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 | : |
1540 | EditorToolOptionsMenu |
1541 | (parent, registry, 250, 135, _("Height Tools Options")), |
1542 | - m_increase_tool(increase_tool), |
1543 | - m_change_by_label |
1544 | + increase_tool_(increase_tool), |
1545 | + change_by_label_ |
1546 | (this, |
1547 | hmargin(), vmargin(), get_inner_w() - 2 * hmargin(), height, |
1548 | _("Increase/Decrease Value"), UI::Align::kBottomCenter), |
1549 | - m_change_by_increase |
1550 | + change_by_increase_ |
1551 | (this, "incr_change_by", |
1552 | get_inner_w() - hmargin() - width, |
1553 | - m_change_by_label.get_y() + m_change_by_label.get_h() + spacing(), |
1554 | + change_by_label_.get_y() + change_by_label_.get_h() + spacing(), |
1555 | width, height, |
1556 | g_gr->images().get("images/ui_basic/but1.png"), |
1557 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), |
1558 | std::string(), |
1559 | increase_tool.get_change_by() < MAX_FIELD_HEIGHT_DIFF), |
1560 | - m_change_by_decrease |
1561 | + change_by_decrease_ |
1562 | (this, "decr_change_by", |
1563 | hmargin(), |
1564 | - m_change_by_increase.get_y(), |
1565 | + change_by_increase_.get_y(), |
1566 | width, height, |
1567 | g_gr->images().get("images/ui_basic/but1.png"), |
1568 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), |
1569 | std::string(), |
1570 | 1 < increase_tool.get_change_by()), |
1571 | - m_change_by_value |
1572 | + change_by_value_ |
1573 | (this, |
1574 | - m_change_by_increase.get_x() + m_change_by_increase.get_w() + |
1575 | + change_by_increase_.get_x() + change_by_increase_.get_w() + |
1576 | hspacing(), |
1577 | - m_change_by_increase.get_y(), |
1578 | - m_change_by_decrease.get_x() - hspacing() |
1579 | + change_by_increase_.get_y(), |
1580 | + change_by_decrease_.get_x() - hspacing() |
1581 | - |
1582 | - (m_change_by_increase.get_x() + m_change_by_increase.get_w() + |
1583 | + (change_by_increase_.get_x() + change_by_increase_.get_w() + |
1584 | hspacing()), |
1585 | height, |
1586 | UI::Align::kBottomCenter), |
1587 | - m_set_to_label |
1588 | + set_to_label_ |
1589 | (this, |
1590 | vmargin(), |
1591 | - m_change_by_increase.get_y() + m_change_by_increase.get_h() + |
1592 | + change_by_increase_.get_y() + change_by_increase_.get_h() + |
1593 | vspacing(), |
1594 | get_inner_w() - 2 * hmargin(), height, |
1595 | _("Set Value"), UI::Align::kBottomCenter), |
1596 | - m_set_to_increase |
1597 | + set_to_increase_ |
1598 | (this, "incr_set_to", |
1599 | - m_change_by_increase.get_x(), |
1600 | - m_set_to_label.get_y() + m_set_to_label.get_h() + vspacing(), |
1601 | + change_by_increase_.get_x(), |
1602 | + set_to_label_.get_y() + set_to_label_.get_h() + vspacing(), |
1603 | width, height, |
1604 | g_gr->images().get("images/ui_basic/but1.png"), |
1605 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), |
1606 | std::string(), |
1607 | increase_tool.set_tool().get_interval().min < MAX_FIELD_HEIGHT), |
1608 | - m_set_to_decrease |
1609 | + set_to_decrease_ |
1610 | (this, "decr_set_to", |
1611 | hmargin(), |
1612 | - m_set_to_increase.get_y(), |
1613 | + set_to_increase_.get_y(), |
1614 | width, height, |
1615 | g_gr->images().get("images/ui_basic/but1.png"), |
1616 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), |
1617 | std::string(), |
1618 | 0 < increase_tool.set_tool().get_interval().min), |
1619 | - m_set_to_value |
1620 | + set_to_value_ |
1621 | (this, |
1622 | - m_change_by_value.get_x(), m_set_to_increase.get_y(), |
1623 | - m_change_by_value.get_w(), height, |
1624 | + change_by_value_.get_x(), set_to_increase_.get_y(), |
1625 | + change_by_value_.get_w(), height, |
1626 | UI::Align::kBottomCenter) |
1627 | { |
1628 | - m_change_by_increase.sigclicked.connect |
1629 | + change_by_increase_.sigclicked.connect |
1630 | (boost::bind |
1631 | (&EditorToolChangeHeightOptionsMenu::clicked_change_by_increment, boost::ref(*this))); |
1632 | - m_change_by_decrease.sigclicked.connect |
1633 | + change_by_decrease_.sigclicked.connect |
1634 | (boost::bind |
1635 | (&EditorToolChangeHeightOptionsMenu::clicked_change_by_decrement, boost::ref(*this))); |
1636 | - m_set_to_increase.sigclicked.connect |
1637 | + set_to_increase_.sigclicked.connect |
1638 | (boost::bind(&EditorToolChangeHeightOptionsMenu::clicked_setto_increment, boost::ref(*this))); |
1639 | - m_set_to_decrease.sigclicked.connect |
1640 | + set_to_decrease_.sigclicked.connect |
1641 | (boost::bind(&EditorToolChangeHeightOptionsMenu::clicked_setto_decrement, boost::ref(*this))); |
1642 | |
1643 | - m_change_by_increase.set_repeating(true); |
1644 | - m_change_by_decrease.set_repeating(true); |
1645 | - m_set_to_increase .set_repeating(true); |
1646 | - m_set_to_decrease .set_repeating(true); |
1647 | + change_by_increase_.set_repeating(true); |
1648 | + change_by_decrease_.set_repeating(true); |
1649 | + set_to_increase_ .set_repeating(true); |
1650 | + set_to_decrease_ .set_repeating(true); |
1651 | update(); |
1652 | } |
1653 | |
1654 | |
1655 | void EditorToolChangeHeightOptionsMenu::clicked_change_by_decrement() { |
1656 | - int32_t change_by = m_increase_tool.get_change_by(); |
1657 | - assert(change_by == m_increase_tool.decrease_tool().get_change_by()); |
1658 | + int32_t change_by = increase_tool_.get_change_by(); |
1659 | + assert(change_by == increase_tool_.decrease_tool().get_change_by()); |
1660 | assert(1 < change_by); |
1661 | |
1662 | --change_by; |
1663 | |
1664 | - m_increase_tool .set_change_by(change_by); |
1665 | - m_increase_tool.decrease_tool().set_change_by(change_by); |
1666 | - m_change_by_decrease.set_enabled(1 < change_by); |
1667 | - m_change_by_increase.set_enabled(true); |
1668 | + increase_tool_ .set_change_by(change_by); |
1669 | + increase_tool_.decrease_tool().set_change_by(change_by); |
1670 | + change_by_decrease_.set_enabled(1 < change_by); |
1671 | + change_by_increase_.set_enabled(true); |
1672 | select_correct_tool(); |
1673 | update(); |
1674 | } |
1675 | |
1676 | |
1677 | void EditorToolChangeHeightOptionsMenu::clicked_change_by_increment() { |
1678 | - int32_t change_by = m_increase_tool.get_change_by(); |
1679 | - assert(change_by == m_increase_tool.decrease_tool().get_change_by()); |
1680 | + int32_t change_by = increase_tool_.get_change_by(); |
1681 | + assert(change_by == increase_tool_.decrease_tool().get_change_by()); |
1682 | assert(change_by < MAX_FIELD_HEIGHT_DIFF); |
1683 | |
1684 | ++change_by; |
1685 | |
1686 | - m_increase_tool .set_change_by(change_by); |
1687 | - m_increase_tool.decrease_tool().set_change_by(change_by); |
1688 | - m_change_by_decrease.set_enabled(true); |
1689 | - m_change_by_increase.set_enabled(change_by < MAX_FIELD_HEIGHT_DIFF); |
1690 | + increase_tool_ .set_change_by(change_by); |
1691 | + increase_tool_.decrease_tool().set_change_by(change_by); |
1692 | + change_by_decrease_.set_enabled(true); |
1693 | + change_by_increase_.set_enabled(change_by < MAX_FIELD_HEIGHT_DIFF); |
1694 | select_correct_tool(); |
1695 | update(); |
1696 | } |
1697 | @@ -157,16 +157,16 @@ |
1698 | |
1699 | void EditorToolChangeHeightOptionsMenu::clicked_setto_decrement() { |
1700 | Widelands::Field::Height setto = |
1701 | - m_increase_tool.set_tool().get_interval().min; |
1702 | - assert(setto == m_increase_tool.set_tool().get_interval().max); |
1703 | + increase_tool_.set_tool().get_interval().min; |
1704 | + assert(setto == increase_tool_.set_tool().get_interval().max); |
1705 | assert(0 < setto); |
1706 | |
1707 | --setto; |
1708 | |
1709 | - m_increase_tool.set_tool().set_interval |
1710 | + increase_tool_.set_tool().set_interval |
1711 | (Widelands::HeightInterval(setto, setto)); |
1712 | - m_set_to_decrease.set_enabled(0 < setto); |
1713 | - m_set_to_increase.set_enabled(true); |
1714 | + set_to_decrease_.set_enabled(0 < setto); |
1715 | + set_to_increase_.set_enabled(true); |
1716 | select_correct_tool(); |
1717 | update(); |
1718 | } |
1719 | @@ -174,16 +174,16 @@ |
1720 | |
1721 | void EditorToolChangeHeightOptionsMenu::clicked_setto_increment() { |
1722 | Widelands::Field::Height setto = |
1723 | - m_increase_tool.set_tool().get_interval().min; |
1724 | - assert(setto == m_increase_tool.set_tool().get_interval().max); |
1725 | + increase_tool_.set_tool().get_interval().min; |
1726 | + assert(setto == increase_tool_.set_tool().get_interval().max); |
1727 | assert(setto < MAX_FIELD_HEIGHT); |
1728 | |
1729 | ++setto; |
1730 | |
1731 | - m_increase_tool.set_tool().set_interval |
1732 | + increase_tool_.set_tool().set_interval |
1733 | (Widelands::HeightInterval(setto, setto)); |
1734 | - m_set_to_decrease.set_enabled(true); |
1735 | - m_set_to_increase.set_enabled(setto < MAX_FIELD_HEIGHT); |
1736 | + set_to_decrease_.set_enabled(true); |
1737 | + set_to_increase_.set_enabled(setto < MAX_FIELD_HEIGHT); |
1738 | select_correct_tool(); |
1739 | update(); |
1740 | } |
1741 | @@ -191,8 +191,8 @@ |
1742 | |
1743 | /// Update all the textareas, so that they represent the correct values. |
1744 | void EditorToolChangeHeightOptionsMenu::update() { |
1745 | - m_change_by_value.set_text(std::to_string(m_increase_tool.get_change_by())); |
1746 | + change_by_value_.set_text(std::to_string(increase_tool_.get_change_by())); |
1747 | |
1748 | - m_set_to_value.set_text(std::to_string( |
1749 | - static_cast<unsigned int>(m_increase_tool.set_tool().get_interval().min))); |
1750 | + set_to_value_.set_text(std::to_string( |
1751 | + static_cast<unsigned int>(increase_tool_.set_tool().get_interval().min))); |
1752 | } |
1753 | |
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 | UI::UniqueWindow::Registry &); |
1759 | |
1760 | private: |
1761 | - EditorIncreaseHeightTool & m_increase_tool; |
1762 | - UI::Textarea m_change_by_label; |
1763 | - UI::Button m_change_by_increase, m_change_by_decrease; |
1764 | - UI::Textarea m_change_by_value; |
1765 | - UI::Textarea m_set_to_label; |
1766 | - UI::Button m_set_to_increase, m_set_to_decrease; |
1767 | - UI::Textarea m_set_to_value; |
1768 | + EditorIncreaseHeightTool& increase_tool_; |
1769 | + UI::Textarea change_by_label_; |
1770 | + UI::Button change_by_increase_, change_by_decrease_; |
1771 | + UI::Textarea change_by_value_; |
1772 | + UI::Textarea set_to_label_; |
1773 | + UI::Button set_to_increase_, set_to_decrease_; |
1774 | + UI::Textarea set_to_value_; |
1775 | |
1776 | void clicked_change_by_decrement(); |
1777 | void clicked_change_by_increment(); |
1778 | |
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 | : |
1784 | EditorToolOptionsMenu |
1785 | (parent, registry, 250, 120, _("Resources")), |
1786 | - m_change_by_label |
1787 | + change_by_label_ |
1788 | (this, |
1789 | hmargin(), vmargin(), get_inner_w() - 2 * hmargin(), BUTTON_HEIGHT, |
1790 | _("Increase/Decrease Value"), UI::Align::kBottomCenter), |
1791 | - m_change_by_increase |
1792 | + change_by_increase_ |
1793 | (this, "incr_change_by", |
1794 | get_inner_w() - hmargin() - BUTTON_WIDTH, |
1795 | - m_change_by_label.get_y() + m_change_by_label.get_h() + spacing(), |
1796 | + change_by_label_.get_y() + change_by_label_.get_h() + spacing(), |
1797 | BUTTON_WIDTH, BUTTON_HEIGHT, |
1798 | g_gr->images().get("images/ui_basic/but1.png"), |
1799 | g_gr->images().get("images/ui_basic/scrollbar_up.png")), |
1800 | - m_change_by_decrease |
1801 | + change_by_decrease_ |
1802 | (this, "decr_change_by", |
1803 | hmargin(), |
1804 | - m_change_by_increase.get_y(), |
1805 | + change_by_increase_.get_y(), |
1806 | BUTTON_WIDTH, BUTTON_HEIGHT, |
1807 | g_gr->images().get("images/ui_basic/but1.png"), |
1808 | g_gr->images().get("images/ui_basic/scrollbar_down.png")), |
1809 | - m_change_by_value |
1810 | + change_by_value_ |
1811 | (this, |
1812 | - m_change_by_increase.get_x() + m_change_by_increase.get_w() + |
1813 | + change_by_increase_.get_x() + change_by_increase_.get_w() + |
1814 | hspacing(), |
1815 | - m_change_by_increase.get_y(), |
1816 | - m_change_by_decrease.get_x() - hspacing() |
1817 | + change_by_increase_.get_y(), |
1818 | + change_by_decrease_.get_x() - hspacing() |
1819 | - |
1820 | - (m_change_by_increase.get_x() + m_change_by_increase.get_w() + |
1821 | + (change_by_increase_.get_x() + change_by_increase_.get_w() + |
1822 | hspacing()), |
1823 | BUTTON_HEIGHT, |
1824 | UI::Align::kBottomCenter), |
1825 | - m_set_to_label |
1826 | + set_to_label_ |
1827 | (this, |
1828 | vmargin(), |
1829 | - m_change_by_increase.get_y() + m_change_by_increase.get_h() + vspacing(), |
1830 | + change_by_increase_.get_y() + change_by_increase_.get_h() + vspacing(), |
1831 | get_inner_w() - 2 * hmargin(), BUTTON_HEIGHT, |
1832 | _("Set Value"), UI::Align::kBottomCenter), |
1833 | - m_set_to_increase |
1834 | + set_to_increase_ |
1835 | (this, "incr_set_to", |
1836 | - m_change_by_increase.get_x(), |
1837 | - m_set_to_label.get_y() + m_set_to_label.get_h() + vspacing(), |
1838 | + change_by_increase_.get_x(), |
1839 | + set_to_label_.get_y() + set_to_label_.get_h() + vspacing(), |
1840 | BUTTON_WIDTH, BUTTON_HEIGHT, |
1841 | g_gr->images().get("images/ui_basic/but1.png"), |
1842 | g_gr->images().get("images/ui_basic/scrollbar_up.png")), |
1843 | - m_set_to_decrease |
1844 | + set_to_decrease_ |
1845 | (this, "decr_set_to", |
1846 | hmargin(), |
1847 | - m_set_to_increase.get_y(), BUTTON_WIDTH, BUTTON_HEIGHT, |
1848 | + set_to_increase_.get_y(), BUTTON_WIDTH, BUTTON_HEIGHT, |
1849 | g_gr->images().get("images/ui_basic/but1.png"), |
1850 | g_gr->images().get("images/ui_basic/scrollbar_down.png")), |
1851 | - m_set_to_value |
1852 | + set_to_value_ |
1853 | (this, |
1854 | - m_change_by_value.get_x(), m_set_to_increase.get_y(), |
1855 | - m_change_by_value.get_w(), BUTTON_HEIGHT, |
1856 | + change_by_value_.get_x(), set_to_increase_.get_y(), |
1857 | + change_by_value_.get_w(), BUTTON_HEIGHT, |
1858 | UI::Align::kBottomCenter), |
1859 | - m_cur_selection(this, 0, 0, _("Current Selection"), UI::Align::kBottomCenter), |
1860 | - m_increase_tool(increase_tool) |
1861 | + cur_selection_(this, 0, 0, _("Current Selection"), UI::Align::kBottomCenter), |
1862 | + increase_tool_(increase_tool) |
1863 | { |
1864 | - m_change_by_increase.sigclicked.connect |
1865 | + change_by_increase_.sigclicked.connect |
1866 | (boost::bind |
1867 | (&EditorToolChangeResourcesOptionsMenu::clicked_button, |
1868 | boost::ref(*this), |
1869 | Change_By_Increase)); |
1870 | - m_change_by_decrease.sigclicked.connect |
1871 | + change_by_decrease_.sigclicked.connect |
1872 | (boost::bind |
1873 | (&EditorToolChangeResourcesOptionsMenu::clicked_button, |
1874 | boost::ref(*this), |
1875 | Change_By_Decrease)); |
1876 | - m_set_to_increase.sigclicked.connect |
1877 | + set_to_increase_.sigclicked.connect |
1878 | (boost::bind |
1879 | (&EditorToolChangeResourcesOptionsMenu::clicked_button, |
1880 | boost::ref(*this), |
1881 | Set_To_Increase)); |
1882 | - m_set_to_decrease.sigclicked.connect |
1883 | + set_to_decrease_.sigclicked.connect |
1884 | (boost::bind |
1885 | (&EditorToolChangeResourcesOptionsMenu::clicked_button, |
1886 | boost::ref(*this), |
1887 | Set_To_Decrease)); |
1888 | |
1889 | - m_change_by_increase.set_repeating(true); |
1890 | - m_change_by_decrease.set_repeating(true); |
1891 | - m_set_to_increase .set_repeating(true); |
1892 | - m_set_to_decrease .set_repeating(true); |
1893 | + change_by_increase_.set_repeating(true); |
1894 | + change_by_decrease_.set_repeating(true); |
1895 | + set_to_increase_ .set_repeating(true); |
1896 | + set_to_decrease_ .set_repeating(true); |
1897 | const Widelands::World & world = parent.egbase().world(); |
1898 | Widelands::DescriptionIndex const nr_resources = world.get_nr_resources(); |
1899 | |
1900 | @@ -149,14 +149,14 @@ |
1901 | / |
1902 | (resource_pic_max_width + spacing()); |
1903 | |
1904 | - m_radiogroup.changed.connect |
1905 | + radiogroup_.changed.connect |
1906 | (boost::bind(&EditorToolChangeResourcesOptionsMenu::selected, this)); |
1907 | - m_radiogroup.clicked.connect |
1908 | + radiogroup_.clicked.connect |
1909 | (boost::bind(&EditorToolChangeResourcesOptionsMenu::selected, this)); |
1910 | |
1911 | uint16_t cur_x = 0; |
1912 | Point pos |
1913 | - (hmargin(), m_set_to_value.get_y() + m_set_to_value.get_h() + vspacing()); |
1914 | + (hmargin(), set_to_value_.get_y() + set_to_value_.get_h() + vspacing()); |
1915 | for |
1916 | (Widelands::DescriptionIndex i = 0; |
1917 | i < nr_resources; |
1918 | @@ -167,17 +167,17 @@ |
1919 | pos.x = hmargin(); |
1920 | pos.y += resource_pic_max_height + vspacing(); |
1921 | } |
1922 | - m_radiogroup.add_button |
1923 | + radiogroup_.add_button |
1924 | (this, |
1925 | pos, |
1926 | g_gr->images().get(world.get_resource(i)->representative_image())); |
1927 | } |
1928 | pos.y += resource_pic_max_height + vspacing(); |
1929 | |
1930 | - set_inner_size(get_inner_w(), pos.y + m_cur_selection.get_h() + vmargin()); |
1931 | - m_cur_selection.set_pos(Point(get_inner_w() / 2, pos.y + hspacing())); |
1932 | + set_inner_size(get_inner_w(), pos.y + cur_selection_.get_h() + vmargin()); |
1933 | + cur_selection_.set_pos(Point(get_inner_w() / 2, pos.y + hspacing())); |
1934 | |
1935 | - m_radiogroup.set_state(m_increase_tool.get_cur_res()); |
1936 | + radiogroup_.set_state(increase_tool_.get_cur_res()); |
1937 | |
1938 | update(); |
1939 | } |
1940 | @@ -186,12 +186,12 @@ |
1941 | void EditorToolChangeResourcesOptionsMenu::clicked_button(Button const n) |
1942 | { |
1943 | assert |
1944 | - (m_increase_tool.get_change_by() |
1945 | + (increase_tool_.get_change_by() |
1946 | == |
1947 | - m_increase_tool.decrease_tool().get_change_by()); |
1948 | + increase_tool_.decrease_tool().get_change_by()); |
1949 | |
1950 | - int32_t change_by = m_increase_tool.get_change_by(); |
1951 | - int32_t set_to = m_increase_tool.set_tool().get_set_to(); |
1952 | + int32_t change_by = increase_tool_.get_change_by(); |
1953 | + int32_t set_to = increase_tool_.set_tool().get_set_to(); |
1954 | |
1955 | switch (n) { |
1956 | case Change_By_Increase: change_by += change_by < 63; break; |
1957 | @@ -202,9 +202,9 @@ |
1958 | NEVER_HERE(); |
1959 | break; |
1960 | } |
1961 | - m_increase_tool.set_change_by(change_by); |
1962 | - m_increase_tool.decrease_tool().set_change_by(change_by); |
1963 | - m_increase_tool.set_tool().set_set_to(set_to); |
1964 | + increase_tool_.set_change_by(change_by); |
1965 | + increase_tool_.decrease_tool().set_change_by(change_by); |
1966 | + increase_tool_.set_tool().set_set_to(set_to); |
1967 | |
1968 | select_correct_tool(); |
1969 | update(); |
1970 | @@ -214,11 +214,11 @@ |
1971 | * called when a resource has been selected |
1972 | */ |
1973 | void EditorToolChangeResourcesOptionsMenu::selected() { |
1974 | - const int32_t resIx = m_radiogroup.get_state(); |
1975 | + const int32_t resIx = radiogroup_.get_state(); |
1976 | |
1977 | - m_increase_tool.set_tool().set_cur_res(resIx); |
1978 | - m_increase_tool.set_cur_res(resIx); |
1979 | - m_increase_tool.decrease_tool().set_cur_res(resIx); |
1980 | + increase_tool_.set_tool().set_cur_res(resIx); |
1981 | + increase_tool_.set_cur_res(resIx); |
1982 | + increase_tool_.decrease_tool().set_cur_res(resIx); |
1983 | |
1984 | Widelands::EditorGameBase& egbase = eia().egbase(); |
1985 | Widelands::Map & map = egbase.map(); |
1986 | @@ -241,25 +241,25 @@ |
1987 | */ |
1988 | void EditorToolChangeResourcesOptionsMenu::update() { |
1989 | |
1990 | - m_change_by_value.set_text(std::to_string(m_increase_tool.get_change_by())); |
1991 | - |
1992 | - m_set_to_value.set_text(std::to_string( |
1993 | - static_cast<unsigned int>(m_increase_tool.set_tool().get_set_to()))); |
1994 | - |
1995 | - m_cur_selection.set_text |
1996 | - (eia().egbase().world().get_resource(m_increase_tool.set_tool().get_cur_res())->descname()); |
1997 | - m_cur_selection.set_pos |
1998 | + change_by_value_.set_text(std::to_string(increase_tool_.get_change_by())); |
1999 | + |
2000 | + set_to_value_.set_text(std::to_string( |
2001 | + static_cast<unsigned int>(increase_tool_.set_tool().get_set_to()))); |
2002 | + |
2003 | + cur_selection_.set_text |
2004 | + (eia().egbase().world().get_resource(increase_tool_.set_tool().get_cur_res())->descname()); |
2005 | + cur_selection_.set_pos |
2006 | (Point |
2007 | - ((get_inner_w() - m_cur_selection.get_w()) / 2, get_inner_h() - 20)); |
2008 | + ((get_inner_w() - cur_selection_.get_w()) / 2, get_inner_h() - 20)); |
2009 | |
2010 | { |
2011 | - int32_t const change_by = m_increase_tool.get_change_by(); |
2012 | - m_change_by_decrease.set_enabled(1 < change_by); |
2013 | - m_change_by_increase.set_enabled (change_by < 63); |
2014 | + int32_t const change_by = increase_tool_.get_change_by(); |
2015 | + change_by_decrease_.set_enabled(1 < change_by); |
2016 | + change_by_increase_.set_enabled (change_by < 63); |
2017 | } |
2018 | { |
2019 | - int32_t const set_to = m_increase_tool.set_tool().get_set_to(); |
2020 | - m_set_to_decrease .set_enabled(0 < set_to); |
2021 | - m_set_to_increase .set_enabled (set_to < 63); |
2022 | + int32_t const set_to = increase_tool_.set_tool().get_set_to(); |
2023 | + set_to_decrease_ .set_enabled(0 < set_to); |
2024 | + set_to_increase_ .set_enabled (set_to < 63); |
2025 | } |
2026 | } |
2027 | |
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 | }; |
2033 | void clicked_button(Button); |
2034 | void update(); |
2035 | - UI::Textarea m_change_by_label; |
2036 | - UI::Button m_change_by_increase, m_change_by_decrease; |
2037 | - UI::Textarea m_change_by_value; |
2038 | - UI::Textarea m_set_to_label; |
2039 | - UI::Button m_set_to_increase, m_set_to_decrease; |
2040 | - UI::Textarea m_set_to_value; |
2041 | - UI::Textarea m_cur_selection; |
2042 | - UI::Radiogroup m_radiogroup; |
2043 | - EditorIncreaseResourcesTool & m_increase_tool; |
2044 | + UI::Textarea change_by_label_; |
2045 | + UI::Button change_by_increase_, change_by_decrease_; |
2046 | + UI::Textarea change_by_value_; |
2047 | + UI::Textarea set_to_label_; |
2048 | + UI::Button set_to_increase_, set_to_decrease_; |
2049 | + UI::Textarea set_to_value_; |
2050 | + UI::Textarea cur_selection_; |
2051 | + UI::Radiogroup radiogroup_; |
2052 | + EditorIncreaseResourcesTool& increase_tool_; |
2053 | }; |
2054 | |
2055 | #endif // end of include guard: WL_EDITOR_UI_MENUS_EDITOR_TOOL_CHANGE_RESOURCES_OPTIONS_MENU_H |
2056 | |
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 | : |
2062 | EditorToolOptionsMenu |
2063 | (parent, registry, 250, 3 * height + 4 * vspacing() + 2 * vmargin(), _("Noise Height Options")), |
2064 | - m_noise_tool(noise_tool), |
2065 | - m_lower_label |
2066 | + noise_tool_(noise_tool), |
2067 | + lower_label_ |
2068 | (this, |
2069 | hmargin(), |
2070 | vmargin(), |
2071 | width, height, |
2072 | UI::Align::kLeft), |
2073 | - m_upper_label |
2074 | + upper_label_ |
2075 | (this, |
2076 | hmargin(), |
2077 | - m_lower_label.get_y() + m_lower_label.get_h() + 2 * vspacing(), |
2078 | + lower_label_.get_y() + lower_label_.get_h() + 2 * vspacing(), |
2079 | width, height, |
2080 | UI::Align::kLeft), |
2081 | - m_lower_decrease |
2082 | + lower_decrease_ |
2083 | (this, "decr_lower", |
2084 | get_inner_w() - 2 * width - hspacing(), |
2085 | - m_lower_label.get_y(), |
2086 | + lower_label_.get_y(), |
2087 | width, height, |
2088 | g_gr->images().get("images/ui_basic/but0.png"), |
2089 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), |
2090 | std::string(), |
2091 | 0 < noise_tool.get_interval().min), |
2092 | - m_lower_increase |
2093 | + lower_increase_ |
2094 | (this, "incr_lower", |
2095 | get_inner_w() - width - hspacing(), |
2096 | - m_lower_label.get_y(), |
2097 | + lower_label_.get_y(), |
2098 | width, height, |
2099 | g_gr->images().get("images/ui_basic/but0.png"), |
2100 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), |
2101 | std::string(), |
2102 | noise_tool.get_interval().min < MAX_FIELD_HEIGHT), |
2103 | - m_upper_decrease |
2104 | + upper_decrease_ |
2105 | (this, "decr_upper", |
2106 | get_inner_w() - 2 * width - hspacing(), |
2107 | - m_upper_label.get_y(), |
2108 | + upper_label_.get_y(), |
2109 | width, height, |
2110 | g_gr->images().get("images/ui_basic/but0.png"), |
2111 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), |
2112 | std::string(), |
2113 | 0 < noise_tool.get_interval().max), |
2114 | - m_upper_increase |
2115 | + upper_increase_ |
2116 | (this, "incr_upper", |
2117 | get_inner_w() - width - hspacing(), |
2118 | - m_upper_label.get_y(), |
2119 | + upper_label_.get_y(), |
2120 | width, height, |
2121 | g_gr->images().get("images/ui_basic/but0.png"), |
2122 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), |
2123 | std::string(), |
2124 | noise_tool.get_interval().max < MAX_FIELD_HEIGHT), |
2125 | - m_set_label |
2126 | + set_label_ |
2127 | (this, |
2128 | hmargin(), |
2129 | - m_upper_label.get_y() + m_upper_label.get_h() + 2 * vspacing(), |
2130 | + upper_label_.get_y() + upper_label_.get_h() + 2 * vspacing(), |
2131 | width, height, |
2132 | UI::Align::kLeft), |
2133 | - m_setto_decrease |
2134 | + setto_decrease_ |
2135 | (this, "decr_set_to", |
2136 | get_inner_w() - 2 * width - hspacing(), |
2137 | - m_set_label.get_y(), |
2138 | + set_label_.get_y(), |
2139 | width, height, |
2140 | g_gr->images().get("images/ui_basic/but1.png"), |
2141 | g_gr->images().get("images/ui_basic/scrollbar_down.png"), |
2142 | std::string(), |
2143 | 0 < noise_tool.set_tool().get_interval().min), |
2144 | - m_setto_increase |
2145 | + setto_increase_ |
2146 | (this, "incr_set_to", |
2147 | get_inner_w() - width - hspacing(), |
2148 | - m_set_label.get_y(), |
2149 | + set_label_.get_y(), |
2150 | width, height, |
2151 | g_gr->images().get("images/ui_basic/but1.png"), |
2152 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), |
2153 | std::string(), |
2154 | noise_tool.set_tool().get_interval().max < MAX_FIELD_HEIGHT) |
2155 | { |
2156 | - m_lower_increase.sigclicked.connect |
2157 | + lower_increase_.sigclicked.connect |
2158 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_lower_increase, boost::ref(*this))); |
2159 | - m_lower_decrease.sigclicked.connect |
2160 | + lower_decrease_.sigclicked.connect |
2161 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_lower_decrease, boost::ref(*this))); |
2162 | - m_upper_increase.sigclicked.connect |
2163 | + upper_increase_.sigclicked.connect |
2164 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_upper_increase, boost::ref(*this))); |
2165 | - m_upper_decrease.sigclicked.connect |
2166 | + upper_decrease_.sigclicked.connect |
2167 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_upper_decrease, boost::ref(*this))); |
2168 | - m_setto_increase.sigclicked.connect |
2169 | + setto_increase_.sigclicked.connect |
2170 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_setto_increase, boost::ref(*this))); |
2171 | - m_setto_decrease.sigclicked.connect |
2172 | + setto_decrease_.sigclicked.connect |
2173 | (boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_setto_decrease, boost::ref(*this))); |
2174 | |
2175 | - m_lower_increase.set_repeating(true); |
2176 | - m_lower_decrease.set_repeating(true); |
2177 | - m_upper_increase.set_repeating(true); |
2178 | - m_upper_decrease.set_repeating(true); |
2179 | - m_setto_increase.set_repeating(true); |
2180 | - m_setto_decrease.set_repeating(true); |
2181 | + lower_increase_.set_repeating(true); |
2182 | + lower_decrease_.set_repeating(true); |
2183 | + upper_increase_.set_repeating(true); |
2184 | + upper_decrease_.set_repeating(true); |
2185 | + setto_increase_.set_repeating(true); |
2186 | + setto_decrease_.set_repeating(true); |
2187 | update(); |
2188 | } |
2189 | |
2190 | @@ -143,23 +143,23 @@ |
2191 | * Update all textareas |
2192 | */ |
2193 | void EditorToolNoiseHeightOptionsMenu::update() { |
2194 | - const Widelands::HeightInterval height_interval = m_noise_tool.get_interval(); |
2195 | + const Widelands::HeightInterval height_interval = noise_tool_.get_interval(); |
2196 | |
2197 | - m_lower_label.set_text((boost::format(_("Minimum: %u")) |
2198 | + lower_label_.set_text((boost::format(_("Minimum: %u")) |
2199 | % static_cast<unsigned int>(height_interval.min)).str()); |
2200 | |
2201 | - m_upper_label.set_text((boost::format(_("Maximum: %u")) |
2202 | + upper_label_.set_text((boost::format(_("Maximum: %u")) |
2203 | % static_cast<unsigned int>(height_interval.max)).str()); |
2204 | |
2205 | - m_set_label.set_text((boost::format(_("Set value: %u")) |
2206 | - % static_cast<unsigned int>(m_noise_tool.set_tool().get_interval().min)).str()); |
2207 | + set_label_.set_text((boost::format(_("Set value: %u")) |
2208 | + % static_cast<unsigned int>(noise_tool_.set_tool().get_interval().min)).str()); |
2209 | |
2210 | select_correct_tool(); |
2211 | } |
2212 | |
2213 | |
2214 | void EditorToolNoiseHeightOptionsMenu::clicked_lower_decrease() { |
2215 | - Widelands::HeightInterval height_interval = m_noise_tool.get_interval(); |
2216 | + Widelands::HeightInterval height_interval = noise_tool_.get_interval(); |
2217 | |
2218 | assert(height_interval.valid()); |
2219 | assert(0 < height_interval.min); |
2220 | @@ -168,15 +168,15 @@ |
2221 | |
2222 | assert(height_interval.valid()); |
2223 | |
2224 | - m_noise_tool.set_interval(height_interval); |
2225 | - m_lower_decrease.set_enabled(0 < height_interval.min); |
2226 | - m_lower_increase.set_enabled(true); |
2227 | + noise_tool_.set_interval(height_interval); |
2228 | + lower_decrease_.set_enabled(0 < height_interval.min); |
2229 | + lower_increase_.set_enabled(true); |
2230 | update(); |
2231 | } |
2232 | |
2233 | |
2234 | void EditorToolNoiseHeightOptionsMenu::clicked_lower_increase() { |
2235 | - Widelands::HeightInterval height_interval = m_noise_tool.get_interval(); |
2236 | + Widelands::HeightInterval height_interval = noise_tool_.get_interval(); |
2237 | |
2238 | assert(height_interval.valid()); |
2239 | assert(height_interval.min < MAX_FIELD_HEIGHT); |
2240 | @@ -186,55 +186,55 @@ |
2241 | |
2242 | assert(height_interval.valid()); |
2243 | |
2244 | - m_noise_tool.set_interval(height_interval); |
2245 | - m_lower_decrease.set_enabled(true); |
2246 | - m_lower_increase.set_enabled(height_interval.min < MAX_FIELD_HEIGHT); |
2247 | - m_upper_decrease.set_enabled(true); |
2248 | - m_upper_increase.set_enabled(height_interval.max < MAX_FIELD_HEIGHT); |
2249 | + noise_tool_.set_interval(height_interval); |
2250 | + lower_decrease_.set_enabled(true); |
2251 | + lower_increase_.set_enabled(height_interval.min < MAX_FIELD_HEIGHT); |
2252 | + upper_decrease_.set_enabled(true); |
2253 | + upper_increase_.set_enabled(height_interval.max < MAX_FIELD_HEIGHT); |
2254 | |
2255 | update(); |
2256 | } |
2257 | |
2258 | |
2259 | void EditorToolNoiseHeightOptionsMenu::clicked_upper_decrease() { |
2260 | - Widelands::HeightInterval height_interval = m_noise_tool.get_interval(); |
2261 | + Widelands::HeightInterval height_interval = noise_tool_.get_interval(); |
2262 | |
2263 | assert(height_interval.valid()); |
2264 | - assert(0 < m_noise_tool.get_interval().max); |
2265 | + assert(0 < noise_tool_.get_interval().max); |
2266 | |
2267 | --height_interval.max; |
2268 | height_interval.min = std::min(height_interval.min, height_interval.max); |
2269 | |
2270 | assert(height_interval.valid()); |
2271 | |
2272 | - m_noise_tool.set_interval(height_interval); |
2273 | - m_lower_decrease.set_enabled(0 < height_interval.min); |
2274 | - m_lower_increase.set_enabled(true); |
2275 | - m_upper_decrease.set_enabled(0 < height_interval.max); |
2276 | - m_upper_increase.set_enabled(true); |
2277 | + noise_tool_.set_interval(height_interval); |
2278 | + lower_decrease_.set_enabled(0 < height_interval.min); |
2279 | + lower_increase_.set_enabled(true); |
2280 | + upper_decrease_.set_enabled(0 < height_interval.max); |
2281 | + upper_increase_.set_enabled(true); |
2282 | update(); |
2283 | } |
2284 | |
2285 | |
2286 | void EditorToolNoiseHeightOptionsMenu::clicked_upper_increase() { |
2287 | - Widelands::HeightInterval height_interval = m_noise_tool.get_interval(); |
2288 | + Widelands::HeightInterval height_interval = noise_tool_.get_interval(); |
2289 | |
2290 | - assert(m_noise_tool.get_interval().valid()); |
2291 | - assert(m_noise_tool.get_interval().max < MAX_FIELD_HEIGHT); |
2292 | + assert(noise_tool_.get_interval().valid()); |
2293 | + assert(noise_tool_.get_interval().max < MAX_FIELD_HEIGHT); |
2294 | |
2295 | ++height_interval.max; |
2296 | |
2297 | - assert(m_noise_tool.get_interval().valid()); |
2298 | + assert(noise_tool_.get_interval().valid()); |
2299 | |
2300 | - m_noise_tool.set_interval(height_interval); |
2301 | - m_upper_decrease.set_enabled(true); |
2302 | - m_upper_increase.set_enabled(height_interval.max < MAX_FIELD_HEIGHT); |
2303 | + noise_tool_.set_interval(height_interval); |
2304 | + upper_decrease_.set_enabled(true); |
2305 | + upper_increase_.set_enabled(height_interval.max < MAX_FIELD_HEIGHT); |
2306 | update(); |
2307 | } |
2308 | |
2309 | |
2310 | void EditorToolNoiseHeightOptionsMenu::clicked_setto_decrease() { |
2311 | - EditorSetHeightTool & set_tool = m_noise_tool.set_tool(); |
2312 | + EditorSetHeightTool & set_tool = noise_tool_.set_tool(); |
2313 | Field::Height h = set_tool.get_interval().min; |
2314 | |
2315 | assert(h == set_tool.get_interval().max); |
2316 | @@ -243,14 +243,14 @@ |
2317 | --h; |
2318 | |
2319 | set_tool.set_interval(Widelands::HeightInterval(h, h)); |
2320 | - m_setto_decrease.set_enabled(0 < h); |
2321 | - m_setto_increase.set_enabled(true); |
2322 | + setto_decrease_.set_enabled(0 < h); |
2323 | + setto_increase_.set_enabled(true); |
2324 | update(); |
2325 | } |
2326 | |
2327 | |
2328 | void EditorToolNoiseHeightOptionsMenu::clicked_setto_increase() { |
2329 | - EditorSetHeightTool & set_tool = m_noise_tool.set_tool(); |
2330 | + EditorSetHeightTool & set_tool = noise_tool_.set_tool(); |
2331 | Field::Height h = set_tool.get_interval().min; |
2332 | |
2333 | assert(h == set_tool.get_interval().max); |
2334 | @@ -259,7 +259,7 @@ |
2335 | ++h; |
2336 | |
2337 | set_tool.set_interval(Widelands::HeightInterval(h, h)); |
2338 | - m_setto_decrease.set_enabled(true); |
2339 | - m_setto_increase.set_enabled(h < MAX_FIELD_HEIGHT); |
2340 | + setto_decrease_.set_enabled(true); |
2341 | + setto_increase_.set_enabled(h < MAX_FIELD_HEIGHT); |
2342 | update(); |
2343 | } |
2344 | |
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 | UI::UniqueWindow::Registry &); |
2350 | |
2351 | private: |
2352 | - EditorNoiseHeightTool & m_noise_tool; |
2353 | - UI::Textarea m_lower_label, m_upper_label; |
2354 | - UI::Button m_lower_decrease, m_lower_increase, m_upper_decrease, m_upper_increase; |
2355 | - UI::Textarea m_set_label; |
2356 | - UI::Button m_setto_decrease, m_setto_increase; |
2357 | + EditorNoiseHeightTool& noise_tool_; |
2358 | + UI::Textarea lower_label_, upper_label_; |
2359 | + UI::Button lower_decrease_, lower_increase_, upper_decrease_, upper_increase_; |
2360 | + UI::Textarea set_label_; |
2361 | + UI::Button setto_decrease_, setto_increase_; |
2362 | |
2363 | void clicked_lower_decrease(); |
2364 | void clicked_lower_increase(); |
2365 | |
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 | : |
2371 | UI::UniqueWindow |
2372 | (&parent, "tool_options_menu", ®istry, width, height, title), |
2373 | - m_current_pointer(parent.tools()->current_pointer) |
2374 | + current_pointer_(parent.tools()->current_pointer) |
2375 | { |
2376 | if (get_usedefaultpos()) |
2377 | center_to_parent(); |
2378 | @@ -36,5 +36,5 @@ |
2379 | |
2380 | void EditorToolOptionsMenu::select_correct_tool() { |
2381 | dynamic_cast<EditorInteractive&>(*get_parent()) |
2382 | - .select_tool(*m_current_pointer, EditorTool::First); |
2383 | + .select_tool(*current_pointer_, EditorTool::First); |
2384 | } |
2385 | |
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 | EditorToolOptionsMenu |
2391 | (EditorInteractive & parent, |
2392 | UI::UniqueWindow::Registry &, |
2393 | - const uint32_t widht, const uint32_t height, |
2394 | + const uint32_t width, const uint32_t height, |
2395 | char const * title); |
2396 | |
2397 | /** |
2398 | @@ -43,7 +43,7 @@ |
2399 | uint32_t vmargin () const {return spacing();} |
2400 | |
2401 | private: |
2402 | - EditorTool * m_current_pointer; |
2403 | + EditorTool * current_pointer_; |
2404 | }; |
2405 | |
2406 | #endif // end of include guard: WL_EDITOR_UI_MENUS_EDITOR_TOOL_OPTIONS_MENU_H |
2407 | |
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 | : |
2413 | EditorToolOptionsMenu(parent, registry, 100, 100, _("Animals")), |
2414 | |
2415 | -m_tabpanel (this, 0, 0, g_gr->images().get("images/ui_basic/but1.png")), |
2416 | -m_pit (pit), |
2417 | -m_click_recursion_protect(false) |
2418 | +tabpanel_ (this, 0, 0, g_gr->images().get("images/ui_basic/but1.png")), |
2419 | +pit_ (pit), |
2420 | +click_recursion_protect_(false) |
2421 | { |
2422 | int32_t const space = 5; |
2423 | const Widelands::World & world = parent.egbase().world(); |
2424 | @@ -58,7 +58,7 @@ |
2425 | 24U), |
2426 | 12U); |
2427 | |
2428 | - set_center_panel(&m_tabpanel); |
2429 | + set_center_panel(&tabpanel_); |
2430 | |
2431 | uint32_t width = 0, height = 0; |
2432 | for (int32_t j = 0; j < nr_bobs; ++j) { |
2433 | @@ -81,8 +81,8 @@ |
2434 | if (cur_x == bobs_in_row) { |
2435 | cur_x = 0; |
2436 | pos = Point(5, 15); |
2437 | - box = new UI::Box(&m_tabpanel, 0, 0, UI::Box::Horizontal); |
2438 | - m_tabpanel.add("icons", tab_icon, box); |
2439 | + box = new UI::Box(&tabpanel_, 0, 0, UI::Box::Horizontal); |
2440 | + tabpanel_.add("icons", tab_icon, box); |
2441 | } |
2442 | |
2443 | const Widelands::BobDescr & descr = *world.get_bob_descr(i); |
2444 | @@ -94,9 +94,9 @@ |
2445 | critter_descr ? critter_descr->descname() : std::string()); |
2446 | |
2447 | cb.set_desired_size(width, height); |
2448 | - cb.set_state(m_pit.is_enabled(i)); |
2449 | + cb.set_state(pit_.is_enabled(i)); |
2450 | cb.changedto.connect(boost::bind(&EditorToolPlaceBobOptionsMenu::clicked, this, i, _1)); |
2451 | - m_checkboxes.push_back(&cb); |
2452 | + checkboxes_.push_back(&cb); |
2453 | box->add(&cb, UI::Align::kLeft); |
2454 | box->add_space(space); |
2455 | pos.x += width + 1 + space; |
2456 | @@ -104,7 +104,7 @@ |
2457 | ++i; |
2458 | } |
2459 | |
2460 | - m_tabpanel.activate(0); |
2461 | + tabpanel_.activate(0); |
2462 | } |
2463 | |
2464 | |
2465 | @@ -114,7 +114,7 @@ |
2466 | void EditorToolPlaceBobOptionsMenu::clicked |
2467 | (int32_t const n, bool const t) |
2468 | { |
2469 | - if (m_click_recursion_protect) |
2470 | + if (click_recursion_protect_) |
2471 | return; |
2472 | |
2473 | // TODO(unknown): This code is erroneous. It checks the current key state. What it |
2474 | @@ -122,23 +122,23 @@ |
2475 | // TODO(unknown): usage comment for get_key_state. |
2476 | const bool multiselect = |
2477 | get_key_state(SDL_SCANCODE_LCTRL) | get_key_state(SDL_SCANCODE_RCTRL); |
2478 | - if (!t && (!multiselect || m_pit.get_nr_enabled() == 1)) { |
2479 | - m_checkboxes[n]->set_state(true); |
2480 | + if (!t && (!multiselect || pit_.get_nr_enabled() == 1)) { |
2481 | + checkboxes_[n]->set_state(true); |
2482 | return; |
2483 | } |
2484 | |
2485 | if (!multiselect) { |
2486 | - for (uint32_t i = 0; m_pit.get_nr_enabled(); ++i) m_pit.enable(i, false); |
2487 | + for (uint32_t i = 0; pit_.get_nr_enabled(); ++i) pit_.enable(i, false); |
2488 | |
2489 | // disable all checkboxes |
2490 | - m_click_recursion_protect = true; |
2491 | - for (uint32_t i = 0; i < m_checkboxes.size(); ++i) { |
2492 | + click_recursion_protect_ = true; |
2493 | + for (uint32_t i = 0; i < checkboxes_.size(); ++i) { |
2494 | if (i != static_cast<uint32_t>(n)) |
2495 | - m_checkboxes[i]->set_state(false); |
2496 | + checkboxes_[i]->set_state(false); |
2497 | } |
2498 | - m_click_recursion_protect = false; |
2499 | + click_recursion_protect_ = false; |
2500 | } |
2501 | |
2502 | - m_pit.enable(n, t); |
2503 | + pit_.enable(n, t); |
2504 | select_correct_tool(); |
2505 | } |
2506 | |
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 | UI::UniqueWindow::Registry &); |
2512 | |
2513 | private: |
2514 | - UI::TabPanel m_tabpanel; |
2515 | - std::vector<UI::Checkbox *> m_checkboxes; |
2516 | - EditorPlaceBobTool & m_pit; |
2517 | void clicked(int32_t, bool); |
2518 | - bool m_click_recursion_protect; |
2519 | + |
2520 | + UI::TabPanel tabpanel_; |
2521 | + std::vector<UI::Checkbox*> checkboxes_; |
2522 | + EditorPlaceBobTool& pit_; |
2523 | + bool click_recursion_protect_; |
2524 | }; |
2525 | |
2526 | #endif // end of include guard: WL_EDITOR_UI_MENUS_EDITOR_TOOL_PLACE_BOB_OPTIONS_MENU_H |
2527 | |
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 | : |
2533 | UI::UniqueWindow |
2534 | (&parent, "toolsize_menu", ®istry, 250, 50, _("Tool Size")), |
2535 | - m_textarea(this, 5, 10, 240, 10, std::string(), UI::Align::kBottomCenter), |
2536 | - m_increase |
2537 | + textarea_(this, 5, 10, 240, 10, std::string(), UI::Align::kBottomCenter), |
2538 | + increase_ |
2539 | (this, "incr", |
2540 | get_inner_w() / 2 - 10, 25, 20, 20, |
2541 | g_gr->images().get("images/ui_basic/but0.png"), |
2542 | g_gr->images().get("images/ui_basic/scrollbar_up.png"), |
2543 | std::string(), |
2544 | parent.get_sel_radius() < MAX_TOOL_AREA), |
2545 | - m_decrease |
2546 | + decrease_ |
2547 | (this, "decr", |
2548 | get_inner_w() / 2 + 10, 25, 20, 20, |
2549 | g_gr->images().get("images/ui_basic/but0.png"), |
2550 | @@ -58,11 +58,11 @@ |
2551 | 0 < parent.get_sel_radius()), |
2552 | value_(0) |
2553 | { |
2554 | - m_increase.sigclicked.connect(boost::bind(&EditorToolsizeMenu::increase_radius, boost::ref(*this))); |
2555 | - m_decrease.sigclicked.connect(boost::bind(&EditorToolsizeMenu::decrease_radius, boost::ref(*this))); |
2556 | + increase_.sigclicked.connect(boost::bind(&EditorToolsizeMenu::increase_radius, boost::ref(*this))); |
2557 | + decrease_.sigclicked.connect(boost::bind(&EditorToolsizeMenu::decrease_radius, boost::ref(*this))); |
2558 | |
2559 | - m_increase.set_repeating(true); |
2560 | - m_decrease.set_repeating(true); |
2561 | + increase_.set_repeating(true); |
2562 | + decrease_.set_repeating(true); |
2563 | update(parent.get_sel_radius()); |
2564 | |
2565 | if (eia().tools()->current().has_size_one()) { |
2566 | @@ -78,12 +78,12 @@ |
2567 | value_ = val; |
2568 | eia().set_sel_radius(val); |
2569 | set_buttons_enabled(true); |
2570 | - m_textarea.set_text((boost::format(_("Current Size: %u")) % (val + 1)).str()); |
2571 | + textarea_.set_text((boost::format(_("Current Size: %u")) % (val + 1)).str()); |
2572 | } |
2573 | |
2574 | void EditorToolsizeMenu::set_buttons_enabled(bool enable) { |
2575 | - m_decrease.set_enabled(enable && 0 < value_); |
2576 | - m_increase.set_enabled(enable && value_ < MAX_TOOL_AREA); |
2577 | + decrease_.set_enabled(enable && 0 < value_); |
2578 | + increase_.set_enabled(enable && value_ < MAX_TOOL_AREA); |
2579 | } |
2580 | |
2581 | |
2582 | |
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 | void decrease_radius(); |
2588 | void increase_radius(); |
2589 | |
2590 | - UI::Textarea m_textarea; |
2591 | - UI::Button m_increase, m_decrease; |
2592 | + UI::Textarea textarea_; |
2593 | + UI::Button increase_, decrease_; |
2594 | uint32_t value_; |
2595 | }; |
2596 |
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