Game controller: process [color_range] and [color_palette] at the WML root

This allows add-ons to use these nodes at top-levels to define custom
ranges and palettes for the game engine. I'm not sure yet whether this
is the most elegant way to do this -- might consider filtering
[game_config] before 1.9.5.
This commit is contained in:
Ignacio R. Morelle 2011-01-25 00:45:00 +00:00
parent 1c9c2bdd49
commit 8dd4bffd7c
2 changed files with 9 additions and 0 deletions

View file

@ -2,6 +2,9 @@ Version 1.9.4+svn:
* Language and i18n:
* Updated translations: British English, Dutch, Finnish, French, Galician,
Italian, Japanese, Portuguese (Brazil), Spanish, Vietnamese
* WML engine:
* Allow [color_range] and [color_palette] nodes to be inserted at top-level
by add-ons to globally define custom ranges and palettes.
* Miscellaneous and bugfixes:
* Fixed: g++ compiler warnings.

View file

@ -1588,6 +1588,10 @@ void game_controller::load_game_cfg(const bool force)
extract_preload_scripts(game_config_);
game_config_.clear_children("lua");
config colorsys_info;
colorsys_info.splice_children(game_config_, "color_range");
colorsys_info.splice_children(game_config_, "color_palette");
game_config_.merge_children("units");
game_config_.splice_children(core_terrain_rules, "terrain_graphics");
@ -1596,6 +1600,8 @@ void game_controller::load_game_cfg(const bool force)
hashes[ch["id"]] = ch.hash();
}
game_config::add_color_info(colorsys_info);
set_unit_data();
terrain_builder::set_terrain_rules_cfg(game_config());