From 0ff90b93261aac8897175dd5e2e4fc97ad33adbb Mon Sep 17 00:00:00 2001 From: fendrin Date: Mon, 20 May 2013 11:16:29 +0200 Subject: [PATCH] Enable the "Save all maps" feature. --- data/themes/editor.cfg | 2 +- src/editor/editor_controller.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/data/themes/editor.cfg b/data/themes/editor.cfg index 8b5ecb9717b..7a2c5d1548d 100644 --- a/data/themes/editor.cfg +++ b/data/themes/editor.cfg @@ -65,7 +65,7 @@ #image=lite_small #image=lite font_size=9 - items=statustable,unitlist,editor-map-new,editor-map-load,editor-map-revert,editor-map-save,editor-map-save-as,preferences,editor-settings,help,editor-close-map,quit-editor,editor-quit-to-desktop + items=statustable,unitlist,editor-map-new,editor-map-load,editor-map-revert,editor-map-save,editor-map-save-as,editor-map-save-all,preferences,editor-settings,help,editor-close-map,quit-editor,editor-quit-to-desktop ref=top-panel rect="=+1,=+1,+100,+20" #rect="=+3,=+1,+55,=-4" diff --git a/src/editor/editor_controller.cpp b/src/editor/editor_controller.cpp index 08c85364422..8c6cb18b0df 100644 --- a/src/editor/editor_controller.cpp +++ b/src/editor/editor_controller.cpp @@ -339,7 +339,10 @@ bool editor_controller::can_execute_command(hotkey::HOTKEY_COMMAND command, int case HOTKEY_EDITOR_MAP_SAVE: return context_manager_->get_map_context().modified(); case HOTKEY_EDITOR_MAP_SAVE_ALL: - //TODO + { + std::string dummy; + return context_manager_->modified_maps(dummy) > 1; + } case HOTKEY_EDITOR_SWITCH_MAP: case HOTKEY_EDITOR_SWITCH_AREA: case HOTKEY_EDITOR_CLOSE_MAP: @@ -548,6 +551,7 @@ bool editor_controller::execute_command(hotkey::HOTKEY_COMMAND command, int inde } case TIME: { + //TODO mark the map as changed tod_manager* tod = context_manager_->get_map_context().get_time_manager(); tod->set_turn(index +1, true); tod_color col = tod->times()[index].color; @@ -556,6 +560,7 @@ bool editor_controller::execute_command(hotkey::HOTKEY_COMMAND command, int inde } case MUSIC: { + //TODO mark the map as changed sound::play_music_once(music_tracks_[index].id()); context_manager_->get_map_context().add_to_playlist(music_tracks_[index]); std::vector items; @@ -566,6 +571,7 @@ bool editor_controller::execute_command(hotkey::HOTKEY_COMMAND command, int inde } case SCHEDULE: { + //TODO mark the map as changed tod_manager* tod = context_manager_->get_map_context().get_time_manager(); tods_map::iterator iter = tods_.begin(); std::advance(iter, index);