Author: ilor
Date: Sun Oct 12 19:20:06 2008
New Revision: 30096

URL: http://svn.gna.org/viewcvs/wesnoth?rev=30096&view=rev
Log:
Allow painting fog and shroud terrains in the editor, as it should be useful 
for making masks

Added:
    trunk/data/core/images/terrain/fog-editor.png   (with props)
    trunk/data/core/images/terrain/shroud-editor.png   (with props)
Modified:
    trunk/data/core/editor-groups.cfg
    trunk/data/core/terrain.cfg
    trunk/src/editor2/editor_palettes.cpp

Modified: trunk/data/core/editor-groups.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/editor-groups.cfg?rev=30096&r1=30095&r2=30096&view=diff
==============================================================================
--- trunk/data/core/editor-groups.cfg (original)
+++ trunk/data/core/editor-groups.cfg Sun Oct 12 19:20:06 2008
@@ -71,3 +71,9 @@
     name= _ "castle"
     icon="group_castle"
 [/editor_group]
+
+[editor_group]
+    id=special
+    name= _ "special"
+    icon="group_x"
+[/editor_group]

Added: trunk/data/core/images/terrain/fog-editor.png
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/images/terrain/fog-editor.png?rev=30096&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/data/core/images/terrain/fog-editor.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/data/core/images/terrain/shroud-editor.png
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/images/terrain/shroud-editor.png?rev=30096&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/data/core/images/terrain/shroud-editor.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: trunk/data/core/terrain.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/terrain.cfg?rev=30096&r1=30095&r2=30096&view=diff
==============================================================================
--- trunk/data/core/terrain.cfg (original)
+++ trunk/data/core/terrain.cfg Sun Oct 12 19:20:06 2008
@@ -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]
 
 #

Modified: trunk/src/editor2/editor_palettes.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_palettes.cpp?rev=30096&r1=30095&r2=30096&view=diff
==============================================================================
--- trunk/src/editor2/editor_palettes.cpp (original)
+++ trunk/src/editor2/editor_palettes.cpp Sun Oct 12 19:20:06 2008
@@ -72,11 +72,21 @@
        , 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");


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to