widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #06783
[Merge] lp:~widelands-dev/widelands/bug-1395278-editor into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1395278-editor into lp:widelands.
Commit message:
Refactored member variable names in src/editor.
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
Bug #1395278 in widelands: "Consolidate naming of member variables"
https://bugs.launchpad.net/widelands/+bug/1395278
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1395278-editor/+merge/289494
Almost there...
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1395278-editor into lp:widelands.
=== modified file 'src/editor/tools/editor_action_args.h'
--- src/editor/tools/editor_action_args.h 2016-03-16 21:37:47 +0000
+++ src/editor/tools/editor_action_args.h 2016-03-18 12:52:47 +0000
@@ -48,9 +48,9 @@
uint32_t sel_radius;
- int32_t change_by; // resources, hight change tools
- std::list<Widelands::Field::Height> origHights; // change hight tool
- uint8_t cur_res, set_to; // resources change tools
+ int32_t change_by; // resources, change height tools
+ std::list<Widelands::Field::Height> original_heights; // change height tool
+ uint8_t current_resource, set_to; // resources change tools
struct ResourceState {
Widelands::FCoords location;
@@ -58,14 +58,14 @@
uint8_t amount;
};
- std::list<ResourceState> orgRes; // resources set tool
- std::list<const Widelands::BobDescr *> obob_type, nbob_type; // bob change tools
- std::list<std::string> oimmov_types; // immovable change tools
- std::list<int32_t> nimmov_types; // immovable change tools
- Widelands::HeightInterval m_interval; // noise hight tool
- std::list<Widelands::DescriptionIndex> terrainType, origTerrainType; // set terrain tool
+ std::list<ResourceState> original_resource; // resources set tool
+ std::list<const Widelands::BobDescr *> old_bob_type, new_bob_type; // bob change tools
+ std::list<std::string> old_immovable_types; // immovable change tools
+ std::list<int32_t> new_immovable_types; // immovable change tools
+ Widelands::HeightInterval interval; // noise height tool
+ std::list<Widelands::DescriptionIndex> terrain_type, original_terrain_type; // set terrain tool
- std::list<EditorToolAction *> draw_actions; // draw tool
+ std::list<EditorToolAction *> draw_actions; // draw tool
uint32_t refcount;
};
=== modified file 'src/editor/tools/editor_decrease_height_tool.cc'
--- src/editor/tools/editor_decrease_height_tool.cc 2016-01-04 20:50:19 +0000
+++ src/editor/tools/editor_decrease_height_tool.cc 2016-03-18 12:52:47 +0000
@@ -32,12 +32,12 @@
EditorInteractive& /* parent */,
EditorActionArgs* args,
Widelands::Map* map) {
- if (args->origHights.empty()) {
+ if (args->original_heights.empty()) {
Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr
(*map,
Widelands::Area<Widelands::FCoords>
(map->get_fcoords(center.node), args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1));
- do args->origHights.push_back(mr.location().field->get_height());
+ do args->original_heights.push_back(mr.location().field->get_height());
while (mr.advance(*map));
}
@@ -58,7 +58,7 @@
(*map,
Widelands::Area<Widelands::FCoords>
(map->get_fcoords(center.node), args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1));
- std::list<Widelands::Field::Height>::iterator i = args->origHights.begin();
+ std::list<Widelands::Field::Height>::iterator i = args->original_heights.begin();
do {
mr.location().field->set_height(*i); ++i;
@@ -75,6 +75,6 @@
EditorActionArgs EditorDecreaseHeightTool::format_args_impl(EditorInteractive & parent)
{
EditorActionArgs a(parent);
- a.change_by = m_change_by;
+ a.change_by = change_by_;
return a;
}
=== modified file 'src/editor/tools/editor_decrease_height_tool.h'
--- src/editor/tools/editor_decrease_height_tool.h 2016-01-28 05:24:34 +0000
+++ src/editor/tools/editor_decrease_height_tool.h 2016-03-18 12:52:47 +0000
@@ -24,7 +24,7 @@
/// Decreases the height of a node by a value.
struct EditorDecreaseHeightTool : public EditorTool {
- EditorDecreaseHeightTool() : EditorTool(*this, *this), m_change_by(1) {}
+ EditorDecreaseHeightTool() : EditorTool(*this, *this), change_by_(1) {}
int32_t handle_click_impl
(const Widelands::World& world,
@@ -46,11 +46,11 @@
return "images/wui/editor//fsel_editor_decrease_height.png";
}
- int32_t get_change_by() const {return m_change_by;}
- void set_change_by(const int32_t n) {m_change_by = n;}
+ int32_t get_change_by() const {return change_by_;}
+ void set_change_by(const int32_t n) {change_by_ = n;}
private:
- int32_t m_change_by;
+ int32_t change_by_;
};
#endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_DECREASE_HEIGHT_TOOL_H
=== modified file 'src/editor/tools/editor_decrease_resources_tool.cc'
--- src/editor/tools/editor_decrease_resources_tool.cc 2016-03-17 12:14:57 +0000
+++ src/editor/tools/editor_decrease_resources_tool.cc 2016-03-18 12:52:47 +0000
@@ -50,17 +50,17 @@
if (amount < 0)
amount = 0;
- if (mr.location().field->get_resources() == args->cur_res &&
- map->is_resource_valid(world, mr.location(), args->cur_res) &&
+ if (mr.location().field->get_resources() == args->current_resource &&
+ map->is_resource_valid(world, mr.location(), args->current_resource) &&
mr.location().field->get_resources_amount() != 0) {
- args->orgRes.push_back(EditorActionArgs::ResourceState{
+ args->original_resource.push_back(EditorActionArgs::ResourceState{
mr.location(),
mr.location().field->get_resources(),
mr.location().field->get_resources_amount()
});
- map->initialize_resources(mr.location(), args->cur_res, amount);
+ map->initialize_resources(mr.location(), args->current_resource, amount);
}
} while (mr.advance(*map));
@@ -78,7 +78,7 @@
EditorActionArgs EditorDecreaseResourcesTool::format_args_impl(EditorInteractive & parent)
{
EditorActionArgs a(parent);
- a.change_by = m_change_by;
- a.cur_res = m_cur_res;
+ a.change_by = change_by_;
+ a.current_resource = cur_res_;
return a;
}
=== modified file 'src/editor/tools/editor_decrease_resources_tool.h'
--- src/editor/tools/editor_decrease_resources_tool.h 2016-01-28 05:24:34 +0000
+++ src/editor/tools/editor_decrease_resources_tool.h 2016-03-18 12:52:47 +0000
@@ -25,7 +25,7 @@
/// Decreases the resources of a node by a value.
struct EditorDecreaseResourcesTool : public EditorTool {
EditorDecreaseResourcesTool()
- : EditorTool(*this, *this), m_cur_res(0), m_change_by(1)
+ : EditorTool(*this, *this), cur_res_(0), change_by_(1)
{}
int32_t handle_click_impl(const Widelands::World& world,
@@ -46,16 +46,16 @@
return "images/wui/editor/fsel_editor_decrease_resources.png";
}
- int32_t get_change_by() const {return m_change_by;}
- void set_change_by(const int32_t n) {m_change_by = n;}
- Widelands::DescriptionIndex get_cur_res() const {return m_cur_res;}
+ int32_t get_change_by() const {return change_by_;}
+ void set_change_by(const int32_t n) {change_by_ = n;}
+ Widelands::DescriptionIndex get_cur_res() const {return cur_res_;}
void set_cur_res(Widelands::DescriptionIndex const res) {
- m_cur_res = res;
+ cur_res_ = res;
}
private:
- Widelands::DescriptionIndex m_cur_res;
- int32_t m_change_by;
+ Widelands::DescriptionIndex cur_res_;
+ int32_t change_by_;
};
#endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_DECREASE_RESOURCES_TOOL_H
=== modified file 'src/editor/tools/editor_delete_bob_tool.cc'
--- src/editor/tools/editor_delete_bob_tool.cc 2016-01-16 12:55:14 +0000
+++ src/editor/tools/editor_delete_bob_tool.cc 2016-03-18 12:52:47 +0000
@@ -41,10 +41,10 @@
(map->get_fcoords(center.node), radius));
do if (Widelands::Bob * const bob = mr.location().field->get_first_bob()) {
- args->obob_type.push_back(&bob->descr());
+ args->old_bob_type.push_back(&bob->descr());
bob->remove(egbase);
} else {
- args->obob_type.push_back(nullptr);
+ args->old_bob_type.push_back(nullptr);
}
while (mr.advance(*map));
return radius + 2;
@@ -58,7 +58,7 @@
Widelands::Map* map) {
uint32_t ret = parent.tools()->place_bob.handle_undo_impl(world, center, parent, args, map);
- args->obob_type.clear();
+ args->old_bob_type.clear();
return ret;
}
=== modified file 'src/editor/tools/editor_delete_immovable_tool.cc'
--- src/editor/tools/editor_delete_immovable_tool.cc 2016-01-16 12:55:14 +0000
+++ src/editor/tools/editor_delete_immovable_tool.cc 2016-03-18 12:52:47 +0000
@@ -44,10 +44,10 @@
immovable,
mr.location().field->get_immovable()))
{
- args->oimmov_types.push_back(immovable->descr().name());
+ args->old_immovable_types.push_back(immovable->descr().name());
immovable->remove(egbase); // Delete no buildings or stuff.
} else {
- args->oimmov_types.push_back("");
+ args->old_immovable_types.push_back("");
}
while (mr.advance(*map));
return mr.radius() + 2;
=== modified file 'src/editor/tools/editor_history.cc'
--- src/editor/tools/editor_history.cc 2016-03-16 21:37:47 +0000
+++ src/editor/tools/editor_history.cc 2016-03-18 12:52:47 +0000
@@ -30,9 +30,9 @@
EditorActionArgs::EditorActionArgs(EditorInteractive & base):
sel_radius(base.get_sel_radius()),
change_by(0),
- cur_res(0),
+ current_resource(0),
set_to(0),
- m_interval(0, 0),
+ interval(0, 0),
refcount(0)
{}
@@ -42,28 +42,28 @@
delete draw_actions.back();
draw_actions.pop_back();
}
- nbob_type.clear();
- obob_type.clear();
- nimmov_types.clear();
- oimmov_types.clear();
- orgRes.clear();
- origHights.clear();
- origTerrainType.clear();
- terrainType.clear();
+ new_bob_type.clear();
+ old_bob_type.clear();
+ new_immovable_types.clear();
+ old_immovable_types.clear();
+ original_resource.clear();
+ original_heights.clear();
+ original_terrain_type.clear();
+ terrain_type.clear();
}
// === EditorHistory === //
uint32_t EditorHistory::undo_action(const Widelands::World& world) {
- if (undo_stack.empty())
+ if (undo_stack_.empty())
return 0;
- EditorToolAction uac = undo_stack.front();
- undo_stack.pop_front();
- redo_stack.push_front(uac);
+ EditorToolAction uac = undo_stack_.front();
+ undo_stack_.pop_front();
+ redo_stack_.push_front(uac);
- m_undo_button.set_enabled(!undo_stack.empty());
- m_redo_button.set_enabled(true);
+ undo_button_.set_enabled(!undo_stack_.empty());
+ redo_button_.set_enabled(true);
return uac.tool.handle_undo(static_cast<EditorTool::ToolIndex>(uac.i),
world,
@@ -74,15 +74,15 @@
}
uint32_t EditorHistory::redo_action(const Widelands::World& world) {
- if (redo_stack.empty())
+ if (redo_stack_.empty())
return 0;
- EditorToolAction rac = redo_stack.front();
- redo_stack.pop_front();
- undo_stack.push_front(rac);
+ EditorToolAction rac = redo_stack_.front();
+ redo_stack_.pop_front();
+ undo_stack_.push_front(rac);
- m_undo_button.set_enabled(true);
- m_redo_button.set_enabled(!redo_stack.empty());
+ undo_button_.set_enabled(true);
+ redo_button_.set_enabled(!redo_stack_.empty());
return rac.tool.handle_click(static_cast<EditorTool::ToolIndex>(rac.i),
world,
@@ -102,33 +102,33 @@
EditorToolAction ac
(tool, static_cast<uint32_t>(ind),
map, center, parent, tool.format_args(ind, parent));
- if (draw && tool.is_unduable()) {
+ if (draw && tool.is_undoable()) {
if
- (undo_stack.empty() ||
- undo_stack.front().tool.get_sel_impl() != std::string(m_draw_tool.get_sel_impl()))
+ (undo_stack_.empty() ||
+ undo_stack_.front().tool.get_sel_impl() != std::string(draw_tool_.get_sel_impl()))
{
EditorToolAction da
- (m_draw_tool, EditorTool::First,
+ (draw_tool_, EditorTool::First,
map, center, parent,
- m_draw_tool.format_args(EditorTool::First, parent));
+ draw_tool_.format_args(EditorTool::First, parent));
- if (!undo_stack.empty()) {
- m_draw_tool.add_action(undo_stack.front(), *da.args);
- undo_stack.pop_front();
+ if (!undo_stack_.empty()) {
+ draw_tool_.add_action(undo_stack_.front(), *da.args);
+ undo_stack_.pop_front();
}
- redo_stack.clear();
- undo_stack.push_front(da);
- m_undo_button.set_enabled(true);
- m_redo_button.set_enabled(false);
+ redo_stack_.clear();
+ undo_stack_.push_front(da);
+ undo_button_.set_enabled(true);
+ redo_button_.set_enabled(false);
}
dynamic_cast<EditorDrawTool *>
- (&(undo_stack.front().tool))->add_action(ac, *undo_stack.front().args);
- } else if (tool.is_unduable()) {
- redo_stack.clear();
- undo_stack.push_front(ac);
- m_undo_button.set_enabled(true);
- m_redo_button.set_enabled(false);
+ (&(undo_stack_.front().tool))->add_action(ac, *undo_stack_.front().args);
+ } else if (tool.is_undoable()) {
+ redo_stack_.clear();
+ undo_stack_.push_front(ac);
+ undo_button_.set_enabled(true);
+ redo_button_.set_enabled(false);
}
return tool.handle_click(ind, world, center, parent, ac.args, &map);
}
=== modified file 'src/editor/tools/editor_history.h'
--- src/editor/tools/editor_history.h 2016-01-16 12:55:14 +0000
+++ src/editor/tools/editor_history.h 2016-03-18 12:52:47 +0000
@@ -35,7 +35,7 @@
*/
struct EditorHistory {
EditorHistory(UI::Button & undo, UI::Button & redo):
- m_undo_button(undo), m_redo_button(redo) {}
+ undo_button_(undo), redo_button_(redo) {}
uint32_t do_action(EditorTool& tool,
EditorTool::ToolIndex ind,
@@ -48,13 +48,13 @@
uint32_t redo_action(const Widelands::World& world);
private:
- UI::Button & m_undo_button;
- UI::Button & m_redo_button;
-
- EditorDrawTool m_draw_tool;
-
- std::deque<EditorToolAction> undo_stack;
- std::deque<EditorToolAction> redo_stack;
+ UI::Button & undo_button_;
+ UI::Button & redo_button_;
+
+ EditorDrawTool draw_tool_;
+
+ std::deque<EditorToolAction> undo_stack_;
+ std::deque<EditorToolAction> redo_stack_;
};
=== modified file 'src/editor/tools/editor_increase_height_tool.cc'
--- src/editor/tools/editor_increase_height_tool.cc 2016-01-04 20:50:19 +0000
+++ src/editor/tools/editor_increase_height_tool.cc 2016-03-18 12:52:47 +0000
@@ -30,14 +30,14 @@
EditorInteractive& /* parent */,
EditorActionArgs* args,
Widelands::Map* map) {
- if (args->origHights.empty()) {
+ if (args->original_heights.empty()) {
Widelands::MapRegion<Widelands::Area<Widelands::FCoords>> mr(
*map,
Widelands::Area<Widelands::FCoords>(
map->get_fcoords(center.node),
args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1));
do {
- args->origHights.push_back(mr.location().field->get_height());
+ args->original_heights.push_back(mr.location().field->get_height());
} while (mr.advance(*map));
}
@@ -52,12 +52,12 @@
EditorInteractive& parent,
EditorActionArgs* args,
Widelands::Map* map) {
- return m_decrease_tool.handle_undo_impl(world, center, parent, args, map);
+ return decrease_tool_.handle_undo_impl(world, center, parent, args, map);
}
EditorActionArgs EditorIncreaseHeightTool::format_args_impl(EditorInteractive & parent)
{
EditorActionArgs a(parent);
- a.change_by = m_change_by;
+ a.change_by = change_by_;
return a;
}
=== modified file 'src/editor/tools/editor_increase_height_tool.h'
--- src/editor/tools/editor_increase_height_tool.h 2016-01-28 05:24:34 +0000
+++ src/editor/tools/editor_increase_height_tool.h 2016-03-18 12:52:47 +0000
@@ -30,8 +30,8 @@
EditorSetHeightTool & the_set_tool)
:
EditorTool(the_decrease_tool, the_set_tool),
- m_decrease_tool(the_decrease_tool), m_set_tool(the_set_tool),
- m_change_by(1)
+ decrease_tool_(the_decrease_tool), set_tool_(the_set_tool),
+ change_by_(1)
{}
int32_t handle_click_impl(const Widelands::World& world,
@@ -52,18 +52,18 @@
return "images/wui/editor/fsel_editor_increase_height.png";
}
- int32_t get_change_by() const {return m_change_by;}
- void set_change_by(const int32_t n) {m_change_by = n;}
+ int32_t get_change_by() const {return change_by_;}
+ void set_change_by(const int32_t n) {change_by_ = n;}
EditorDecreaseHeightTool & decrease_tool() const {
- return m_decrease_tool;
+ return decrease_tool_;
}
- EditorSetHeightTool & set_tool() const {return m_set_tool;}
+ EditorSetHeightTool & set_tool() const {return set_tool_;}
private:
- EditorDecreaseHeightTool & m_decrease_tool;
- EditorSetHeightTool & m_set_tool;
- int32_t m_change_by;
+ EditorDecreaseHeightTool& decrease_tool_;
+ EditorSetHeightTool& set_tool_;
+ int32_t change_by_;
};
#endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_INCREASE_HEIGHT_TOOL_H
=== modified file 'src/editor/tools/editor_increase_resources_tool.cc'
--- src/editor/tools/editor_increase_resources_tool.cc 2016-03-17 12:14:57 +0000
+++ src/editor/tools/editor_increase_resources_tool.cc 2016-03-18 12:52:47 +0000
@@ -40,25 +40,25 @@
(map->get_fcoords(center.node), args->sel_radius));
do {
int32_t amount = mr.location().field->get_resources_amount();
- int32_t max_amount = args->cur_res != Widelands::kNoResource ?
- world.get_resource(args->cur_res)->max_amount() : 0;
+ int32_t max_amount = args->current_resource != Widelands::kNoResource ?
+ world.get_resource(args->current_resource)->max_amount() : 0;
amount += args->change_by;
if (amount > max_amount)
amount = max_amount;
- if ((mr.location().field->get_resources() == args->cur_res ||
+ if ((mr.location().field->get_resources() == args->current_resource ||
!mr.location().field->get_resources_amount()) &&
- map->is_resource_valid(world, mr.location(), args->cur_res) &&
+ map->is_resource_valid(world, mr.location(), args->current_resource) &&
mr.location().field->get_resources_amount() != max_amount) {
- args->orgRes.push_back(EditorActionArgs::ResourceState{
+ args->original_resource.push_back(EditorActionArgs::ResourceState{
mr.location(),
mr.location().field->get_resources(),
mr.location().field->get_resources_amount()
});
- map->initialize_resources(mr.location(), args->cur_res, amount);
+ map->initialize_resources(mr.location(), args->current_resource, amount);
}
} while (mr.advance(*map));
return mr.radius();
@@ -69,13 +69,13 @@
EditorInteractive& parent,
EditorActionArgs* args,
Widelands::Map* map) {
- return m_set_tool.handle_undo_impl(world, center, parent, args, map);
+ return set_tool_.handle_undo_impl(world, center, parent, args, map);
}
EditorActionArgs EditorIncreaseResourcesTool::format_args_impl(EditorInteractive & parent)
{
EditorActionArgs a(parent);
- a.change_by = m_change_by;
- a.cur_res = m_cur_res;
+ a.change_by = change_by_;
+ a.current_resource = cur_res_;
return a;
}
=== modified file 'src/editor/tools/editor_increase_resources_tool.h'
--- src/editor/tools/editor_increase_resources_tool.h 2016-01-28 05:24:34 +0000
+++ src/editor/tools/editor_increase_resources_tool.h 2016-03-18 12:52:47 +0000
@@ -29,10 +29,10 @@
EditorIncreaseResourcesTool(EditorDecreaseResourcesTool& the_decrease_tool,
EditorSetResourcesTool& the_set_to_tool)
: EditorTool(the_decrease_tool, the_set_to_tool),
- m_decrease_tool(the_decrease_tool),
- m_set_tool(the_set_to_tool),
- m_change_by(1),
- m_cur_res(0) {
+ decrease_tool_(the_decrease_tool),
+ set_tool_(the_set_to_tool),
+ change_by_(1),
+ cur_res_(0) {
}
/***
@@ -57,23 +57,23 @@
return "images/wui/editor/fsel_editor_increase_resources.png";
}
- int32_t get_change_by() const {return m_change_by;}
- void set_change_by(const int32_t n) {m_change_by = n;}
- Widelands::DescriptionIndex get_cur_res() const {return m_cur_res;}
+ int32_t get_change_by() const {return change_by_;}
+ void set_change_by(const int32_t n) {change_by_ = n;}
+ Widelands::DescriptionIndex get_cur_res() const {return cur_res_;}
void set_cur_res(Widelands::DescriptionIndex const res) {
- m_cur_res = res;
+ cur_res_ = res;
}
EditorDecreaseResourcesTool & decrease_tool() const {
- return m_decrease_tool;
+ return decrease_tool_;
}
- EditorSetResourcesTool & set_tool() const {return m_set_tool;}
+ EditorSetResourcesTool & set_tool() const {return set_tool_;}
private:
- EditorDecreaseResourcesTool & m_decrease_tool;
- EditorSetResourcesTool& m_set_tool;
- int32_t m_change_by;
- Widelands::DescriptionIndex m_cur_res;
+ EditorDecreaseResourcesTool& decrease_tool_;
+ EditorSetResourcesTool& set_tool_;
+ int32_t change_by_;
+ Widelands::DescriptionIndex cur_res_;
};
=== modified file 'src/editor/tools/editor_make_infrastructure_tool.cc'
--- src/editor/tools/editor_make_infrastructure_tool.cc 2016-01-04 20:50:19 +0000
+++ src/editor/tools/editor_make_infrastructure_tool.cc 2016-03-18 12:52:47 +0000
@@ -52,7 +52,7 @@
EditorActionArgs* /* args */,
Widelands::Map*) {
show_field_action
- (&parent, parent.egbase().get_player(m_player), &m_registry);
+ (&parent, parent.egbase().get_player(player_), ®istry_);
// Not really needed, since Player Immovables are taken care of while
// placing on map.
=== modified file 'src/editor/tools/editor_make_infrastructure_tool.h'
--- src/editor/tools/editor_make_infrastructure_tool.h 2016-01-28 05:24:34 +0000
+++ src/editor/tools/editor_make_infrastructure_tool.h 2016-03-18 12:52:47 +0000
@@ -32,12 +32,12 @@
*/
// TODO(unknown): Implement undo for this tool
struct EditorMakeInfrastructureTool : public EditorTool {
- EditorMakeInfrastructureTool() : EditorTool(*this, *this, false), m_player(0) {}
+ EditorMakeInfrastructureTool() : EditorTool(*this, *this, false), player_(0) {}
void set_player(Widelands::PlayerNumber const n)
- {m_player = n;}
+ {player_ = n;}
Widelands::PlayerNumber get_player() const
- {return m_player;}
+ {return player_;}
int32_t handle_click_impl(const Widelands::World& world,
Widelands::NodeAndTriangle<> center,
@@ -49,8 +49,8 @@
{return "images/ui_basic/fsel.png";} // Standard sel icon, most complex tool of all
private:
- Widelands::PlayerNumber m_player;
- UI::UniqueWindow::Registry m_registry;
+ Widelands::PlayerNumber player_;
+ UI::UniqueWindow::Registry registry_;
};
int32_t editor_make_infrastructure_tool_callback
=== modified file 'src/editor/tools/editor_noise_height_tool.cc'
--- src/editor/tools/editor_noise_height_tool.cc 2016-01-04 20:50:19 +0000
+++ src/editor/tools/editor_noise_height_tool.cc 2016-03-18 12:52:47 +0000
@@ -32,13 +32,13 @@
EditorInteractive& /* parent */,
EditorActionArgs* args,
Widelands::Map* map) {
- if (args->origHights.empty()) {
+ if (args->original_heights.empty()) {
Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr
(*map,
Widelands::Area<Widelands::FCoords>
(map->get_fcoords(center.node),
args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1));
- do args->origHights.push_back(mr.location().field->get_height());
+ do args->original_heights.push_back(mr.location().field->get_height());
while (mr.advance(*map));
}
@@ -53,9 +53,9 @@
max,
map->set_height(world,
mr.location(),
- args->m_interval.min +
+ args->interval.min +
static_cast<int32_t>(
- static_cast<double>(args->m_interval.max - args->m_interval.min + 1) *
+ static_cast<double>(args->interval.max - args->interval.min + 1) *
rand() / (RAND_MAX + 1.0))));
} while (mr.advance(*map));
return mr.radius() + max;
@@ -67,12 +67,12 @@
EditorInteractive& parent,
EditorActionArgs* args,
Widelands::Map* map) {
- return m_set_tool.handle_undo_impl(world, center, parent, args, map);
+ return set_tool_.handle_undo_impl(world, center, parent, args, map);
}
EditorActionArgs EditorNoiseHeightTool::format_args_impl(EditorInteractive & parent)
{
EditorActionArgs a(parent);
- a.m_interval = m_interval;
+ a.interval = interval_;
return a;
}
=== modified file 'src/editor/tools/editor_noise_height_tool.h'
--- src/editor/tools/editor_noise_height_tool.h 2016-01-28 05:24:34 +0000
+++ src/editor/tools/editor_noise_height_tool.h 2016-03-18 12:52:47 +0000
@@ -30,8 +30,8 @@
Widelands::HeightInterval(10, 14))
:
EditorTool(the_set_tool, the_set_tool),
- m_set_tool(the_set_tool),
- m_interval(the_interval)
+ set_tool_(the_set_tool),
+ interval_(the_interval)
{}
int32_t handle_click_impl(const Widelands::World& world,
@@ -53,17 +53,17 @@
}
Widelands::HeightInterval get_interval() const {
- return m_interval;
+ return interval_;
}
void set_interval(Widelands::HeightInterval const i) {
- m_interval = i;
+ interval_ = i;
}
- EditorSetHeightTool & set_tool() const {return m_set_tool;}
+ EditorSetHeightTool & set_tool() const {return set_tool_;}
private:
- EditorSetHeightTool & m_set_tool;
- Widelands::HeightInterval m_interval;
+ EditorSetHeightTool & set_tool_;
+ Widelands::HeightInterval interval_;
};
#endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_NOISE_HEIGHT_TOOL_H
=== modified file 'src/editor/tools/editor_place_bob_tool.cc'
--- src/editor/tools/editor_place_bob_tool.cc 2016-01-06 19:11:20 +0000
+++ src/editor/tools/editor_place_bob_tool.cc 2016-03-18 12:52:47 +0000
@@ -36,25 +36,25 @@
EditorActionArgs* args,
Widelands::Map* map) {
- if (get_nr_enabled() && args->obob_type.empty()) {
+ if (get_nr_enabled() && args->old_bob_type.empty()) {
Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr
(*map,
Widelands::Area<Widelands::FCoords>
(map->get_fcoords(center.node), args->sel_radius));
do {
Widelands::Bob * const mbob = mr.location().field->get_first_bob();
- args->obob_type.push_back((mbob ? &mbob->descr() : nullptr));
- args->nbob_type.push_back(world.get_bob_descr(get_random_enabled()));
+ args->old_bob_type.push_back((mbob ? &mbob->descr() : nullptr));
+ args->new_bob_type.push_back(world.get_bob_descr(get_random_enabled()));
} while (mr.advance(*map));
}
- if (!args->nbob_type.empty()) {
+ if (!args->new_bob_type.empty()) {
Widelands::EditorGameBase & egbase = parent.egbase();
Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr
(*map,
Widelands::Area<Widelands::FCoords>
(map->get_fcoords(center.node), args->sel_radius));
- std::list< const Widelands::BobDescr * >::iterator i = args->nbob_type.begin();
+ std::list< const Widelands::BobDescr * >::iterator i = args->new_bob_type.begin();
do {
const Widelands::BobDescr & descr = *(*i);
if (mr.location().field->nodecaps() & descr.movecaps()) {
@@ -75,13 +75,13 @@
EditorInteractive& parent,
EditorActionArgs* args,
Widelands::Map* map) {
- if (!args->nbob_type.empty()) {
+ if (!args->new_bob_type.empty()) {
Widelands::EditorGameBase & egbase = parent.egbase();
Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr
(*map,
Widelands::Area<Widelands::FCoords>
(map->get_fcoords(center.node), args->sel_radius));
- std::list<const Widelands::BobDescr *>::iterator i = args->obob_type.begin();
+ std::list<const Widelands::BobDescr *>::iterator i = args->old_bob_type.begin();
do {
if (*i) {
const Widelands::BobDescr & descr = *(*i);
=== modified file 'src/editor/tools/editor_place_immovable_tool.cc'
--- src/editor/tools/editor_place_immovable_tool.cc 2016-01-06 19:11:20 +0000
+++ src/editor/tools/editor_place_immovable_tool.cc 2016-03-18 12:52:47 +0000
@@ -41,7 +41,7 @@
if (!get_nr_enabled())
return radius;
Widelands::EditorGameBase & egbase = parent.egbase();
- if (args->oimmov_types.empty())
+ if (args->old_immovable_types.empty())
{
Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr
(*map,
@@ -49,18 +49,18 @@
(map->get_fcoords(center.node), radius));
do {
const Widelands::BaseImmovable * im = mr.location().field->get_immovable();
- args->oimmov_types.push_back((im ? im->descr().name() : ""));
- args->nimmov_types.push_back(get_random_enabled());
+ args->old_immovable_types.push_back((im ? im->descr().name() : ""));
+ args->new_immovable_types.push_back(get_random_enabled());
} while (mr.advance(*map));
}
- if (!args->nimmov_types.empty())
+ if (!args->new_immovable_types.empty())
{
Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr
(*map,
Widelands::Area<Widelands::FCoords>
(map->get_fcoords(center.node), radius));
- std::list<int32_t>::iterator i = args->nimmov_types.begin();
+ std::list<int32_t>::iterator i = args->new_immovable_types.begin();
do {
if
(!mr.location().field->get_immovable()
@@ -79,7 +79,7 @@
EditorActionArgs* args,
Widelands::Map* map) {
const int32_t radius = args->sel_radius;
- if (args->oimmov_types.empty())
+ if (args->old_immovable_types.empty())
return radius;
Widelands::EditorGameBase & egbase = parent.egbase();
@@ -87,7 +87,7 @@
(*map,
Widelands::Area<Widelands::FCoords>
(map->get_fcoords(center.node), radius));
- std::list<std::string>::iterator i = args->oimmov_types.begin();
+ std::list<std::string>::iterator i = args->old_immovable_types.begin();
do {
if
(upcast(Widelands::Immovable, immovable,
=== modified file 'src/editor/tools/editor_set_height_tool.cc'
--- src/editor/tools/editor_set_height_tool.cc 2016-01-04 20:50:19 +0000
+++ src/editor/tools/editor_set_height_tool.cc 2016-03-18 12:52:47 +0000
@@ -31,19 +31,19 @@
EditorInteractive& /* parent */,
EditorActionArgs* args,
Widelands::Map* map) {
- if (args->origHights.empty())
+ if (args->original_heights.empty())
{
Widelands::MapRegion<Widelands::Area<Widelands::FCoords> > mr
(*map,
Widelands::Area<Widelands::FCoords>
(map->get_fcoords(center.node), args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1));
- do args->origHights.push_back(mr.location().field->get_height());
+ do args->original_heights.push_back(mr.location().field->get_height());
while (mr.advance(*map));
}
return map->set_height(
world,
Widelands::Area<Widelands::FCoords>(map->get_fcoords(center.node), args->sel_radius),
- args->m_interval);
+ args->interval);
}
int32_t
@@ -58,7 +58,7 @@
(map->get_fcoords(center.node),
args->sel_radius + MAX_FIELD_HEIGHT / MAX_FIELD_HEIGHT_DIFF + 1));
- std::list<Widelands::Field::Height>::iterator i = args->origHights.begin();
+ std::list<Widelands::Field::Height>::iterator i = args->original_heights.begin();
do {
mr.location().field->set_height(*i); ++i;
@@ -75,6 +75,6 @@
EditorActionArgs EditorSetHeightTool::format_args_impl(EditorInteractive & parent)
{
EditorActionArgs a(parent);
- a.m_interval = m_interval;
+ a.interval = interval_;
return a;
}
=== modified file 'src/editor/tools/editor_set_height_tool.h'
--- src/editor/tools/editor_set_height_tool.h 2016-01-28 05:24:34 +0000
+++ src/editor/tools/editor_set_height_tool.h 2016-03-18 12:52:47 +0000
@@ -27,7 +27,7 @@
/// Ensures that the height of a node is within an interval.
struct EditorSetHeightTool : public EditorTool {
EditorSetHeightTool()
- : EditorTool(*this, *this), m_interval(10, 10)
+ : EditorTool(*this, *this), interval_(10, 10)
{}
int32_t handle_click_impl(const Widelands::World& world,
@@ -49,14 +49,14 @@
}
Widelands::HeightInterval get_interval() const {
- return m_interval;
+ return interval_;
}
void set_interval(Widelands::HeightInterval const i) {
- m_interval = i;
+ interval_ = i;
}
private:
- Widelands::HeightInterval m_interval;
+ Widelands::HeightInterval interval_;
};
#endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_SET_HEIGHT_TOOL_H
=== modified file 'src/editor/tools/editor_set_resources_tool.cc'
--- src/editor/tools/editor_set_resources_tool.cc 2016-03-17 12:14:57 +0000
+++ src/editor/tools/editor_set_resources_tool.cc 2016-03-18 12:52:47 +0000
@@ -39,23 +39,23 @@
(map->get_fcoords(center.node), args->sel_radius));
do {
int32_t amount = args->set_to;
- int32_t max_amount = args->cur_res != Widelands::kNoResource ?
- world.get_resource(args->cur_res)->max_amount() : 0;
+ int32_t max_amount = args->current_resource != Widelands::kNoResource ?
+ world.get_resource(args->current_resource)->max_amount() : 0;
if (amount < 0)
amount = 0;
else if (amount > max_amount)
amount = max_amount;
- if (map->is_resource_valid(world, mr.location(), args->cur_res) &&
+ if (map->is_resource_valid(world, mr.location(), args->current_resource) &&
mr.location().field->get_resources_amount() != amount) {
- args->orgRes.push_back(EditorActionArgs::ResourceState{
+ args->original_resource.push_back(EditorActionArgs::ResourceState{
mr.location(),
mr.location().field->get_resources(),
mr.location().field->get_resources_amount()
});
- map->initialize_resources(mr.location(), args->cur_res, amount);
+ map->initialize_resources(mr.location(), args->current_resource, amount);
}
} while (mr.advance(*map));
return mr.radius();
@@ -67,9 +67,9 @@
EditorInteractive& /* parent */,
EditorActionArgs* args,
Widelands::Map* map) {
- for (const auto & res : args->orgRes) {
+ for (const auto & res : args->original_resource) {
int32_t amount = res.amount;
- int32_t max_amount = world.get_resource(args->cur_res)->max_amount();
+ int32_t max_amount = world.get_resource(args->current_resource)->max_amount();
if (amount < 0)
amount = 0;
@@ -79,14 +79,14 @@
map->initialize_resources(res.location, res.idx, amount);
}
- args->orgRes.clear();
+ args->original_resource.clear();
return args->sel_radius;
}
EditorActionArgs EditorSetResourcesTool::format_args_impl(EditorInteractive & parent)
{
EditorActionArgs a(parent);
- a.cur_res = m_cur_res;
- a.set_to = m_set_to;
+ a.current_resource = cur_res_;
+ a.set_to = set_to_;
return a;
}
=== modified file 'src/editor/tools/editor_set_resources_tool.h'
--- src/editor/tools/editor_set_resources_tool.h 2016-01-28 05:24:34 +0000
+++ src/editor/tools/editor_set_resources_tool.h 2016-03-18 12:52:47 +0000
@@ -27,7 +27,7 @@
/// Decreases the resources of a node by a value.
struct EditorSetResourcesTool : public EditorTool {
EditorSetResourcesTool()
- : EditorTool(*this, *this), m_cur_res(0), m_set_to(0)
+ : EditorTool(*this, *this), cur_res_(0), set_to_(0)
{}
/**
@@ -51,15 +51,15 @@
return "images/wui/editor/fsel_editor_set_resources.png";
}
- uint8_t get_set_to() const {return m_set_to;}
- void set_set_to(uint8_t const n) {m_set_to = n;}
- Widelands::DescriptionIndex get_cur_res() const {return m_cur_res;}
+ uint8_t get_set_to() const {return set_to_;}
+ void set_set_to(uint8_t const n) {set_to_ = n;}
+ Widelands::DescriptionIndex get_cur_res() const {return cur_res_;}
void set_cur_res(Widelands::DescriptionIndex const res)
- {m_cur_res = res;}
+ {cur_res_ = res;}
private:
- Widelands::DescriptionIndex m_cur_res;
- uint8_t m_set_to;
+ Widelands::DescriptionIndex cur_res_;
+ uint8_t set_to_;
};
=== modified file 'src/editor/tools/editor_set_starting_pos_tool.cc'
--- src/editor/tools/editor_set_starting_pos_tool.cc 2016-01-28 05:24:34 +0000
+++ src/editor/tools/editor_set_starting_pos_tool.cc 2016-03-18 12:52:47 +0000
@@ -49,7 +49,7 @@
} // namespace
// global variable to pass data from callback to class
-static int32_t m_current_player;
+static int32_t current_player_;
/*
* static callback function for overlay calculation
@@ -59,7 +59,7 @@
{
// Area around already placed players
Widelands::PlayerNumber const nr_players = map.get_nrplayers();
- for (Widelands::PlayerNumber p = 1, last = m_current_player - 1;; ++p) {
+ for (Widelands::PlayerNumber p = 1, last = current_player_ - 1;; ++p) {
for (; p <= last; ++p)
if (Widelands::Coords const sp = map.get_starting_pos(p))
if (map.calc_distance(sp, c) < MIN_PLACE_AROUND_PLAYERS)
@@ -78,10 +78,10 @@
}
EditorSetStartingPosTool::EditorSetStartingPosTool()
- : EditorTool(*this, *this, false), m_current_sel_pic(nullptr)
+ : EditorTool(*this, *this, false), current_sel_pic_(nullptr)
{
- m_current_player = 0;
- fsel_picsname = "images/players/fsel_editor_set_player_01_pos.png";
+ current_player_ = 0;
+ fsel_picsname_ = "images/players/fsel_editor_set_player_01_pos.png";
}
int32_t EditorSetStartingPosTool::handle_click_impl(const Widelands::World&,
@@ -93,18 +93,18 @@
assert(center.node.x < map->get_width());
assert(0 <= center.node.y);
assert(center.node.y < map->get_height());
- if (m_current_player) {
- if (map->get_nrplayers() < m_current_player) {
+ if (current_player_) {
+ if (map->get_nrplayers() < current_player_) {
// Mmh, my current player is not valid. Maybe the user has loaded a
// new map while this tool was active. We set the new player to a
// valid one. The sel pointer is the only thing that stays wrong, but
// this is not important
- m_current_player = 1;
+ current_player_ = 1;
}
- Widelands::Coords const old_sp = map->get_starting_pos(m_current_player);
+ Widelands::Coords const old_sp = map->get_starting_pos(current_player_);
- const Image* player_image = g_gr->images().get(player_pictures[m_current_player - 1]);
+ const Image* player_image = g_gr->images().get(player_pictures[current_player_ - 1]);
assert(player_image);
// check if field is valid
@@ -118,7 +118,7 @@
center.node, player_image, 4, Point(player_image->width() / 2, STARTING_POS_HOTSPOT_Y));
// set new player pos
- map->set_starting_pos(m_current_player, center.node);
+ map->set_starting_pos(current_player_, center.node);
}
}
return 1;
@@ -127,12 +127,12 @@
Widelands::PlayerNumber EditorSetStartingPosTool::get_current_player
() const
{
- return m_current_player;
+ return current_player_;
}
void EditorSetStartingPosTool::set_current_player(int32_t const i) {
- m_current_player = i;
- fsel_picsname = player_pictures_small[m_current_player - 1];
- m_current_sel_pic = fsel_picsname;
+ current_player_ = i;
+ fsel_picsname_ = player_pictures_small[current_player_ - 1];
+ current_sel_pic_ = fsel_picsname_;
}
=== modified file 'src/editor/tools/editor_set_starting_pos_tool.h'
--- src/editor/tools/editor_set_starting_pos_tool.h 2016-01-28 05:24:34 +0000
+++ src/editor/tools/editor_set_starting_pos_tool.h 2016-03-18 12:52:47 +0000
@@ -38,15 +38,15 @@
EditorActionArgs*,
Widelands::Map*) override;
char const * get_sel_impl() const override
- {return m_current_sel_pic;}
+ {return current_sel_pic_;}
Widelands::PlayerNumber get_current_player() const;
void set_current_player(int32_t);
bool has_size_one() const override {return true;}
private:
- char const * fsel_picsname;
- char const * m_current_sel_pic;
+ char const * fsel_picsname_;
+ char const * current_sel_pic_;
};
int32_t editor_tool_set_starting_pos_callback
=== modified file 'src/editor/tools/editor_set_terrain_tool.cc'
--- src/editor/tools/editor_set_terrain_tool.cc 2016-01-04 20:50:19 +0000
+++ src/editor/tools/editor_set_terrain_tool.cc 2016-03-18 12:52:47 +0000
@@ -35,7 +35,7 @@
uint16_t const radius = args->sel_radius;
int32_t max = 0;
- if (get_nr_enabled() && args->terrainType.empty()) {
+ if (get_nr_enabled() && args->terrain_type.empty()) {
Widelands::MapTriangleRegion<TCoords<Widelands::FCoords> > mr
(*map, Widelands::Area<TCoords<Widelands::FCoords> >
(TCoords<Widelands::FCoords>
@@ -43,21 +43,21 @@
static_cast<TCoords<Widelands::FCoords>::TriangleIndex>(center.triangle.t)),
radius));
do {
- args->origTerrainType.push_back
+ args->original_terrain_type.push_back
((mr.location().t == TCoords<Widelands::FCoords>::D)
? mr.location().field->terrain_d() : mr.location().field->terrain_r());
- args->terrainType.push_back(get_random_enabled());
+ args->terrain_type.push_back(get_random_enabled());
} while (mr.advance(*map));
}
- if (!args->terrainType.empty()) {
+ if (!args->terrain_type.empty()) {
Widelands::MapTriangleRegion<TCoords<Widelands::FCoords> > mr
(*map, Widelands::Area<TCoords<Widelands::FCoords> >
(TCoords<Widelands::FCoords>
(Widelands::FCoords(map->get_fcoords(center.triangle)),
static_cast<TCoords<Widelands::FCoords>::TriangleIndex>(center.triangle.t)),
radius));
- std::list<Widelands::DescriptionIndex>::iterator i = args->terrainType.begin();
+ std::list<Widelands::DescriptionIndex>::iterator i = args->terrain_type.begin();
do {
max = std::max
(max, map->change_terrain(world, mr.location(), *i));
@@ -76,7 +76,7 @@
assert
(center.triangle.t == TCoords<>::D || center.triangle.t == TCoords<>::R);
uint16_t const radius = args->sel_radius;
- if (!args->terrainType.empty()) {
+ if (!args->terrain_type.empty()) {
int32_t max = 0;
Widelands::MapTriangleRegion<TCoords<Widelands::FCoords> > mr
(*map,
@@ -87,7 +87,7 @@
(center.triangle.t)),
radius));
- std::list<Widelands::DescriptionIndex>::iterator i = args->origTerrainType.begin();
+ std::list<Widelands::DescriptionIndex>::iterator i = args->original_terrain_type.begin();
do {
max = std::max
(max, map->change_terrain(world, mr.location(), *i));
=== modified file 'src/editor/tools/editor_tool.h'
--- src/editor/tools/editor_tool.h 2016-02-01 08:21:18 +0000
+++ src/editor/tools/editor_tool.h 2016-03-18 12:52:47 +0000
@@ -41,7 +41,7 @@
class EditorTool {
public:
EditorTool(EditorTool & second, EditorTool & third, bool uda = true) :
- m_second(second), m_third(third), undoable(uda)
+ second_(second), third_(third), undoable_(uda)
{}
virtual ~EditorTool() {}
@@ -52,7 +52,7 @@
EditorInteractive& parent, EditorActionArgs* args, Widelands::Map* map)
{
return
- (i == First ? *this : i == Second ? m_second : m_third)
+ (i == First ? *this : i == Second ? second_ : third_)
.handle_click_impl(world, center, parent, args, map);
}
@@ -62,23 +62,23 @@
EditorInteractive& parent, EditorActionArgs* args, Widelands::Map* map)
{
return
- (i == First ? *this : i == Second ? m_second : m_third)
+ (i == First ? *this : i == Second ? second_ : third_)
.handle_undo_impl(world, center, parent, args, map);
}
const char * get_sel(const ToolIndex i) {
return
- (i == First ? *this : i == Second ? m_second : m_third)
+ (i == First ? *this : i == Second ? second_ : third_)
.get_sel_impl();
}
EditorActionArgs format_args(const ToolIndex i, EditorInteractive & parent) {
return
- (i == First ? *this : i == Second ? m_second : m_third)
+ (i == First ? *this : i == Second ? second_ : third_)
.format_args_impl(parent);
}
- bool is_unduable() {return undoable;}
+ bool is_undoable() {return undoable_;}
virtual bool has_size_one() const {return false;}
virtual EditorActionArgs format_args_impl(EditorInteractive & parent) {
return EditorActionArgs(parent);
@@ -99,8 +99,8 @@
virtual bool operates_on_triangles() const {return false;}
protected:
- EditorTool & m_second, & m_third;
- bool undoable;
+ EditorTool & second_, & third_;
+ bool undoable_;
private:
DISALLOW_COPY_AND_ASSIGN(EditorTool);
=== modified file 'src/editor/tools/multi_select.h'
--- src/editor/tools/multi_select.h 2014-07-05 16:41:51 +0000
+++ src/editor/tools/multi_select.h 2016-03-18 12:52:47 +0000
@@ -34,28 +34,28 @@
* This is a helper class, no Editor Tool (might be usable in game too)
*/
struct MultiSelect {
- MultiSelect() : m_nr_enabled(0) {}
+ MultiSelect() : nr_enabled_(0) {}
~MultiSelect() {}
void enable(int32_t n, bool t) {
- if (static_cast<int32_t>(m_enabled.size()) < n + 1)
- m_enabled.resize(n + 1, false);
+ if (static_cast<int32_t>(enabled_.size()) < n + 1)
+ enabled_.resize(n + 1, false);
- if (m_enabled[n] == t)
+ if (enabled_[n] == t)
return;
- m_enabled[n] = t;
+ enabled_[n] = t;
if (t)
- ++m_nr_enabled;
+ ++nr_enabled_;
else
- --m_nr_enabled;
- assert(0 <= m_nr_enabled);
+ --nr_enabled_;
+ assert(0 <= nr_enabled_);
}
bool is_enabled(int32_t n) const {
- if (static_cast<int32_t>(m_enabled.size()) < n + 1)
+ if (static_cast<int32_t>(enabled_.size()) < n + 1)
return false;
- return m_enabled[n];
+ return enabled_[n];
}
- int32_t get_nr_enabled() const {return m_nr_enabled;}
+ int32_t get_nr_enabled() const {return nr_enabled_;}
int32_t get_random_enabled() const {
const int32_t rand_value =
static_cast<int32_t>
@@ -69,8 +69,8 @@
}
private:
- int32_t m_nr_enabled;
- std::vector<bool> m_enabled;
+ int32_t nr_enabled_;
+ std::vector<bool> enabled_;
};
#endif // end of include guard: WL_EDITOR_TOOLS_MULTI_SELECT_H
=== modified file 'src/editor/ui_menus/editor_player_menu.cc'
--- src/editor/ui_menus/editor_player_menu.cc 2016-01-31 10:57:58 +0000
+++ src/editor/ui_menus/editor_player_menu.cc 2016-03-18 12:52:47 +0000
@@ -70,24 +70,24 @@
:
UI::UniqueWindow
(&parent, "players_menu", ®istry, 340, 400, _("Player Options")),
- m_add_player
+ add_player_
(this, "add_player",
get_inner_w() - 5 - 20, 5, 20, 20,
g_gr->images().get("images/ui_basic/but1.png"),
g_gr->images().get("images/ui_basic/scrollbar_up.png"),
_("Add player"),
parent.egbase().map().get_nrplayers() < MAX_PLAYERS),
- m_remove_last_player
+ remove_last_player_
(this, "remove_last_player",
5, 5, 20, 20,
g_gr->images().get("images/ui_basic/but1.png"),
g_gr->images().get("images/ui_basic/scrollbar_down.png"),
_("Remove last player"),
1 < parent.egbase().map().get_nrplayers()),
- m_tribenames(eia().egbase().tribes().get_all_tribenames())
+ tribenames_(eia().egbase().tribes().get_all_tribenames())
{
- m_add_player.sigclicked.connect(boost::bind(&EditorPlayerMenu::clicked_add_player, boost::ref(*this)));
- m_remove_last_player.sigclicked.connect
+ add_player_.sigclicked.connect(boost::bind(&EditorPlayerMenu::clicked_add_player, boost::ref(*this)));
+ remove_last_player_.sigclicked.connect
(boost::bind(&EditorPlayerMenu::clicked_remove_last_player, boost::ref(*this)));
int32_t const spacing = 5;
@@ -100,19 +100,19 @@
ta->set_pos(Point((get_inner_w() - ta->get_w()) / 2, posy + 5));
posy += spacing + width;
- m_nr_of_players_ta = new UI::Textarea(this, 0, 0, "5");
- m_nr_of_players_ta->set_pos
- (Point((get_inner_w() - m_nr_of_players_ta->get_w()) / 2, posy + 5));
+ nr_of_players_ta_ = new UI::Textarea(this, 0, 0, "5");
+ nr_of_players_ta_->set_pos
+ (Point((get_inner_w() - nr_of_players_ta_->get_w()) / 2, posy + 5));
posy += width + spacing + spacing;
- m_posy = posy;
+ posy_ = posy;
for (Widelands::PlayerNumber i = 0; i < MAX_PLAYERS; ++i) {
- m_plr_names [i] = nullptr;
- m_plr_set_pos_buts [i] = nullptr;
- m_plr_set_tribes_buts[i] = nullptr;
- m_plr_make_infrastructure_buts[i] = nullptr;
+ plr_names_ [i] = nullptr;
+ plr_set_pos_buts_ [i] = nullptr;
+ plr_set_tribes_buts_[i] = nullptr;
+ plr_make_infrastructure_buts_[i] = nullptr;
}
update();
@@ -147,75 +147,75 @@
text[0] = '0' + nr_players;
text[1] = '\0';
}
- m_nr_of_players_ta->set_text(text);
+ nr_of_players_ta_->set_text(text);
}
// Now remove all the unneeded stuff.
for (Widelands::PlayerNumber i = nr_players; i < MAX_PLAYERS; ++i) {
- delete m_plr_names [i]; m_plr_names [i] = nullptr;
- delete m_plr_set_pos_buts [i]; m_plr_set_pos_buts [i] = nullptr;
- delete m_plr_set_tribes_buts[i]; m_plr_set_tribes_buts[i] = nullptr;
+ delete plr_names_ [i]; plr_names_ [i] = nullptr;
+ delete plr_set_pos_buts_ [i]; plr_set_pos_buts_ [i] = nullptr;
+ delete plr_set_tribes_buts_[i]; plr_set_tribes_buts_[i] = nullptr;
}
- int32_t posy = m_posy;
+ int32_t posy = posy_;
int32_t const spacing = 5;
int32_t const size = 20;
iterate_player_numbers(p, nr_players) {
int32_t posx = spacing;
- if (!m_plr_names[p - 1]) {
- m_plr_names[p - 1] =
+ if (!plr_names_[p - 1]) {
+ plr_names_[p - 1] =
new UI::EditBox
(this, posx, posy, 140,
g_gr->images().get("images/ui_basic/but0.png"));
- m_plr_names[p - 1]->changed.connect
+ plr_names_[p - 1]->changed.connect
(boost::bind(&EditorPlayerMenu::name_changed, this, p - 1));
posx += 140 + spacing;
- m_plr_names[p - 1]->set_text(map.get_scenario_player_name(p));
+ plr_names_[p - 1]->set_text(map.get_scenario_player_name(p));
}
- if (!m_plr_set_tribes_buts[p - 1]) {
- m_plr_set_tribes_buts[p - 1] =
+ if (!plr_set_tribes_buts_[p - 1]) {
+ plr_set_tribes_buts_[p - 1] =
new UI::Button
(this, "tribe",
posx, posy, 140, size,
g_gr->images().get("images/ui_basic/but0.png"),
"");
- m_plr_set_tribes_buts[p - 1]->sigclicked.connect
+ plr_set_tribes_buts_[p - 1]->sigclicked.connect
(boost::bind(&EditorPlayerMenu::player_tribe_clicked, boost::ref(*this), p - 1));
posx += 140 + spacing;
}
// Get/Set (localized) tribe names
if (map.get_scenario_player_tribe(p) != UNDEFINED_TRIBE_NAME) {
- m_selected_tribes[p - 1] = map.get_scenario_player_tribe(p);
+ selected_tribes_[p - 1] = map.get_scenario_player_tribe(p);
} else {
- m_selected_tribes[p - 1] = m_tribenames[0];
- map.set_scenario_player_tribe(p, m_selected_tribes[p - 1]);
+ selected_tribes_[p - 1] = tribenames_[0];
+ map.set_scenario_player_tribe(p, selected_tribes_[p - 1]);
}
- m_plr_set_tribes_buts[p - 1]
- ->set_title(eia().egbase().tribes().tribeinfo(m_selected_tribes[p - 1]).descname);
+ plr_set_tribes_buts_[p - 1]
+ ->set_title(eia().egbase().tribes().tribeinfo(selected_tribes_[p - 1]).descname);
// Set default AI and closeable to false (always default - should be changed by hand)
map.set_scenario_player_ai(p, "");
map.set_scenario_player_closeable(p, false);
// Set Starting pos button.
- if (!m_plr_set_pos_buts[p - 1]) {
- m_plr_set_pos_buts[p - 1] =
+ if (!plr_set_pos_buts_[p - 1]) {
+ plr_set_pos_buts_[p - 1] =
new UI::Button
(this, "starting_pos",
posx, posy, size, size,
g_gr->images().get("images/ui_basic/but0.png"),
nullptr,
"");
- m_plr_set_pos_buts[p - 1]->sigclicked.connect
+ plr_set_pos_buts_[p - 1]->sigclicked.connect
(boost::bind(&EditorPlayerMenu::set_starting_pos_clicked, boost::ref(*this), p));
}
const Image* player_image = g_gr->images().get(player_pictures_small[p - 1]);
assert(player_image);
- m_plr_set_pos_buts[p - 1]->set_pic(player_image);
+ plr_set_pos_buts_[p - 1]->set_pic(player_image);
posy += size + spacing;
}
set_inner_size(get_inner_w(), posy + spacing);
@@ -232,10 +232,10 @@
const std::string name = (boost::format(_("Player %u")) % static_cast<unsigned int>(nr_players)).str();
map.set_scenario_player_name(nr_players, name);
}
- map.set_scenario_player_tribe(nr_players, m_tribenames[0]);
+ map.set_scenario_player_tribe(nr_players, tribenames_[0]);
eia().set_need_save(true);
- m_add_player .set_enabled(nr_players < MAX_PLAYERS);
- m_remove_last_player.set_enabled(true);
+ add_player_ .set_enabled(nr_players < MAX_PLAYERS);
+ remove_last_player_.set_enabled(true);
update();
}
@@ -259,8 +259,8 @@
set_starting_pos_clicked(nr_players);
}
map.set_nrplayers(nr_players);
- m_add_player .set_enabled(nr_players < MAX_PLAYERS);
- m_remove_last_player.set_enabled(1 < nr_players);
+ add_player_ .set_enabled(nr_players < MAX_PLAYERS);
+ remove_last_player_.set_enabled(1 < nr_players);
update();
// TODO(SirVer): Take steps when the player is referenced someplace. Not
@@ -274,18 +274,18 @@
void EditorPlayerMenu::player_tribe_clicked(uint8_t n) {
EditorInteractive& menu = eia();
if (!menu.is_player_tribe_referenced(n + 1)) {
- if (!Widelands::Tribes::tribe_exists(m_selected_tribes[n])) {
+ if (!Widelands::Tribes::tribe_exists(selected_tribes_[n])) {
throw wexception
- ("Map defines tribe %s, but it does not exist!", m_selected_tribes[n].c_str());
+ ("Map defines tribe %s, but it does not exist!", selected_tribes_[n].c_str());
}
uint32_t i;
- for (i = 0; i < m_tribenames.size(); ++i) {
- if (m_tribenames[i] == m_selected_tribes[n]) {
+ for (i = 0; i < tribenames_.size(); ++i) {
+ if (tribenames_[i] == selected_tribes_[n]) {
break;
}
}
- m_selected_tribes[n] = i == m_tribenames.size() - 1 ? m_tribenames[0] : m_tribenames[++i];
- menu.egbase().map().set_scenario_player_tribe(n + 1, m_selected_tribes[n]);
+ selected_tribes_[n] = i == tribenames_.size() - 1 ? tribenames_[0] : tribenames_[++i];
+ menu.egbase().map().set_scenario_player_tribe(n + 1, selected_tribes_[n]);
menu.set_need_save(true);
} else {
UI::WLMessageBox mmb
@@ -331,15 +331,15 @@
*/
void EditorPlayerMenu::name_changed(int32_t m) {
// Player name has been changed.
- std::string text = m_plr_names[m]->text();
+ std::string text = plr_names_[m]->text();
EditorInteractive& menu = eia();
Widelands::Map & map = menu.egbase().map();
if (text == "") {
text = map.get_scenario_player_name(m + 1);
- m_plr_names[m]->set_text(text);
+ plr_names_[m]->set_text(text);
}
map.set_scenario_player_name(m + 1, text);
- m_plr_names[m]->set_text(map.get_scenario_player_name(m + 1));
+ plr_names_[m]->set_text(map.get_scenario_player_name(m + 1));
menu.set_need_save(true);
}
@@ -364,8 +364,8 @@
// so that this tribe can not be changed
egbase.add_player
(n, 0, // TODO(SirVer): initialization index makes no sense here
- eia().egbase().tribes().tribeinfo(m_selected_tribes[n]).descname,
- m_plr_names[n - 1]->text());
+ eia().egbase().tribes().tribeinfo(selected_tribes_[n]).descname,
+ plr_names_[n - 1]->text());
p = egbase.get_player(n);
}
=== modified file 'src/editor/ui_menus/editor_player_menu.h'
--- src/editor/ui_menus/editor_player_menu.h 2016-01-16 12:55:14 +0000
+++ src/editor/ui_menus/editor_player_menu.h 2016-03-18 12:52:47 +0000
@@ -46,22 +46,21 @@
private:
EditorInteractive & eia();
- UI::UniqueWindow::Registry m_allow_buildings_menu;
- UI::Textarea * m_nr_of_players_ta;
- UI::EditBox * m_plr_names[MAX_PLAYERS];
- UI::Button
- m_add_player, m_remove_last_player;
- UI::Button
- * m_plr_make_infrastructure_buts[MAX_PLAYERS],
- * m_plr_set_pos_buts [MAX_PLAYERS],
- * m_plr_set_tribes_buts [MAX_PLAYERS];
+ UI::UniqueWindow::Registry allow_buildings_menu_;
+ UI::Textarea* nr_of_players_ta_;
+ UI::EditBox* plr_names_[MAX_PLAYERS];
+ UI::Button add_player_, remove_last_player_;
+ UI::Button
+ * plr_make_infrastructure_buts_[MAX_PLAYERS],
+ * plr_set_pos_buts_ [MAX_PLAYERS],
+ * plr_set_tribes_buts_ [MAX_PLAYERS];
- std::vector<std::string> m_tribenames;
+ std::vector<std::string> tribenames_;
/// List of the tribes currently selected for all players
- std::string m_selected_tribes[MAX_PLAYERS];
+ std::string selected_tribes_[MAX_PLAYERS];
- int32_t m_posy;
+ int32_t posy_;
void name_changed(int32_t);
void clicked_add_player ();
=== modified file 'src/editor/ui_menus/editor_tool_change_height_options_menu.cc'
--- src/editor/ui_menus/editor_tool_change_height_options_menu.cc 2016-01-29 08:37:22 +0000
+++ src/editor/ui_menus/editor_tool_change_height_options_menu.cc 2016-03-18 12:52:47 +0000
@@ -39,117 +39,117 @@
:
EditorToolOptionsMenu
(parent, registry, 250, 135, _("Height Tools Options")),
- m_increase_tool(increase_tool),
- m_change_by_label
+ increase_tool_(increase_tool),
+ change_by_label_
(this,
hmargin(), vmargin(), get_inner_w() - 2 * hmargin(), height,
_("Increase/Decrease Value"), UI::Align::kBottomCenter),
- m_change_by_increase
+ change_by_increase_
(this, "incr_change_by",
get_inner_w() - hmargin() - width,
- m_change_by_label.get_y() + m_change_by_label.get_h() + spacing(),
+ change_by_label_.get_y() + change_by_label_.get_h() + spacing(),
width, height,
g_gr->images().get("images/ui_basic/but1.png"),
g_gr->images().get("images/ui_basic/scrollbar_up.png"),
std::string(),
increase_tool.get_change_by() < MAX_FIELD_HEIGHT_DIFF),
- m_change_by_decrease
+ change_by_decrease_
(this, "decr_change_by",
hmargin(),
- m_change_by_increase.get_y(),
+ change_by_increase_.get_y(),
width, height,
g_gr->images().get("images/ui_basic/but1.png"),
g_gr->images().get("images/ui_basic/scrollbar_down.png"),
std::string(),
1 < increase_tool.get_change_by()),
- m_change_by_value
+ change_by_value_
(this,
- m_change_by_increase.get_x() + m_change_by_increase.get_w() +
+ change_by_increase_.get_x() + change_by_increase_.get_w() +
hspacing(),
- m_change_by_increase.get_y(),
- m_change_by_decrease.get_x() - hspacing()
+ change_by_increase_.get_y(),
+ change_by_decrease_.get_x() - hspacing()
-
- (m_change_by_increase.get_x() + m_change_by_increase.get_w() +
+ (change_by_increase_.get_x() + change_by_increase_.get_w() +
hspacing()),
height,
UI::Align::kBottomCenter),
- m_set_to_label
+ set_to_label_
(this,
vmargin(),
- m_change_by_increase.get_y() + m_change_by_increase.get_h() +
+ change_by_increase_.get_y() + change_by_increase_.get_h() +
vspacing(),
get_inner_w() - 2 * hmargin(), height,
_("Set Value"), UI::Align::kBottomCenter),
- m_set_to_increase
+ set_to_increase_
(this, "incr_set_to",
- m_change_by_increase.get_x(),
- m_set_to_label.get_y() + m_set_to_label.get_h() + vspacing(),
+ change_by_increase_.get_x(),
+ set_to_label_.get_y() + set_to_label_.get_h() + vspacing(),
width, height,
g_gr->images().get("images/ui_basic/but1.png"),
g_gr->images().get("images/ui_basic/scrollbar_up.png"),
std::string(),
increase_tool.set_tool().get_interval().min < MAX_FIELD_HEIGHT),
- m_set_to_decrease
+ set_to_decrease_
(this, "decr_set_to",
hmargin(),
- m_set_to_increase.get_y(),
+ set_to_increase_.get_y(),
width, height,
g_gr->images().get("images/ui_basic/but1.png"),
g_gr->images().get("images/ui_basic/scrollbar_down.png"),
std::string(),
0 < increase_tool.set_tool().get_interval().min),
- m_set_to_value
+ set_to_value_
(this,
- m_change_by_value.get_x(), m_set_to_increase.get_y(),
- m_change_by_value.get_w(), height,
+ change_by_value_.get_x(), set_to_increase_.get_y(),
+ change_by_value_.get_w(), height,
UI::Align::kBottomCenter)
{
- m_change_by_increase.sigclicked.connect
+ change_by_increase_.sigclicked.connect
(boost::bind
(&EditorToolChangeHeightOptionsMenu::clicked_change_by_increment, boost::ref(*this)));
- m_change_by_decrease.sigclicked.connect
+ change_by_decrease_.sigclicked.connect
(boost::bind
(&EditorToolChangeHeightOptionsMenu::clicked_change_by_decrement, boost::ref(*this)));
- m_set_to_increase.sigclicked.connect
+ set_to_increase_.sigclicked.connect
(boost::bind(&EditorToolChangeHeightOptionsMenu::clicked_setto_increment, boost::ref(*this)));
- m_set_to_decrease.sigclicked.connect
+ set_to_decrease_.sigclicked.connect
(boost::bind(&EditorToolChangeHeightOptionsMenu::clicked_setto_decrement, boost::ref(*this)));
- m_change_by_increase.set_repeating(true);
- m_change_by_decrease.set_repeating(true);
- m_set_to_increase .set_repeating(true);
- m_set_to_decrease .set_repeating(true);
+ change_by_increase_.set_repeating(true);
+ change_by_decrease_.set_repeating(true);
+ set_to_increase_ .set_repeating(true);
+ set_to_decrease_ .set_repeating(true);
update();
}
void EditorToolChangeHeightOptionsMenu::clicked_change_by_decrement() {
- int32_t change_by = m_increase_tool.get_change_by();
- assert(change_by == m_increase_tool.decrease_tool().get_change_by());
+ int32_t change_by = increase_tool_.get_change_by();
+ assert(change_by == increase_tool_.decrease_tool().get_change_by());
assert(1 < change_by);
--change_by;
- m_increase_tool .set_change_by(change_by);
- m_increase_tool.decrease_tool().set_change_by(change_by);
- m_change_by_decrease.set_enabled(1 < change_by);
- m_change_by_increase.set_enabled(true);
+ increase_tool_ .set_change_by(change_by);
+ increase_tool_.decrease_tool().set_change_by(change_by);
+ change_by_decrease_.set_enabled(1 < change_by);
+ change_by_increase_.set_enabled(true);
select_correct_tool();
update();
}
void EditorToolChangeHeightOptionsMenu::clicked_change_by_increment() {
- int32_t change_by = m_increase_tool.get_change_by();
- assert(change_by == m_increase_tool.decrease_tool().get_change_by());
+ int32_t change_by = increase_tool_.get_change_by();
+ assert(change_by == increase_tool_.decrease_tool().get_change_by());
assert(change_by < MAX_FIELD_HEIGHT_DIFF);
++change_by;
- m_increase_tool .set_change_by(change_by);
- m_increase_tool.decrease_tool().set_change_by(change_by);
- m_change_by_decrease.set_enabled(true);
- m_change_by_increase.set_enabled(change_by < MAX_FIELD_HEIGHT_DIFF);
+ increase_tool_ .set_change_by(change_by);
+ increase_tool_.decrease_tool().set_change_by(change_by);
+ change_by_decrease_.set_enabled(true);
+ change_by_increase_.set_enabled(change_by < MAX_FIELD_HEIGHT_DIFF);
select_correct_tool();
update();
}
@@ -157,16 +157,16 @@
void EditorToolChangeHeightOptionsMenu::clicked_setto_decrement() {
Widelands::Field::Height setto =
- m_increase_tool.set_tool().get_interval().min;
- assert(setto == m_increase_tool.set_tool().get_interval().max);
+ increase_tool_.set_tool().get_interval().min;
+ assert(setto == increase_tool_.set_tool().get_interval().max);
assert(0 < setto);
--setto;
- m_increase_tool.set_tool().set_interval
+ increase_tool_.set_tool().set_interval
(Widelands::HeightInterval(setto, setto));
- m_set_to_decrease.set_enabled(0 < setto);
- m_set_to_increase.set_enabled(true);
+ set_to_decrease_.set_enabled(0 < setto);
+ set_to_increase_.set_enabled(true);
select_correct_tool();
update();
}
@@ -174,16 +174,16 @@
void EditorToolChangeHeightOptionsMenu::clicked_setto_increment() {
Widelands::Field::Height setto =
- m_increase_tool.set_tool().get_interval().min;
- assert(setto == m_increase_tool.set_tool().get_interval().max);
+ increase_tool_.set_tool().get_interval().min;
+ assert(setto == increase_tool_.set_tool().get_interval().max);
assert(setto < MAX_FIELD_HEIGHT);
++setto;
- m_increase_tool.set_tool().set_interval
+ increase_tool_.set_tool().set_interval
(Widelands::HeightInterval(setto, setto));
- m_set_to_decrease.set_enabled(true);
- m_set_to_increase.set_enabled(setto < MAX_FIELD_HEIGHT);
+ set_to_decrease_.set_enabled(true);
+ set_to_increase_.set_enabled(setto < MAX_FIELD_HEIGHT);
select_correct_tool();
update();
}
@@ -191,8 +191,8 @@
/// Update all the textareas, so that they represent the correct values.
void EditorToolChangeHeightOptionsMenu::update() {
- m_change_by_value.set_text(std::to_string(m_increase_tool.get_change_by()));
+ change_by_value_.set_text(std::to_string(increase_tool_.get_change_by()));
- m_set_to_value.set_text(std::to_string(
- static_cast<unsigned int>(m_increase_tool.set_tool().get_interval().min)));
+ set_to_value_.set_text(std::to_string(
+ static_cast<unsigned int>(increase_tool_.set_tool().get_interval().min)));
}
=== modified file 'src/editor/ui_menus/editor_tool_change_height_options_menu.h'
--- src/editor/ui_menus/editor_tool_change_height_options_menu.h 2016-01-16 12:55:14 +0000
+++ src/editor/ui_menus/editor_tool_change_height_options_menu.h 2016-03-18 12:52:47 +0000
@@ -36,13 +36,13 @@
UI::UniqueWindow::Registry &);
private:
- EditorIncreaseHeightTool & m_increase_tool;
- UI::Textarea m_change_by_label;
- UI::Button m_change_by_increase, m_change_by_decrease;
- UI::Textarea m_change_by_value;
- UI::Textarea m_set_to_label;
- UI::Button m_set_to_increase, m_set_to_decrease;
- UI::Textarea m_set_to_value;
+ EditorIncreaseHeightTool& increase_tool_;
+ UI::Textarea change_by_label_;
+ UI::Button change_by_increase_, change_by_decrease_;
+ UI::Textarea change_by_value_;
+ UI::Textarea set_to_label_;
+ UI::Button set_to_increase_, set_to_decrease_;
+ UI::Textarea set_to_value_;
void clicked_change_by_decrement();
void clicked_change_by_increment();
=== modified file 'src/editor/ui_menus/editor_tool_change_resources_options_menu.cc'
--- src/editor/ui_menus/editor_tool_change_resources_options_menu.cc 2016-02-01 07:51:56 +0000
+++ src/editor/ui_menus/editor_tool_change_resources_options_menu.cc 2016-03-18 12:52:47 +0000
@@ -52,87 +52,87 @@
:
EditorToolOptionsMenu
(parent, registry, 250, 120, _("Resources")),
- m_change_by_label
+ change_by_label_
(this,
hmargin(), vmargin(), get_inner_w() - 2 * hmargin(), BUTTON_HEIGHT,
_("Increase/Decrease Value"), UI::Align::kBottomCenter),
- m_change_by_increase
+ change_by_increase_
(this, "incr_change_by",
get_inner_w() - hmargin() - BUTTON_WIDTH,
- m_change_by_label.get_y() + m_change_by_label.get_h() + spacing(),
+ change_by_label_.get_y() + change_by_label_.get_h() + spacing(),
BUTTON_WIDTH, BUTTON_HEIGHT,
g_gr->images().get("images/ui_basic/but1.png"),
g_gr->images().get("images/ui_basic/scrollbar_up.png")),
- m_change_by_decrease
+ change_by_decrease_
(this, "decr_change_by",
hmargin(),
- m_change_by_increase.get_y(),
+ change_by_increase_.get_y(),
BUTTON_WIDTH, BUTTON_HEIGHT,
g_gr->images().get("images/ui_basic/but1.png"),
g_gr->images().get("images/ui_basic/scrollbar_down.png")),
- m_change_by_value
+ change_by_value_
(this,
- m_change_by_increase.get_x() + m_change_by_increase.get_w() +
+ change_by_increase_.get_x() + change_by_increase_.get_w() +
hspacing(),
- m_change_by_increase.get_y(),
- m_change_by_decrease.get_x() - hspacing()
+ change_by_increase_.get_y(),
+ change_by_decrease_.get_x() - hspacing()
-
- (m_change_by_increase.get_x() + m_change_by_increase.get_w() +
+ (change_by_increase_.get_x() + change_by_increase_.get_w() +
hspacing()),
BUTTON_HEIGHT,
UI::Align::kBottomCenter),
- m_set_to_label
+ set_to_label_
(this,
vmargin(),
- m_change_by_increase.get_y() + m_change_by_increase.get_h() + vspacing(),
+ change_by_increase_.get_y() + change_by_increase_.get_h() + vspacing(),
get_inner_w() - 2 * hmargin(), BUTTON_HEIGHT,
_("Set Value"), UI::Align::kBottomCenter),
- m_set_to_increase
+ set_to_increase_
(this, "incr_set_to",
- m_change_by_increase.get_x(),
- m_set_to_label.get_y() + m_set_to_label.get_h() + vspacing(),
+ change_by_increase_.get_x(),
+ set_to_label_.get_y() + set_to_label_.get_h() + vspacing(),
BUTTON_WIDTH, BUTTON_HEIGHT,
g_gr->images().get("images/ui_basic/but1.png"),
g_gr->images().get("images/ui_basic/scrollbar_up.png")),
- m_set_to_decrease
+ set_to_decrease_
(this, "decr_set_to",
hmargin(),
- m_set_to_increase.get_y(), BUTTON_WIDTH, BUTTON_HEIGHT,
+ set_to_increase_.get_y(), BUTTON_WIDTH, BUTTON_HEIGHT,
g_gr->images().get("images/ui_basic/but1.png"),
g_gr->images().get("images/ui_basic/scrollbar_down.png")),
- m_set_to_value
+ set_to_value_
(this,
- m_change_by_value.get_x(), m_set_to_increase.get_y(),
- m_change_by_value.get_w(), BUTTON_HEIGHT,
+ change_by_value_.get_x(), set_to_increase_.get_y(),
+ change_by_value_.get_w(), BUTTON_HEIGHT,
UI::Align::kBottomCenter),
- m_cur_selection(this, 0, 0, _("Current Selection"), UI::Align::kBottomCenter),
- m_increase_tool(increase_tool)
+ cur_selection_(this, 0, 0, _("Current Selection"), UI::Align::kBottomCenter),
+ increase_tool_(increase_tool)
{
- m_change_by_increase.sigclicked.connect
+ change_by_increase_.sigclicked.connect
(boost::bind
(&EditorToolChangeResourcesOptionsMenu::clicked_button,
boost::ref(*this),
Change_By_Increase));
- m_change_by_decrease.sigclicked.connect
+ change_by_decrease_.sigclicked.connect
(boost::bind
(&EditorToolChangeResourcesOptionsMenu::clicked_button,
boost::ref(*this),
Change_By_Decrease));
- m_set_to_increase.sigclicked.connect
+ set_to_increase_.sigclicked.connect
(boost::bind
(&EditorToolChangeResourcesOptionsMenu::clicked_button,
boost::ref(*this),
Set_To_Increase));
- m_set_to_decrease.sigclicked.connect
+ set_to_decrease_.sigclicked.connect
(boost::bind
(&EditorToolChangeResourcesOptionsMenu::clicked_button,
boost::ref(*this),
Set_To_Decrease));
- m_change_by_increase.set_repeating(true);
- m_change_by_decrease.set_repeating(true);
- m_set_to_increase .set_repeating(true);
- m_set_to_decrease .set_repeating(true);
+ change_by_increase_.set_repeating(true);
+ change_by_decrease_.set_repeating(true);
+ set_to_increase_ .set_repeating(true);
+ set_to_decrease_ .set_repeating(true);
const Widelands::World & world = parent.egbase().world();
Widelands::DescriptionIndex const nr_resources = world.get_nr_resources();
@@ -149,14 +149,14 @@
/
(resource_pic_max_width + spacing());
- m_radiogroup.changed.connect
+ radiogroup_.changed.connect
(boost::bind(&EditorToolChangeResourcesOptionsMenu::selected, this));
- m_radiogroup.clicked.connect
+ radiogroup_.clicked.connect
(boost::bind(&EditorToolChangeResourcesOptionsMenu::selected, this));
uint16_t cur_x = 0;
Point pos
- (hmargin(), m_set_to_value.get_y() + m_set_to_value.get_h() + vspacing());
+ (hmargin(), set_to_value_.get_y() + set_to_value_.get_h() + vspacing());
for
(Widelands::DescriptionIndex i = 0;
i < nr_resources;
@@ -167,17 +167,17 @@
pos.x = hmargin();
pos.y += resource_pic_max_height + vspacing();
}
- m_radiogroup.add_button
+ radiogroup_.add_button
(this,
pos,
g_gr->images().get(world.get_resource(i)->representative_image()));
}
pos.y += resource_pic_max_height + vspacing();
- set_inner_size(get_inner_w(), pos.y + m_cur_selection.get_h() + vmargin());
- m_cur_selection.set_pos(Point(get_inner_w() / 2, pos.y + hspacing()));
+ set_inner_size(get_inner_w(), pos.y + cur_selection_.get_h() + vmargin());
+ cur_selection_.set_pos(Point(get_inner_w() / 2, pos.y + hspacing()));
- m_radiogroup.set_state(m_increase_tool.get_cur_res());
+ radiogroup_.set_state(increase_tool_.get_cur_res());
update();
}
@@ -186,12 +186,12 @@
void EditorToolChangeResourcesOptionsMenu::clicked_button(Button const n)
{
assert
- (m_increase_tool.get_change_by()
+ (increase_tool_.get_change_by()
==
- m_increase_tool.decrease_tool().get_change_by());
+ increase_tool_.decrease_tool().get_change_by());
- int32_t change_by = m_increase_tool.get_change_by();
- int32_t set_to = m_increase_tool.set_tool().get_set_to();
+ int32_t change_by = increase_tool_.get_change_by();
+ int32_t set_to = increase_tool_.set_tool().get_set_to();
switch (n) {
case Change_By_Increase: change_by += change_by < 63; break;
@@ -202,9 +202,9 @@
NEVER_HERE();
break;
}
- m_increase_tool.set_change_by(change_by);
- m_increase_tool.decrease_tool().set_change_by(change_by);
- m_increase_tool.set_tool().set_set_to(set_to);
+ increase_tool_.set_change_by(change_by);
+ increase_tool_.decrease_tool().set_change_by(change_by);
+ increase_tool_.set_tool().set_set_to(set_to);
select_correct_tool();
update();
@@ -214,11 +214,11 @@
* called when a resource has been selected
*/
void EditorToolChangeResourcesOptionsMenu::selected() {
- const int32_t resIx = m_radiogroup.get_state();
+ const int32_t resIx = radiogroup_.get_state();
- m_increase_tool.set_tool().set_cur_res(resIx);
- m_increase_tool.set_cur_res(resIx);
- m_increase_tool.decrease_tool().set_cur_res(resIx);
+ increase_tool_.set_tool().set_cur_res(resIx);
+ increase_tool_.set_cur_res(resIx);
+ increase_tool_.decrease_tool().set_cur_res(resIx);
Widelands::EditorGameBase& egbase = eia().egbase();
Widelands::Map & map = egbase.map();
@@ -241,25 +241,25 @@
*/
void EditorToolChangeResourcesOptionsMenu::update() {
- m_change_by_value.set_text(std::to_string(m_increase_tool.get_change_by()));
-
- m_set_to_value.set_text(std::to_string(
- static_cast<unsigned int>(m_increase_tool.set_tool().get_set_to())));
-
- m_cur_selection.set_text
- (eia().egbase().world().get_resource(m_increase_tool.set_tool().get_cur_res())->descname());
- m_cur_selection.set_pos
+ change_by_value_.set_text(std::to_string(increase_tool_.get_change_by()));
+
+ set_to_value_.set_text(std::to_string(
+ static_cast<unsigned int>(increase_tool_.set_tool().get_set_to())));
+
+ cur_selection_.set_text
+ (eia().egbase().world().get_resource(increase_tool_.set_tool().get_cur_res())->descname());
+ cur_selection_.set_pos
(Point
- ((get_inner_w() - m_cur_selection.get_w()) / 2, get_inner_h() - 20));
+ ((get_inner_w() - cur_selection_.get_w()) / 2, get_inner_h() - 20));
{
- int32_t const change_by = m_increase_tool.get_change_by();
- m_change_by_decrease.set_enabled(1 < change_by);
- m_change_by_increase.set_enabled (change_by < 63);
+ int32_t const change_by = increase_tool_.get_change_by();
+ change_by_decrease_.set_enabled(1 < change_by);
+ change_by_increase_.set_enabled (change_by < 63);
}
{
- int32_t const set_to = m_increase_tool.set_tool().get_set_to();
- m_set_to_decrease .set_enabled(0 < set_to);
- m_set_to_increase .set_enabled (set_to < 63);
+ int32_t const set_to = increase_tool_.set_tool().get_set_to();
+ set_to_decrease_ .set_enabled(0 < set_to);
+ set_to_increase_ .set_enabled (set_to < 63);
}
}
=== modified file 'src/editor/ui_menus/editor_tool_change_resources_options_menu.h'
--- src/editor/ui_menus/editor_tool_change_resources_options_menu.h 2016-01-16 12:55:14 +0000
+++ src/editor/ui_menus/editor_tool_change_resources_options_menu.h 2016-03-18 12:52:47 +0000
@@ -45,15 +45,15 @@
};
void clicked_button(Button);
void update();
- UI::Textarea m_change_by_label;
- UI::Button m_change_by_increase, m_change_by_decrease;
- UI::Textarea m_change_by_value;
- UI::Textarea m_set_to_label;
- UI::Button m_set_to_increase, m_set_to_decrease;
- UI::Textarea m_set_to_value;
- UI::Textarea m_cur_selection;
- UI::Radiogroup m_radiogroup;
- EditorIncreaseResourcesTool & m_increase_tool;
+ UI::Textarea change_by_label_;
+ UI::Button change_by_increase_, change_by_decrease_;
+ UI::Textarea change_by_value_;
+ UI::Textarea set_to_label_;
+ UI::Button set_to_increase_, set_to_decrease_;
+ UI::Textarea set_to_value_;
+ UI::Textarea cur_selection_;
+ UI::Radiogroup radiogroup_;
+ EditorIncreaseResourcesTool& increase_tool_;
};
#endif // end of include guard: WL_EDITOR_UI_MENUS_EDITOR_TOOL_CHANGE_RESOURCES_OPTIONS_MENU_H
=== modified file 'src/editor/ui_menus/editor_tool_noise_height_options_menu.cc'
--- src/editor/ui_menus/editor_tool_noise_height_options_menu.cc 2016-01-29 08:37:22 +0000
+++ src/editor/ui_menus/editor_tool_noise_height_options_menu.cc 2016-03-18 12:52:47 +0000
@@ -43,99 +43,99 @@
:
EditorToolOptionsMenu
(parent, registry, 250, 3 * height + 4 * vspacing() + 2 * vmargin(), _("Noise Height Options")),
- m_noise_tool(noise_tool),
- m_lower_label
+ noise_tool_(noise_tool),
+ lower_label_
(this,
hmargin(),
vmargin(),
width, height,
UI::Align::kLeft),
- m_upper_label
+ upper_label_
(this,
hmargin(),
- m_lower_label.get_y() + m_lower_label.get_h() + 2 * vspacing(),
+ lower_label_.get_y() + lower_label_.get_h() + 2 * vspacing(),
width, height,
UI::Align::kLeft),
- m_lower_decrease
+ lower_decrease_
(this, "decr_lower",
get_inner_w() - 2 * width - hspacing(),
- m_lower_label.get_y(),
+ lower_label_.get_y(),
width, height,
g_gr->images().get("images/ui_basic/but0.png"),
g_gr->images().get("images/ui_basic/scrollbar_down.png"),
std::string(),
0 < noise_tool.get_interval().min),
- m_lower_increase
+ lower_increase_
(this, "incr_lower",
get_inner_w() - width - hspacing(),
- m_lower_label.get_y(),
+ lower_label_.get_y(),
width, height,
g_gr->images().get("images/ui_basic/but0.png"),
g_gr->images().get("images/ui_basic/scrollbar_up.png"),
std::string(),
noise_tool.get_interval().min < MAX_FIELD_HEIGHT),
- m_upper_decrease
+ upper_decrease_
(this, "decr_upper",
get_inner_w() - 2 * width - hspacing(),
- m_upper_label.get_y(),
+ upper_label_.get_y(),
width, height,
g_gr->images().get("images/ui_basic/but0.png"),
g_gr->images().get("images/ui_basic/scrollbar_down.png"),
std::string(),
0 < noise_tool.get_interval().max),
- m_upper_increase
+ upper_increase_
(this, "incr_upper",
get_inner_w() - width - hspacing(),
- m_upper_label.get_y(),
+ upper_label_.get_y(),
width, height,
g_gr->images().get("images/ui_basic/but0.png"),
g_gr->images().get("images/ui_basic/scrollbar_up.png"),
std::string(),
noise_tool.get_interval().max < MAX_FIELD_HEIGHT),
- m_set_label
+ set_label_
(this,
hmargin(),
- m_upper_label.get_y() + m_upper_label.get_h() + 2 * vspacing(),
+ upper_label_.get_y() + upper_label_.get_h() + 2 * vspacing(),
width, height,
UI::Align::kLeft),
- m_setto_decrease
+ setto_decrease_
(this, "decr_set_to",
get_inner_w() - 2 * width - hspacing(),
- m_set_label.get_y(),
+ set_label_.get_y(),
width, height,
g_gr->images().get("images/ui_basic/but1.png"),
g_gr->images().get("images/ui_basic/scrollbar_down.png"),
std::string(),
0 < noise_tool.set_tool().get_interval().min),
- m_setto_increase
+ setto_increase_
(this, "incr_set_to",
get_inner_w() - width - hspacing(),
- m_set_label.get_y(),
+ set_label_.get_y(),
width, height,
g_gr->images().get("images/ui_basic/but1.png"),
g_gr->images().get("images/ui_basic/scrollbar_up.png"),
std::string(),
noise_tool.set_tool().get_interval().max < MAX_FIELD_HEIGHT)
{
- m_lower_increase.sigclicked.connect
+ lower_increase_.sigclicked.connect
(boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_lower_increase, boost::ref(*this)));
- m_lower_decrease.sigclicked.connect
+ lower_decrease_.sigclicked.connect
(boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_lower_decrease, boost::ref(*this)));
- m_upper_increase.sigclicked.connect
+ upper_increase_.sigclicked.connect
(boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_upper_increase, boost::ref(*this)));
- m_upper_decrease.sigclicked.connect
+ upper_decrease_.sigclicked.connect
(boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_upper_decrease, boost::ref(*this)));
- m_setto_increase.sigclicked.connect
+ setto_increase_.sigclicked.connect
(boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_setto_increase, boost::ref(*this)));
- m_setto_decrease.sigclicked.connect
+ setto_decrease_.sigclicked.connect
(boost::bind(&EditorToolNoiseHeightOptionsMenu::clicked_setto_decrease, boost::ref(*this)));
- m_lower_increase.set_repeating(true);
- m_lower_decrease.set_repeating(true);
- m_upper_increase.set_repeating(true);
- m_upper_decrease.set_repeating(true);
- m_setto_increase.set_repeating(true);
- m_setto_decrease.set_repeating(true);
+ lower_increase_.set_repeating(true);
+ lower_decrease_.set_repeating(true);
+ upper_increase_.set_repeating(true);
+ upper_decrease_.set_repeating(true);
+ setto_increase_.set_repeating(true);
+ setto_decrease_.set_repeating(true);
update();
}
@@ -143,23 +143,23 @@
* Update all textareas
*/
void EditorToolNoiseHeightOptionsMenu::update() {
- const Widelands::HeightInterval height_interval = m_noise_tool.get_interval();
+ const Widelands::HeightInterval height_interval = noise_tool_.get_interval();
- m_lower_label.set_text((boost::format(_("Minimum: %u"))
+ lower_label_.set_text((boost::format(_("Minimum: %u"))
% static_cast<unsigned int>(height_interval.min)).str());
- m_upper_label.set_text((boost::format(_("Maximum: %u"))
+ upper_label_.set_text((boost::format(_("Maximum: %u"))
% static_cast<unsigned int>(height_interval.max)).str());
- m_set_label.set_text((boost::format(_("Set value: %u"))
- % static_cast<unsigned int>(m_noise_tool.set_tool().get_interval().min)).str());
+ set_label_.set_text((boost::format(_("Set value: %u"))
+ % static_cast<unsigned int>(noise_tool_.set_tool().get_interval().min)).str());
select_correct_tool();
}
void EditorToolNoiseHeightOptionsMenu::clicked_lower_decrease() {
- Widelands::HeightInterval height_interval = m_noise_tool.get_interval();
+ Widelands::HeightInterval height_interval = noise_tool_.get_interval();
assert(height_interval.valid());
assert(0 < height_interval.min);
@@ -168,15 +168,15 @@
assert(height_interval.valid());
- m_noise_tool.set_interval(height_interval);
- m_lower_decrease.set_enabled(0 < height_interval.min);
- m_lower_increase.set_enabled(true);
+ noise_tool_.set_interval(height_interval);
+ lower_decrease_.set_enabled(0 < height_interval.min);
+ lower_increase_.set_enabled(true);
update();
}
void EditorToolNoiseHeightOptionsMenu::clicked_lower_increase() {
- Widelands::HeightInterval height_interval = m_noise_tool.get_interval();
+ Widelands::HeightInterval height_interval = noise_tool_.get_interval();
assert(height_interval.valid());
assert(height_interval.min < MAX_FIELD_HEIGHT);
@@ -186,55 +186,55 @@
assert(height_interval.valid());
- m_noise_tool.set_interval(height_interval);
- m_lower_decrease.set_enabled(true);
- m_lower_increase.set_enabled(height_interval.min < MAX_FIELD_HEIGHT);
- m_upper_decrease.set_enabled(true);
- m_upper_increase.set_enabled(height_interval.max < MAX_FIELD_HEIGHT);
+ noise_tool_.set_interval(height_interval);
+ lower_decrease_.set_enabled(true);
+ lower_increase_.set_enabled(height_interval.min < MAX_FIELD_HEIGHT);
+ upper_decrease_.set_enabled(true);
+ upper_increase_.set_enabled(height_interval.max < MAX_FIELD_HEIGHT);
update();
}
void EditorToolNoiseHeightOptionsMenu::clicked_upper_decrease() {
- Widelands::HeightInterval height_interval = m_noise_tool.get_interval();
+ Widelands::HeightInterval height_interval = noise_tool_.get_interval();
assert(height_interval.valid());
- assert(0 < m_noise_tool.get_interval().max);
+ assert(0 < noise_tool_.get_interval().max);
--height_interval.max;
height_interval.min = std::min(height_interval.min, height_interval.max);
assert(height_interval.valid());
- m_noise_tool.set_interval(height_interval);
- m_lower_decrease.set_enabled(0 < height_interval.min);
- m_lower_increase.set_enabled(true);
- m_upper_decrease.set_enabled(0 < height_interval.max);
- m_upper_increase.set_enabled(true);
+ noise_tool_.set_interval(height_interval);
+ lower_decrease_.set_enabled(0 < height_interval.min);
+ lower_increase_.set_enabled(true);
+ upper_decrease_.set_enabled(0 < height_interval.max);
+ upper_increase_.set_enabled(true);
update();
}
void EditorToolNoiseHeightOptionsMenu::clicked_upper_increase() {
- Widelands::HeightInterval height_interval = m_noise_tool.get_interval();
+ Widelands::HeightInterval height_interval = noise_tool_.get_interval();
- assert(m_noise_tool.get_interval().valid());
- assert(m_noise_tool.get_interval().max < MAX_FIELD_HEIGHT);
+ assert(noise_tool_.get_interval().valid());
+ assert(noise_tool_.get_interval().max < MAX_FIELD_HEIGHT);
++height_interval.max;
- assert(m_noise_tool.get_interval().valid());
+ assert(noise_tool_.get_interval().valid());
- m_noise_tool.set_interval(height_interval);
- m_upper_decrease.set_enabled(true);
- m_upper_increase.set_enabled(height_interval.max < MAX_FIELD_HEIGHT);
+ noise_tool_.set_interval(height_interval);
+ upper_decrease_.set_enabled(true);
+ upper_increase_.set_enabled(height_interval.max < MAX_FIELD_HEIGHT);
update();
}
void EditorToolNoiseHeightOptionsMenu::clicked_setto_decrease() {
- EditorSetHeightTool & set_tool = m_noise_tool.set_tool();
+ EditorSetHeightTool & set_tool = noise_tool_.set_tool();
Field::Height h = set_tool.get_interval().min;
assert(h == set_tool.get_interval().max);
@@ -243,14 +243,14 @@
--h;
set_tool.set_interval(Widelands::HeightInterval(h, h));
- m_setto_decrease.set_enabled(0 < h);
- m_setto_increase.set_enabled(true);
+ setto_decrease_.set_enabled(0 < h);
+ setto_increase_.set_enabled(true);
update();
}
void EditorToolNoiseHeightOptionsMenu::clicked_setto_increase() {
- EditorSetHeightTool & set_tool = m_noise_tool.set_tool();
+ EditorSetHeightTool & set_tool = noise_tool_.set_tool();
Field::Height h = set_tool.get_interval().min;
assert(h == set_tool.get_interval().max);
@@ -259,7 +259,7 @@
++h;
set_tool.set_interval(Widelands::HeightInterval(h, h));
- m_setto_decrease.set_enabled(true);
- m_setto_increase.set_enabled(h < MAX_FIELD_HEIGHT);
+ setto_decrease_.set_enabled(true);
+ setto_increase_.set_enabled(h < MAX_FIELD_HEIGHT);
update();
}
=== modified file 'src/editor/ui_menus/editor_tool_noise_height_options_menu.h'
--- src/editor/ui_menus/editor_tool_noise_height_options_menu.h 2016-01-16 12:55:14 +0000
+++ src/editor/ui_menus/editor_tool_noise_height_options_menu.h 2016-03-18 12:52:47 +0000
@@ -34,11 +34,11 @@
UI::UniqueWindow::Registry &);
private:
- EditorNoiseHeightTool & m_noise_tool;
- UI::Textarea m_lower_label, m_upper_label;
- UI::Button m_lower_decrease, m_lower_increase, m_upper_decrease, m_upper_increase;
- UI::Textarea m_set_label;
- UI::Button m_setto_decrease, m_setto_increase;
+ EditorNoiseHeightTool& noise_tool_;
+ UI::Textarea lower_label_, upper_label_;
+ UI::Button lower_decrease_, lower_increase_, upper_decrease_, upper_increase_;
+ UI::Textarea set_label_;
+ UI::Button setto_decrease_, setto_increase_;
void clicked_lower_decrease();
void clicked_lower_increase();
=== modified file 'src/editor/ui_menus/editor_tool_options_menu.cc'
--- src/editor/ui_menus/editor_tool_options_menu.cc 2016-01-16 12:55:14 +0000
+++ src/editor/ui_menus/editor_tool_options_menu.cc 2016-03-18 12:52:47 +0000
@@ -27,7 +27,7 @@
:
UI::UniqueWindow
(&parent, "tool_options_menu", ®istry, width, height, title),
- m_current_pointer(parent.tools()->current_pointer)
+ current_pointer_(parent.tools()->current_pointer)
{
if (get_usedefaultpos())
center_to_parent();
@@ -36,5 +36,5 @@
void EditorToolOptionsMenu::select_correct_tool() {
dynamic_cast<EditorInteractive&>(*get_parent())
- .select_tool(*m_current_pointer, EditorTool::First);
+ .select_tool(*current_pointer_, EditorTool::First);
}
=== modified file 'src/editor/ui_menus/editor_tool_options_menu.h'
--- src/editor/ui_menus/editor_tool_options_menu.h 2014-09-10 14:08:25 +0000
+++ src/editor/ui_menus/editor_tool_options_menu.h 2016-03-18 12:52:47 +0000
@@ -27,7 +27,7 @@
EditorToolOptionsMenu
(EditorInteractive & parent,
UI::UniqueWindow::Registry &,
- const uint32_t widht, const uint32_t height,
+ const uint32_t width, const uint32_t height,
char const * title);
/**
@@ -43,7 +43,7 @@
uint32_t vmargin () const {return spacing();}
private:
- EditorTool * m_current_pointer;
+ EditorTool * current_pointer_;
};
#endif // end of include guard: WL_EDITOR_UI_MENUS_EDITOR_TOOL_OPTIONS_MENU_H
=== modified file 'src/editor/ui_menus/editor_tool_place_bob_options_menu.cc'
--- src/editor/ui_menus/editor_tool_place_bob_options_menu.cc 2016-01-29 08:37:22 +0000
+++ src/editor/ui_menus/editor_tool_place_bob_options_menu.cc 2016-03-18 12:52:47 +0000
@@ -44,9 +44,9 @@
:
EditorToolOptionsMenu(parent, registry, 100, 100, _("Animals")),
-m_tabpanel (this, 0, 0, g_gr->images().get("images/ui_basic/but1.png")),
-m_pit (pit),
-m_click_recursion_protect(false)
+tabpanel_ (this, 0, 0, g_gr->images().get("images/ui_basic/but1.png")),
+pit_ (pit),
+click_recursion_protect_(false)
{
int32_t const space = 5;
const Widelands::World & world = parent.egbase().world();
@@ -58,7 +58,7 @@
24U),
12U);
- set_center_panel(&m_tabpanel);
+ set_center_panel(&tabpanel_);
uint32_t width = 0, height = 0;
for (int32_t j = 0; j < nr_bobs; ++j) {
@@ -81,8 +81,8 @@
if (cur_x == bobs_in_row) {
cur_x = 0;
pos = Point(5, 15);
- box = new UI::Box(&m_tabpanel, 0, 0, UI::Box::Horizontal);
- m_tabpanel.add("icons", tab_icon, box);
+ box = new UI::Box(&tabpanel_, 0, 0, UI::Box::Horizontal);
+ tabpanel_.add("icons", tab_icon, box);
}
const Widelands::BobDescr & descr = *world.get_bob_descr(i);
@@ -94,9 +94,9 @@
critter_descr ? critter_descr->descname() : std::string());
cb.set_desired_size(width, height);
- cb.set_state(m_pit.is_enabled(i));
+ cb.set_state(pit_.is_enabled(i));
cb.changedto.connect(boost::bind(&EditorToolPlaceBobOptionsMenu::clicked, this, i, _1));
- m_checkboxes.push_back(&cb);
+ checkboxes_.push_back(&cb);
box->add(&cb, UI::Align::kLeft);
box->add_space(space);
pos.x += width + 1 + space;
@@ -104,7 +104,7 @@
++i;
}
- m_tabpanel.activate(0);
+ tabpanel_.activate(0);
}
@@ -114,7 +114,7 @@
void EditorToolPlaceBobOptionsMenu::clicked
(int32_t const n, bool const t)
{
- if (m_click_recursion_protect)
+ if (click_recursion_protect_)
return;
// TODO(unknown): This code is erroneous. It checks the current key state. What it
@@ -122,23 +122,23 @@
// TODO(unknown): usage comment for get_key_state.
const bool multiselect =
get_key_state(SDL_SCANCODE_LCTRL) | get_key_state(SDL_SCANCODE_RCTRL);
- if (!t && (!multiselect || m_pit.get_nr_enabled() == 1)) {
- m_checkboxes[n]->set_state(true);
+ if (!t && (!multiselect || pit_.get_nr_enabled() == 1)) {
+ checkboxes_[n]->set_state(true);
return;
}
if (!multiselect) {
- for (uint32_t i = 0; m_pit.get_nr_enabled(); ++i) m_pit.enable(i, false);
+ for (uint32_t i = 0; pit_.get_nr_enabled(); ++i) pit_.enable(i, false);
// disable all checkboxes
- m_click_recursion_protect = true;
- for (uint32_t i = 0; i < m_checkboxes.size(); ++i) {
+ click_recursion_protect_ = true;
+ for (uint32_t i = 0; i < checkboxes_.size(); ++i) {
if (i != static_cast<uint32_t>(n))
- m_checkboxes[i]->set_state(false);
+ checkboxes_[i]->set_state(false);
}
- m_click_recursion_protect = false;
+ click_recursion_protect_ = false;
}
- m_pit.enable(n, t);
+ pit_.enable(n, t);
select_correct_tool();
}
=== modified file 'src/editor/ui_menus/editor_tool_place_bob_options_menu.h'
--- src/editor/ui_menus/editor_tool_place_bob_options_menu.h 2014-09-10 14:48:40 +0000
+++ src/editor/ui_menus/editor_tool_place_bob_options_menu.h 2016-03-18 12:52:47 +0000
@@ -35,11 +35,12 @@
UI::UniqueWindow::Registry &);
private:
- UI::TabPanel m_tabpanel;
- std::vector<UI::Checkbox *> m_checkboxes;
- EditorPlaceBobTool & m_pit;
void clicked(int32_t, bool);
- bool m_click_recursion_protect;
+
+ UI::TabPanel tabpanel_;
+ std::vector<UI::Checkbox*> checkboxes_;
+ EditorPlaceBobTool& pit_;
+ bool click_recursion_protect_;
};
#endif // end of include guard: WL_EDITOR_UI_MENUS_EDITOR_TOOL_PLACE_BOB_OPTIONS_MENU_H
=== modified file 'src/editor/ui_menus/editor_toolsize_menu.cc'
--- src/editor/ui_menus/editor_toolsize_menu.cc 2016-01-29 08:37:22 +0000
+++ src/editor/ui_menus/editor_toolsize_menu.cc 2016-03-18 12:52:47 +0000
@@ -41,15 +41,15 @@
:
UI::UniqueWindow
(&parent, "toolsize_menu", ®istry, 250, 50, _("Tool Size")),
- m_textarea(this, 5, 10, 240, 10, std::string(), UI::Align::kBottomCenter),
- m_increase
+ textarea_(this, 5, 10, 240, 10, std::string(), UI::Align::kBottomCenter),
+ increase_
(this, "incr",
get_inner_w() / 2 - 10, 25, 20, 20,
g_gr->images().get("images/ui_basic/but0.png"),
g_gr->images().get("images/ui_basic/scrollbar_up.png"),
std::string(),
parent.get_sel_radius() < MAX_TOOL_AREA),
- m_decrease
+ decrease_
(this, "decr",
get_inner_w() / 2 + 10, 25, 20, 20,
g_gr->images().get("images/ui_basic/but0.png"),
@@ -58,11 +58,11 @@
0 < parent.get_sel_radius()),
value_(0)
{
- m_increase.sigclicked.connect(boost::bind(&EditorToolsizeMenu::increase_radius, boost::ref(*this)));
- m_decrease.sigclicked.connect(boost::bind(&EditorToolsizeMenu::decrease_radius, boost::ref(*this)));
+ increase_.sigclicked.connect(boost::bind(&EditorToolsizeMenu::increase_radius, boost::ref(*this)));
+ decrease_.sigclicked.connect(boost::bind(&EditorToolsizeMenu::decrease_radius, boost::ref(*this)));
- m_increase.set_repeating(true);
- m_decrease.set_repeating(true);
+ increase_.set_repeating(true);
+ decrease_.set_repeating(true);
update(parent.get_sel_radius());
if (eia().tools()->current().has_size_one()) {
@@ -78,12 +78,12 @@
value_ = val;
eia().set_sel_radius(val);
set_buttons_enabled(true);
- m_textarea.set_text((boost::format(_("Current Size: %u")) % (val + 1)).str());
+ textarea_.set_text((boost::format(_("Current Size: %u")) % (val + 1)).str());
}
void EditorToolsizeMenu::set_buttons_enabled(bool enable) {
- m_decrease.set_enabled(enable && 0 < value_);
- m_increase.set_enabled(enable && value_ < MAX_TOOL_AREA);
+ decrease_.set_enabled(enable && 0 < value_);
+ increase_.set_enabled(enable && value_ < MAX_TOOL_AREA);
}
=== modified file 'src/editor/ui_menus/editor_toolsize_menu.h'
--- src/editor/ui_menus/editor_toolsize_menu.h 2016-01-16 12:55:14 +0000
+++ src/editor/ui_menus/editor_toolsize_menu.h 2016-03-18 12:52:47 +0000
@@ -40,8 +40,8 @@
void decrease_radius();
void increase_radius();
- UI::Textarea m_textarea;
- UI::Button m_increase, m_decrease;
+ UI::Textarea textarea_;
+ UI::Button increase_, decrease_;
uint32_t value_;
};
Follow ups