More de-verbosification.
This commit is contained in:
parent
b30914df43
commit
2e6660ff62
7 changed files with 16 additions and 16 deletions
|
@ -832,7 +832,7 @@ void dialog_image::draw_contents()
|
|||
video().blit_surface(location().x, location().y, surf_);
|
||||
}
|
||||
|
||||
int message_dialog::show_min_duration(msecs minimum_lifetime)
|
||||
int message_dialog::show(msecs minimum_lifetime)
|
||||
{
|
||||
prevent_misclick_until_ = SDL_GetTicks() + minimum_lifetime;
|
||||
return dialog::show();
|
||||
|
|
|
@ -257,7 +257,7 @@ private:
|
|||
};
|
||||
|
||||
typedef Uint32 msecs;
|
||||
const msecs three_blinks = 300; // 3 times the 0.1sec human reflex time
|
||||
const msecs three_blinks = 300; // 3 times the 0.1sec human reflex-arc time
|
||||
|
||||
class message_dialog : public gui::dialog
|
||||
{
|
||||
|
@ -266,7 +266,7 @@ public:
|
|||
: dialog(disp, title, message, type, "translucent"), prevent_misclick_until_(0)
|
||||
{}
|
||||
~message_dialog();
|
||||
int show_min_duration(msecs minimum_lifetime = three_blinks);
|
||||
int show(msecs minimum_lifetime = three_blinks);
|
||||
protected:
|
||||
void action(gui::dialog_process_info &dp_info);
|
||||
private:
|
||||
|
|
|
@ -1113,7 +1113,7 @@ void game_controller::download_campaigns()
|
|||
}
|
||||
}
|
||||
|
||||
gui::message_dialog(disp(),_("Add-on Installed"),_("The add-on has been installed.")).show_min_duration();
|
||||
gui::message_dialog(disp(),_("Add-on Installed"),_("The add-on has been installed.")).show();
|
||||
} catch(config::error&) {
|
||||
gui::show_error_message(disp(), _("Network communication error."));
|
||||
} catch(network::error&) {
|
||||
|
@ -1175,7 +1175,7 @@ void game_controller::upload_campaign(const std::string& campaign, network::conn
|
|||
gui::show_error_message(disp(), _("The server responded with an error: \"") +
|
||||
(*data.child("error"))["message"].str() + '"');
|
||||
} else if(data.child("message")) {
|
||||
gui::message_dialog(disp(),_("Response"),(*data.child("message"))["message"]).show_min_duration();
|
||||
gui::message_dialog(disp(),_("Response"),(*data.child("message"))["message"]).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1200,7 +1200,7 @@ void game_controller::delete_campaign(const std::string& campaign, network::conn
|
|||
gui::show_error_message(disp(), _("The server responded with an error: \"") +
|
||||
(*data.child("error"))["message"].str() + '"');
|
||||
} else if(data.child("message")) {
|
||||
gui::message_dialog(disp(),_("Response"),(*data.child("message"))["message"]).show_min_duration();
|
||||
gui::message_dialog(disp(),_("Response"),(*data.child("message"))["message"]).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1443,7 +1443,7 @@ bool event_handler::handle_event_command(const queued_event& event_info,
|
|||
to_show.set_image(surface, caption);
|
||||
}
|
||||
to_show.layout();
|
||||
to_show.show_min_duration(lifetime);
|
||||
to_show.show(lifetime);
|
||||
}
|
||||
|
||||
const vconfig::child_list commands = cfg.get_children(command_type);
|
||||
|
@ -1602,7 +1602,7 @@ bool event_handler::handle_event_command(const queued_event& event_info,
|
|||
to_show.get_menu().set_max_width( dim.menu_width );
|
||||
to_show.get_menu().wrap_words();
|
||||
to_show.layout(-1, map_area.y + 4);
|
||||
option_chosen = to_show.show_min_duration(lifetime);
|
||||
option_chosen = to_show.show(lifetime);
|
||||
LOG_DP << "showed dialog...\n";
|
||||
|
||||
if (option_chosen == gui::ESCAPE_DIALOG){
|
||||
|
|
|
@ -467,7 +467,7 @@ namespace events{
|
|||
if(res == 0) {
|
||||
|
||||
if(std::count_if(label.begin(),label.end(),is_illegal_file_char)) {
|
||||
gui::message_dialog(*gui_,_("Error"),_("Save names may not contain colons, slashes, or backslashes. Please choose a different name.")).show_min_duration();
|
||||
gui::message_dialog(*gui_,_("Error"),_("Save names may not contain colons, slashes, or backslashes. Please choose a different name.")).show();
|
||||
save_game(message,dialog_type);
|
||||
return;
|
||||
}
|
||||
|
@ -477,11 +477,11 @@ namespace events{
|
|||
try {
|
||||
recorder.save_game(label, snapshot, gamestate_.starting_pos);
|
||||
if(dialog_type != gui::NULL_DIALOG) {
|
||||
gui::message_dialog(*gui_,_("Saved"),_("The game has been saved")).show_min_duration();
|
||||
gui::message_dialog(*gui_,_("Saved"),_("The game has been saved")).show();
|
||||
}
|
||||
} catch(game::save_game_failed&) {
|
||||
gui::message_dialog to_show(*gui_,_("Error"),_("The game could not be saved"));
|
||||
to_show.show_min_duration();
|
||||
to_show.show();
|
||||
//do not bother retrying, since the user can just try to save the game again
|
||||
};
|
||||
} else if(res == 2) {
|
||||
|
@ -612,7 +612,7 @@ namespace events{
|
|||
recorder.save_game(label + "-" + _("Auto-Save") + lexical_cast<std::string>(turn), snapshot, starting_pos);
|
||||
}
|
||||
} catch(game::save_game_failed&) {
|
||||
gui::message_dialog(*gui_,"",_("Could not auto save the game. Please save the game manually.")).show_min_duration();
|
||||
gui::message_dialog(*gui_,"",_("Could not auto save the game. Please save the game manually.")).show();
|
||||
//do not bother retrying, since the user can just save the game
|
||||
}
|
||||
end = SDL_GetTicks();
|
||||
|
@ -722,7 +722,7 @@ namespace events{
|
|||
|
||||
if(sample_units.empty()) {
|
||||
gui::message_dialog to_show(*gui_,"",_("You have no units available to recruit."));
|
||||
to_show.show_min_duration();
|
||||
to_show.show();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1869,7 +1869,7 @@ namespace events{
|
|||
}
|
||||
} else if(game_config::debug && cmd == "show_var") {
|
||||
gui::message_dialog to_show(*gui_,"",gamestate_.get_variable(data));
|
||||
to_show.show_min_duration();
|
||||
to_show.show();
|
||||
} else if(game_config::debug && cmd == "unit") {
|
||||
const unit_map::iterator i = current_unit(mousehandler);
|
||||
if(i != units_.end()) {
|
||||
|
|
|
@ -298,7 +298,7 @@ LEVEL_RESULT play_game(display& disp, game_state& gamestate, const config& game_
|
|||
gui::message_dialog(disp,
|
||||
_("Defeat"),
|
||||
_("You have been defeated!")
|
||||
).show_min_duration();
|
||||
).show();
|
||||
//Make sure the user gets an opportunity to delete his autosaves
|
||||
if (preferences::delete_autosaves())
|
||||
clean_autosaves(gamestate.label);
|
||||
|
|
|
@ -344,7 +344,7 @@ LEVEL_RESULT playsingle_controller::play_scenario(const std::vector<config*>& st
|
|||
}
|
||||
|
||||
gui::message_dialog(*gui_,
|
||||
title, report.str()).show_min_duration();
|
||||
title, report.str()).show();
|
||||
|
||||
return VICTORY;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue