mail[Wesnoth-commits] r13652 - in /branches/1.2/src: play_controller.cpp replay_controller.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by queen . killer on September 24, 2006 - 21:43:
Author: queenkiller
Date: Sun Sep 24 21:42:57 2006
New Revision: 13652

URL: http://svn.gna.org/viewcvs/wesnoth?rev=13652&view=rev
Log:
add cancel button to dialog about corrupted file during playing

Modified:
    branches/1.2/src/play_controller.cpp
    branches/1.2/src/replay_controller.cpp

Modified: branches/1.2/src/play_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.2/src/play_controller.cpp?rev=13652&r1=13651&r2=13652&view=diff
==============================================================================
--- branches/1.2/src/play_controller.cpp (original)
+++ branches/1.2/src/play_controller.cpp Sun Sep 24 21:42:57 2006
@@ -372,7 +372,9 @@
                        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;
                }

Modified: branches/1.2/src/replay_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.2/src/replay_controller.cpp?rev=13652&r1=13651&r2=13652&view=diff
==============================================================================
--- branches/1.2/src/replay_controller.cpp (original)
+++ branches/1.2/src/replay_controller.cpp Sun Sep 24 21:42:57 2006
@@ -217,8 +217,14 @@
                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;
        }




Related Messages


Powered by MHonArc, Updated Sun Sep 24 22:20:09 2006