add cancel button to dialog about corrupted file during playing

This commit is contained in:
Josef Redinger 2006-09-24 19:42:57 +00:00
parent 83d6e2eb34
commit 22bd287b5f
2 changed files with 9 additions and 1 deletions

View File

@ -372,7 +372,9 @@ bool play_controller::do_replay(const bool replaying){
result = ::do_replay(*gui_,map_,gameinfo_,units_,teams_,
player_number_,status_,gamestate_);
} catch(replay::error&) {
gui::show_dialog(*gui_,NULL,"",_("The file you have tried to load is corrupt"),gui::OK_ONLY);
//in next version after string freeze add to text ". continue playing?"
if(gui::show_dialog(*gui_,NULL,"",_("The file you have tried to load is corrupt"),gui::OK_CANCEL))
throw;
result = false;
}

View File

@ -217,8 +217,14 @@ void replay_controller::play_replay(){
LOG_NG << "starting main loop\n" << (SDL_GetTicks() - ticks_) << "\n";
for(; !recorder.at_end() && is_playing_; first_player_ = 1
) {
try{
play_turn();
play_slice();
}
catch (replay::error&) //when user due to error want stop playing
{
is_playing_ = false;
}
} //end for loop
is_playing_ = false;
}