Skip to content

Commit

Permalink
Added confirmation when clearing map labels (fixes #2371)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Feb 6, 2018
1 parent bd9e423 commit 40706a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog
Expand Up @@ -61,6 +61,7 @@ Version 1.13.11:
* Greatly improved behavior of sliders.
* Fixed crash when modifying an existing friend entry in Preferences.
* Fixed players being unable to start campaigns in MP mode.
* Added confirmation prompt when clearing map labels.
* WFL Engine:
* A new string insert() function has been added, similar to replace()
* WML Engine:
Expand Down
12 changes: 10 additions & 2 deletions src/menu_events.cpp
Expand Up @@ -799,8 +799,16 @@ void menu_handler::label_terrain(mouse_handler& mousehandler, bool team_only)
void menu_handler::clear_labels()
{
if(gui_->team_valid() && !board().is_observer()) {
gui_->labels().clear(gui_->current_team_name(), false);
resources::recorder->clear_labels(gui_->current_team_name(), false);
const int res = gui2::show_message(
_("Clear Labels"),
_("Are you sure you want to clear map labels?"),
gui2::dialogs::message::yes_no_buttons
);

if(res == gui2::window::OK) {
gui_->labels().clear(gui_->current_team_name(), false);
resources::recorder->clear_labels(gui_->current_team_name(), false);
}
}
}

Expand Down

0 comments on commit 40706a8

Please sign in to comment.