"save replay" instead of "save game"
This commit is contained in:
parent
15f1c253c2
commit
d94d667108
3 changed files with 6 additions and 5 deletions
|
@ -186,12 +186,13 @@ void show_objectives(display& disp, const config& level, const std::string& obje
|
|||
}
|
||||
|
||||
int get_save_name(display & disp,const std::string& caption, const std::string& message,
|
||||
std::string* name, gui::DIALOG_TYPE dialog_type)
|
||||
std::string* name, gui::DIALOG_TYPE dialog_type, const std::string& title)
|
||||
{
|
||||
const std::string& title2 = (title.empty()) ? _("Save Game") : title;
|
||||
int overwrite=0;
|
||||
int res=0;
|
||||
do {
|
||||
res = gui::show_dialog(disp,NULL,_("Save Game"),caption,dialog_type,NULL,NULL,message,name);
|
||||
res = gui::show_dialog(disp,NULL,title2,caption,dialog_type,NULL,NULL,message,name);
|
||||
if (res == 0 && save_game_exists(*name))
|
||||
overwrite = gui::show_dialog(disp,NULL,_("Overwrite?"),
|
||||
_("Save already exists. Do you want to overwrite it ?"),gui::YES_NO);
|
||||
|
|
|
@ -43,7 +43,7 @@ void show_objectives(display& disp, const config& level, const std::string& obje
|
|||
// returns 0 iff user wants to save the game
|
||||
int get_save_name(display & disp, const std::string& caption,
|
||||
const std::string& message, std::string* name,
|
||||
gui::DIALOG_TYPE dialog_type=gui::YES_NO);
|
||||
gui::DIALOG_TYPE dialog_type=gui::YES_NO, const std::string& title="");
|
||||
|
||||
//allow user to select the game they want to load. Returns the name
|
||||
//of the save they want to load. Stores whether the user wants to show
|
||||
|
|
|
@ -290,14 +290,14 @@ LEVEL_RESULT play_game(display& disp, game_state& state, const config& game_conf
|
|||
const int should_save = dialogs::get_save_name(disp,
|
||||
_("Do you want to save a replay of this scenario?"),
|
||||
_("Name:"),
|
||||
&label);
|
||||
&label, gui::OK_CANCEL, _("Save Replay"));
|
||||
if(should_save == 0) {
|
||||
try {
|
||||
config snapshot;
|
||||
|
||||
recorder.save_game(label, snapshot, state.starting_pos);
|
||||
} catch(game::save_game_failed&) {
|
||||
gui::show_error_message(disp, _("The game could not be saved"));
|
||||
gui::show_error_message(disp, _("The replay could not be saved"));
|
||||
retry = true;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue