mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-09 18:54:13 +00:00
add cancel button to dialog about corrupted file during playing
This commit is contained in:
parent
83d6e2eb34
commit
22bd287b5f
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user