Added new end_turn_confirm option: green|yellow|no
This commit is contained in:
parent
c2bf2916c2
commit
ac7df416c0
3 changed files with 30 additions and 4 deletions
|
@ -785,7 +785,7 @@ void turn_info::end_turn()
|
|||
return;
|
||||
|
||||
// Ask for confirmation if units still have movement left
|
||||
if(preferences::confirm_end_turn()) {
|
||||
if(preferences::yellow_confirm()) {
|
||||
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_)) {
|
||||
|
@ -799,6 +799,21 @@ void turn_info::end_turn()
|
|||
}
|
||||
}
|
||||
}
|
||||
} else if (preferences::green_confirm()) {
|
||||
for(unit_map::const_iterator un = units_.begin(); un != units_.end(); ++un) {
|
||||
if(un->second.side() == team_num_ &&
|
||||
un->second.movement_left() == un->second.total_movement() &&
|
||||
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;
|
||||
|
|
|
@ -814,9 +814,18 @@ void show_hotkeys_dialog (display & disp)
|
|||
|
||||
}
|
||||
|
||||
bool confirm_end_turn()
|
||||
bool green_confirm()
|
||||
{
|
||||
return prefs["confirm_end_turn"] == "yes";
|
||||
std::string confirmation = prefs["confirm_end_turn"];
|
||||
|
||||
if (confirmation == "green" || confirmation == "yes")
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool yellow_confirm()
|
||||
{
|
||||
return prefs["confirm_end_turn"] == "yellow";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -89,7 +89,9 @@ namespace preferences {
|
|||
bool show_video_mode_dialog(display& disp);
|
||||
void show_hotkeys_dialog (display & disp);
|
||||
|
||||
bool confirm_end_turn();
|
||||
// Ask for end turn confirmation
|
||||
bool yellow_confirm();
|
||||
bool green_confirm();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue