Code simplification suggested by Sapient.

This commit is contained in:
Eric S. Raymond 2007-06-08 17:56:12 +00:00
parent 88300e148b
commit 100c9bbefb
2 changed files with 3 additions and 10 deletions

View file

@ -477,13 +477,10 @@ namespace events{
try {
recorder.save_game(label, snapshot, gamestate_.starting_pos);
if(dialog_type != gui::NULL_DIALOG) {
dialogs::message_dialog to_show(*gui_,_("Saved"),_("The game has been saved"));
to_show.layout();
to_show.show_min_duration(dialogs::three_blinks);
dialogs::message_dialog(*gui_,_("Saved"),_("The game has been saved")).show_min_duration(dialogs::three_blinks);
}
} catch(game::save_game_failed&) {
dialogs::message_dialog to_show(*gui_,_("Error"),_("The game could not be saved"));
to_show.layout();
to_show.show_min_duration(dialogs::three_blinks);
//do not bother retrying, since the user can just try to save the game again
};
@ -615,9 +612,7 @@ namespace events{
recorder.save_game(label + "-" + _("Auto-Save") + lexical_cast<std::string>(turn), snapshot, starting_pos);
}
} catch(game::save_game_failed&) {
dialogs::message_dialog to_show(*gui_,"",_("Could not auto save the game. Please save the game manually."));
to_show.layout();
to_show.show_min_duration(dialogs::three_blinks);
dialogs::message_dialog(*gui_,"",_("Could not auto save the game. Please save the game manually.")).show_min_duration(dialogs::three_blinks);
//do not bother retrying, since the user can just save the game
}
end = SDL_GetTicks();
@ -727,7 +722,6 @@ namespace events{
if(sample_units.empty()) {
dialogs::message_dialog to_show(*gui_,"",_("You have no units available to recruit."));
to_show.layout();
to_show.show_min_duration(dialogs::three_blinks);
return;
}
@ -1875,7 +1869,6 @@ namespace events{
}
} else if(game_config::debug && cmd == "show_var") {
dialogs::message_dialog to_show(*gui_,"",gamestate_.get_variable(data));
to_show.layout();
to_show.show_min_duration(dialogs::three_blinks);
} else if(game_config::debug && cmd == "unit") {
const unit_map::iterator i = current_unit(mousehandler);

View file

@ -291,7 +291,7 @@ LEVEL_RESULT playsingle_controller::play_scenario(const std::vector<config*>& st
title = _("Scenario Report");
} else {
title = _("Victory");
report << _("You have emerged victorious!") << "\n";
report << _("You have emerged victorious!") << "\n~\n";
}
if (gamestate_.players.size() > 0 &&
(has_next_scenario ||