Enable the "Save all maps" feature.

This commit is contained in:
fendrin 2013-05-20 11:16:29 +02:00
parent 85ed997f5f
commit 0ff90b9326
2 changed files with 8 additions and 2 deletions

View file

@ -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"

View file

@ -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<std::string> 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);