Added end turn confirmation when units can still move...
...as a preference file option. Patch #2460.
This commit is contained in:
parent
4c945380e8
commit
feba410008
3 changed files with 24 additions and 0 deletions
|
@ -784,6 +784,23 @@ void turn_info::end_turn()
|
|||
if(browse_)
|
||||
return;
|
||||
|
||||
// Ask for confirmation if units still have movement left
|
||||
if(preferences::confirm_end_turn()) {
|
||||
for(unit_map::const_iterator un = units_.begin(); un != units_.end(); ++un) {
|
||||
if(un->second.side() == team_num_ &&
|
||||
unit_can_move(un->first,units_,map_,teams_)) {
|
||||
const int res = gui::show_dialog(gui_,NULL,"",
|
||||
string_table["end_turn_message"],
|
||||
gui::YES_NO);
|
||||
if (res != 0) {
|
||||
return;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end_turn_ = true;
|
||||
|
||||
//auto-save
|
||||
|
|
|
@ -814,4 +814,9 @@ void show_hotkeys_dialog (display & disp)
|
|||
|
||||
}
|
||||
|
||||
bool confirm_end_turn()
|
||||
{
|
||||
return prefs["confirm_end_turn"] == "yes";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -88,6 +88,8 @@ namespace preferences {
|
|||
void show_preferences_dialog(display& disp);
|
||||
bool show_video_mode_dialog(display& disp);
|
||||
void show_hotkeys_dialog (display & disp);
|
||||
|
||||
bool confirm_end_turn();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue