Allow painting fog and shroud terrains in the editor,

...as it should be useful for making masks
This commit is contained in:
Tomasz Śniatowski 2008-10-12 18:20:06 +01:00
parent 64d8844c0d
commit 7b57f7dd85
5 changed files with 25 additions and 4 deletions

View file

@ -71,3 +71,9 @@
name= _ "castle"
icon="group_castle"
[/editor_group]
[editor_group]
id=special
name= _ "special"
icon="group_x"
[/editor_group]

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -12,20 +12,25 @@
id=off_map
name= _ "None"
string=_off^_usr # wmllint: ignore
editor_group=special
[/terrain]
[terrain]
symbol_image=void
editor_image=shroud-editor
id=shroud
name= _ "Shroud"
string=_s # wmllint: ignore
editor_group=special
[/terrain]
[terrain]
symbol_image=fog
editor_image=fog-editor
id=fog
name= _ "Fog"
string=_f # wmllint: ignore
editor_group=special
[/terrain]
#
@ -1091,7 +1096,7 @@
name= _ "Void"
string=Xv
aliasof=Xt
editor_group=flat,wall
editor_group=flat,wall,special
[/terrain]
#

View file

@ -72,11 +72,21 @@ terrain_palette::terrain_palette(display &gui, const size_specs &sizes,
, selected_fg_terrain_(fore)
, selected_bg_terrain_(back)
{
// Get the available terrains temporary in terrains_
terrains_ = map_.get_terrain_list();
terrains_.erase(std::remove_if(terrains_.begin(), terrains_.end(), is_invalid_terrain),
terrains_.end());
//move "invalid" terrains to the end
size_t size = terrains_.size();
for (size_t i = 0; i < size; ++i) {
std::cerr << "C" << terrains_[i] << map_.get_terrain_string(terrains_[i]);
if (is_invalid_terrain(terrains_[i])) {
std::cerr << "Invalid" << map_.get_terrain_string(terrains_[i]);
terrains_.push_back(terrains_[i]);
terrains_.erase(terrains_.begin() + i);
size--;
i--;
}
}
// Get the available groups and add them to the structure
const config::child_list& groups = cfg.get_children("editor_group");