Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the MP Create Dialog's handling of unplayable maps
The UX seems to already be prepared for this - if the map doesn't load then the create_engine class puts an error message in the map description, which is shown on the top-left of the MP Create Dialog when the map is selected. Fixes bugs #3149, #4395 and #4545. The block deleted in this commit skipped adding an entry to the games_list listbox, which broke assumptions elsewhere that the indices returned by create_game_.get_filtered_level_indices() correspond to the indices in the listbox.
- Loading branch information
1 parent
4682b45
commit d4c34c5
Showing
1 changed file
with
10 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -607,10 +607,6 @@ void mp_create_game::display_games_of_type(window& window, ng::level::TYPE type, | |
list.clear(); | ||
|
||
for(const auto& game : create_engine_.get_levels_by_type_unfiltered(type)) { | ||
if(!game->can_launch_game()) { | ||
continue; | ||
} | ||
|
||
std::map<std::string, string_map> data; | ||
string_map item; | ||
|
||
|
@@ -840,6 +836,16 @@ bool mp_create_game::dialog_exit_hook(window& /*window*/) | |
return false; | ||
} | ||
|
||
if(!create_engine_.current_level().can_launch_game()) { | ||
std::stringstream msg; | ||
// TRANSLATORS: This sentence will be followed by some details of the error, most likely the "Map could not be loaded" message from create_engine.cpp | ||
msg << _("The selected game can not be created."); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
stevecotton
Author
Contributor
|
||
msg << "\n\n"; | ||
msg << create_engine_.current_level().description(); | ||
gui2::show_transient_error_message(msg.str()); | ||
return false; | ||
} | ||
|
||
if(!create_engine_.is_campaign()) { | ||
return true; | ||
} | ||
|
@stevecotton can not -> cannot