Author: ilor
Date: Thu Jul 10 16:35:47 2008
New Revision: 27892
URL: http://svn.gna.org/viewcvs/wesnoth?rev=27892&view=rev
Log:
Allow some hotkeys in editor2 (testing mostly)
Modified:
trunk/src/editor2/editor_controller.cpp
trunk/src/editor2/editor_controller.hpp
Modified: trunk/src/editor2/editor_controller.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_controller.cpp?rev=27892&r1=27891&r2=27892&view=diff
==============================================================================
--- trunk/src/editor2/editor_controller.cpp (original)
+++ trunk/src/editor2/editor_controller.cpp Thu Jul 10 16:35:47 2008
@@ -67,9 +67,31 @@
}
}
-bool editor_controller::can_execute_command(hotkey::HOTKEY_COMMAND, int
/*index*/) const
-{
- return false;
+bool editor_controller::can_execute_command(hotkey::HOTKEY_COMMAND command,
int /*index*/) const
+{
+ switch(command) {
+ case hotkey::HOTKEY_ZOOM_IN:
+ case hotkey::HOTKEY_ZOOM_OUT:
+ case hotkey::HOTKEY_ZOOM_DEFAULT:
+ case hotkey::HOTKEY_FULLSCREEN:
+ case hotkey::HOTKEY_SCREENSHOT:
+ case hotkey::HOTKEY_MAP_SCREENSHOT:
+ case hotkey::HOTKEY_TOGGLE_GRID:
+ case hotkey::HOTKEY_MOUSE_SCROLL:
+ case hotkey::HOTKEY_MUTE:
+ case hotkey::HOTKEY_PREFERENCES:
+ case hotkey::HOTKEY_QUIT_GAME:
+ case hotkey::HOTKEY_HELP:
+ return true;
+ default:
+ return false;
+ }
+}
+
+void editor_controller::preferences()
+{
+ preferences::show_preferences_dialog(*gui_, game_config_);
+ gui_->redraw_everything();
}
events::mouse_handler_base& editor_controller::get_mouse_handler_base()
Modified: trunk/src/editor2/editor_controller.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_controller.hpp?rev=27892&r1=27891&r2=27892&view=diff
==============================================================================
--- trunk/src/editor2/editor_controller.hpp (original)
+++ trunk/src/editor2/editor_controller.hpp Thu Jul 10 16:35:47 2008
@@ -43,6 +43,7 @@
~editor_controller();
void main_loop();
bool can_execute_command(hotkey::HOTKEY_COMMAND, int index =
-1) const;
+ void preferences();
/* mouse_handler_base */
void mouse_motion(int x, int y, const bool browse, bool update);
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits