Author: ilor
Date: Sun Aug 17 15:17:19 2008
New Revision: 28674
URL: http://svn.gna.org/viewcvs/wesnoth?rev=28674&view=rev
Log:
editor2 hotkey tweaks
Modified:
trunk/data/themes/editor2.cfg
trunk/src/editor2/action.cpp
trunk/src/editor2/action.hpp
trunk/src/editor2/editor_controller.cpp
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=28674&r1=28673&r2=28674&view=diff
==============================================================================
--- trunk/data/themes/editor2.cfg (original)
+++ trunk/data/themes/editor2.cfg Sun Aug 17 15:17:19 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-fill,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-select-none,editor-selection-fill,editor-selection-rotate,editor-selection-flip,editor-selection-generate,editor-selection-randomize
rect="+2,=,+100,="
xanchor=fixed
yanchor=fixed
Modified: trunk/src/editor2/action.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/action.cpp?rev=28674&r1=28673&r2=28674&view=diff
==============================================================================
--- trunk/src/editor2/action.cpp (original)
+++ trunk/src/editor2/action.cpp Sun Aug 17 15:17:19 2008
@@ -248,6 +248,21 @@
mc.set_everything_changed();
}
+editor_action_select_xor* editor_action_select_none::perform(map_context& mc)
const
+{
+
+ std::set<gamemap::location> current = mc.get_map().selection();
+ mc.get_map().clear_selection();
+ mc.set_everything_changed();
+ return new editor_action_select_xor(current);
+}
+void editor_action_select_none::perform_without_undo(map_context& mc) const
+{
+ mc.get_map().clear_selection();
+ mc.set_everything_changed();
+}
+
+
editor_action_select_inverse*
editor_action_select_inverse::perform(map_context& mc) const
{
perform_without_undo(mc);
Modified: trunk/src/editor2/action.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/action.hpp?rev=28674&r1=28673&r2=28674&view=diff
==============================================================================
--- trunk/src/editor2/action.hpp (original)
+++ trunk/src/editor2/action.hpp Sun Aug 17 15:17:19 2008
@@ -251,6 +251,19 @@
};
/**
+ * Clear selection
+ */
+class editor_action_select_none : public editor_action
+{
+ public:
+ editor_action_select_none()
+ {
+ }
+ editor_action_select_xor* perform(map_context& mc) const;
+ void perform_without_undo(map_context& mc) const;
+};
+
+/**
* Invert the selection
*/
class editor_action_select_inverse : public editor_action
Modified: trunk/src/editor2/editor_controller.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_controller.cpp?rev=28674&r1=28673&r2=28674&view=diff
==============================================================================
--- trunk/src/editor2/editor_controller.cpp (original)
+++ trunk/src/editor2/editor_controller.cpp Sun Aug 17 15:17:19 2008
@@ -101,7 +101,7 @@
}
}
hotkey_set_mouse_action(hotkey::HOTKEY_EDITOR_TOOL_PAINT);
-
+ hotkey::get_hotkey(hotkey::HOTKEY_QUIT_GAME).set_description(_("Quit
Editor"));
background_terrain_ = t_translation::GRASS_LAND;
foreground_terrain_ = t_translation::MOUNTAIN;
set_mouseover_overlay();
@@ -459,17 +459,18 @@
return true; //tool selection always possible
case HOTKEY_EDITOR_CUT:
case HOTKEY_EDITOR_COPY:
- case HOTKEY_EDITOR_SELECTION_ROTATE:
- case HOTKEY_EDITOR_SELECTION_FLIP:
case HOTKEY_EDITOR_SELECTION_FILL:
case HOTKEY_EDITOR_SELECTION_RANDOMIZE:
return !get_map().selection().empty();
+ case HOTKEY_EDITOR_SELECTION_ROTATE:
+ case HOTKEY_EDITOR_SELECTION_FLIP:
case HOTKEY_EDITOR_SELECTION_GENERATE:
return false; //not implemented
case HOTKEY_EDITOR_PASTE:
return !clipboard_.empty();
case HOTKEY_EDITOR_SELECT_ALL:
case HOTKEY_EDITOR_SELECT_INVERSE:
+ case HOTKEY_EDITOR_SELECT_NONE:
case HOTKEY_EDITOR_MAP_RESIZE:
case HOTKEY_EDITOR_MAP_FLIP_X:
case HOTKEY_EDITOR_MAP_FLIP_Y:
@@ -514,6 +515,7 @@
return true;
case HOTKEY_EDITOR_TERRAIN_PALETTE_SWAP:
palette_->swap();
+ if (get_mouse_action()->uses_terrains())
set_mouseover_overlay();
return true;
case HOTKEY_EDITOR_TOOL_PAINT:
case HOTKEY_EDITOR_TOOL_FILL:
@@ -541,6 +543,8 @@
case HOTKEY_EDITOR_SELECT_INVERSE:
perform_refresh(editor_action_select_inverse());
return true;
+ case HOTKEY_EDITOR_SELECT_NONE:
+ perform_refresh(editor_action_select_none());
case HOTKEY_EDITOR_SELECTION_FILL:
fill_selection();
return true;
Modified: trunk/src/hotkeys.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/hotkeys.cpp?rev=28674&r1=28673&r2=28674&view=diff
==============================================================================
--- trunk/src/hotkeys.cpp (original)
+++ trunk/src/hotkeys.cpp Sun Aug 17 15:17:19 2008
@@ -137,6 +137,7 @@
{ hotkey::HOTKEY_EDITOR_MAP_SAVE, "editor-map-save", N_("Save Map"),
false, hotkey::SCOPE_EDITOR },
{ hotkey::HOTKEY_EDITOR_MAP_SAVE_AS, "editor-map-save-as", N_("Save Map
As"), false, hotkey::SCOPE_EDITOR },
{ hotkey::HOTKEY_EDITOR_MAP_REVERT, "editor-map-revert", N_("Revert All
Changes"), false, hotkey::SCOPE_EDITOR },
+ { hotkey::HOTKEY_EDITOR_MAP_INFO, "editor-map-info", N_("Map
Information"), false, hotkey::SCOPE_EDITOR },
{ hotkey::HOTKEY_EDITOR_TERRAIN_PALETTE_SWAP,
"editor-terrain-palette-swap",
N_("Swap fore- and background terrains"), false,
hotkey::SCOPE_EDITOR },
{ hotkey::HOTKEY_EDITOR_TOOL_NEXT, "editor-tool-next", N_("Next Tool"),
false, hotkey::SCOPE_EDITOR },
Modified: trunk/src/hotkeys.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/hotkeys.hpp?rev=28674&r1=28673&r2=28674&view=diff
==============================================================================
--- trunk/src/hotkeys.hpp (original)
+++ trunk/src/hotkeys.hpp Sun Aug 17 15:17:19 2008
@@ -73,7 +73,7 @@
#ifdef USE_EDITOR2
HOTKEY_EDITOR_QUIT_TO_DESKTOP,
HOTKEY_EDITOR_MAP_NEW, HOTKEY_EDITOR_MAP_LOAD, HOTKEY_EDITOR_MAP_SAVE,
- HOTKEY_EDITOR_MAP_SAVE_AS, HOTKEY_EDITOR_MAP_REVERT,
+ HOTKEY_EDITOR_MAP_SAVE_AS, HOTKEY_EDITOR_MAP_REVERT,
HOTKEY_EDITOR_MAP_INFO,
HOTKEY_EDITOR_TERRAIN_PALETTE_SWAP,
HOTKEY_EDITOR_TOOL_NEXT, HOTKEY_EDITOR_TOOL_PAINT,
HOTKEY_EDITOR_TOOL_FILL,
HOTKEY_EDITOR_TOOL_SELECT, HOTKEY_EDITOR_TOOL_STARTING_POSITION,
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits