Implement modify_side.color attribute...

...to change a side's team color range (bug #18772)
This commit is contained in:
Ignacio R. Morelle 2012-02-07 18:00:52 +00:00
parent 6c0ce92b2b
commit aaf97a7319
3 changed files with 10 additions and 0 deletions

View File

@ -35,6 +35,8 @@ Version 1.11.0-svn:
* Made it possible to disable the credits screen at the end of a campaign
by specifying end_credits=no in the final [endlevel] action, or in the
[campaign] definition (defaults to yes)
* Added [modify_side] color= attribute, which changes a side's team color
range (feature/bug #18772)
* Removed support for the deprecated [removeitem]
* Unit changes and balancing:
* New extra_define ENABLE_WOLF_ADVANCEMENT to optionally enable Wolves

View File

@ -1025,6 +1025,13 @@ WML_HANDLER_FUNCTION(modify_side, /*event_info*/, cfg)
if (ai.first != ai.second) {
ai::manager::modify_active_ai_config_old_for_side(side_num,ai);
}
// Change team color
config::attribute_value color = cfg["color"];
if(!color.empty()) {
teams[team_index].set_color(color);
resources::screen->recalculate_minimap();
resources::screen->invalidate_all();
}
// Add shared view to current team
config::attribute_value share_view = cfg["share_view"];
if (!share_view.empty()){

View File

@ -200,6 +200,7 @@ public:
team_info::CONTROLLER controller() const { return info_.controller; }
char const *controller_string() const { return info_.controller_string(); }
const std::string& color() const { return info_.color; }
void set_color(const std::string& color) { info_.color = color; }
bool is_human() const { return info_.controller == team_info::HUMAN; }
bool is_human_ai() const { return info_.controller == team_info::HUMAN_AI; }
bool is_network_human() const { return info_.controller == team_info::NETWORK; }