Author: ilor
Date: Wed Aug 13 00:22:51 2008
New Revision: 28522
URL: http://svn.gna.org/viewcvs/wesnoth?rev=28522&view=rev
Log:
editor2: fill seelction feature
Modified:
trunk/data/themes/editor2.cfg
trunk/src/editor2/editor_controller.cpp
trunk/src/editor2/editor_controller.hpp
trunk/src/hotkeys.cpp
trunk/src/hotkeys.hpp
Modified: trunk/data/themes/editor2.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/themes/editor2.cfg?rev=28522&r1=28521&r2=28522&view=diff
==============================================================================
--- trunk/data/themes/editor2.cfg (original)
+++ trunk/data/themes/editor2.cfg Wed Aug 13 00:22:51 2008
@@ -130,7 +130,7 @@
id=menu-editor-edit
title= _ "Edit"
image=lite
-
items=undo,redo,editor-cut,editor-copy,editor-paste,editor-select-all,editor-select-inverse,editor-selection-rotate,editor-selection-flip,editor-selection-generate,editor-selection-randomize
+
items=undo,redo,editor-cut,editor-copy,editor-paste,editor-select-all,editor-select-inverse,editor-selection-fill,editor-selection-rotate,editor-selection-flip,editor-selection-generate,editor-selection-randomize
rect="+2,=,+100,="
xanchor=fixed
yanchor=fixed
@@ -159,7 +159,7 @@
[menu]
id=menu-editor-selection
is_context_menu=true
-
items=menu-editor-starting-position,undo,redo,editor-cut,editor-copy,editor-paste,editor-selection-rotate,editor-selection-flip,editor-selection-generate,editor-selection-randomize
+
items=menu-editor-starting-position,undo,redo,editor-cut,editor-copy,editor-paste,editor-selection-fill,editor-selection-rotate,editor-selection-flip,editor-selection-generate,editor-selection-randomize
[/menu]
[mini_map]
Modified: trunk/src/editor2/editor_controller.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_controller.cpp?rev=28522&r1=28521&r2=28522&view=diff
==============================================================================
--- trunk/src/editor2/editor_controller.cpp (original)
+++ trunk/src/editor2/editor_controller.cpp Wed Aug 13 00:22:51 2008
@@ -448,6 +448,7 @@
case HOTKEY_EDITOR_COPY:
case HOTKEY_EDITOR_SELECTION_ROTATE:
case HOTKEY_EDITOR_SELECTION_FLIP:
+ case HOTKEY_EDITOR_SELECTION_FILL:
case HOTKEY_EDITOR_SELECTION_GENERATE:
case HOTKEY_EDITOR_SELECTION_RANDOMIZE:
return !get_map().selection().empty();
@@ -525,6 +526,9 @@
case HOTKEY_EDITOR_SELECT_INVERSE:
perform_refresh(editor_action_select_inverse());
return true;
+ case HOTKEY_EDITOR_SELECTION_FILL:
+ fill_selection();
+ return true;
case HOTKEY_EDITOR_MAP_FLIP_X:
perform_refresh(editor_action_flip_x());
return true;
@@ -669,6 +673,13 @@
editor_action_paint_area a(get_map().selection(), background_terrain_);
perform_refresh(a);
}
+
+void editor_controller::fill_selection()
+{
+ editor_action_paint_area a(get_map().selection(), foreground_terrain_);
+ perform_refresh(a);
+}
+
void editor_controller::hotkey_set_mouse_action(hotkey::HOTKEY_COMMAND command)
{
Modified: trunk/src/editor2/editor_controller.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_controller.hpp?rev=28522&r1=28521&r2=28522&view=diff
==============================================================================
--- trunk/src/editor2/editor_controller.hpp (original)
+++ trunk/src/editor2/editor_controller.hpp Wed Aug 13 00:22:51 2008
@@ -92,6 +92,7 @@
void toggle_grid();
void copy_selection();
void cut_selection();
+ void fill_selection();
void hotkey_set_mouse_action(hotkey::HOTKEY_COMMAND command);
bool is_mouse_action_set(hotkey::HOTKEY_COMMAND command) const;
Modified: trunk/src/hotkeys.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/hotkeys.cpp?rev=28522&r1=28521&r2=28522&view=diff
==============================================================================
--- trunk/src/hotkeys.cpp (original)
+++ trunk/src/hotkeys.cpp Wed Aug 13 00:22:51 2008
@@ -153,11 +153,15 @@
{ hotkey::HOTKEY_EDITOR_SELECT_ALL, "editor-select-all",
N_("Select All"), false, hotkey::SCOPE_EDITOR },
{ hotkey::HOTKEY_EDITOR_SELECT_INVERSE, "editor-select-inverse",
- N_("Invert Selection"), false, hotkey::SCOPE_EDITOR },
+ N_("Select Inverse"), false, hotkey::SCOPE_EDITOR },
+ { hotkey::HOTKEY_EDITOR_SELECT_NONE, "editor-select-none",
+ N_("Select None"), false, hotkey::SCOPE_EDITOR },
{ hotkey::HOTKEY_EDITOR_SELECTION_ROTATE, "editor-selection-rotate",
N_("Rotate Selection"), false, hotkey::SCOPE_EDITOR },
{ hotkey::HOTKEY_EDITOR_SELECTION_FLIP, "editor-selection-flip",
N_("Flip Selection"), false, hotkey::SCOPE_EDITOR },
+ { hotkey::HOTKEY_EDITOR_SELECTION_FILL, "editor-selection-fill",
+ N_("Fill Selection"), false, hotkey::SCOPE_EDITOR },
{ hotkey::HOTKEY_EDITOR_SELECTION_GENERATE,
"editor-selection-generate",
N_("Generate Tiles In Selection"), false, hotkey::SCOPE_EDITOR
},
{ hotkey::HOTKEY_EDITOR_SELECTION_RANDOMIZE,
"editor-selection-randomize",
Modified: trunk/src/hotkeys.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/hotkeys.hpp?rev=28522&r1=28521&r2=28522&view=diff
==============================================================================
--- trunk/src/hotkeys.hpp (original)
+++ trunk/src/hotkeys.hpp Wed Aug 13 00:22:51 2008
@@ -80,7 +80,9 @@
HOTKEY_EDITOR_BRUSH_NEXT, HOTKEY_EDITOR_BRUSH_DEFAULT,
HOTKEY_EDITOR_CUT, HOTKEY_EDITOR_COPY, HOTKEY_EDITOR_PASTE,
HOTKEY_EDITOR_SELECT_ALL, HOTKEY_EDITOR_SELECT_INVERSE,
+ HOTKEY_EDITOR_SELECT_NONE,
HOTKEY_EDITOR_SELECTION_ROTATE, HOTKEY_EDITOR_SELECTION_FLIP,
+ HOTKEY_EDITOR_SELECTION_FILL,
HOTKEY_EDITOR_SELECTION_GENERATE, HOTKEY_EDITOR_SELECTION_RANDOMIZE,
HOTKEY_EDITOR_MAP_RESIZE, HOTKEY_EDITOR_MAP_ROTATE,
HOTKEY_EDITOR_MAP_FLIP_X, HOTKEY_EDITOR_MAP_FLIP_Y,
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits