Don't display the end screen at all with end_credits=no

Left the logic in the dialog mostly intact so that if the dialog is
somehow invoked it doesn't display the title card, only the "The End"
text.
This commit is contained in:
Iris Morelle 2021-03-20 02:05:22 -03:00
parent 220c3f5752
commit 36f1fa2af1
3 changed files with 6 additions and 4 deletions

View file

@ -63,6 +63,7 @@
* Standard Location Filters now support gives_income=yes|no to make it simpler to match villages regardless of owner
* Fixed ThemeWML `[label] font_rgb=` generating text elements with broken UTF-8 sequences.
* abilities used like weapon can call a [teaching_anim] instead of [leading_anim] now.
* The campaign end screen is no longer displayed when `[campaign]/[endlevel] end_credits=` is set to a false value.
### Miscellaneous and Bug Fixes
* Added support for 1.14s tag names in `[terrain_defaults]` (issue #5308).
* Replaced legacy SDL_ttf/FriBidi-based font rendering used in old GUI1 code paths with Pango.

View file

@ -341,7 +341,9 @@ LEVEL_RESULT campaign_controller::play_game()
preferences::add_completed_campaign(
state_.classification().campaign, state_.classification().difficulty);
gui2::dialogs::outro::display(state_.classification());
if(state_.classification().end_credits) {
gui2::dialogs::outro::display(state_.classification());
}
}
return res;

View file

@ -45,10 +45,9 @@ outro::outro(const game_classification& info)
text_.push_back(_("The End"));
}
text_.push_back("<span size='large'>" + info.campaign_name + "</span>");
// We only show the end text and the title if credits were turned off
if(info.end_credits) {
text_.push_back("<span size='large'>" + info.campaign_name + "</span>");
const auto campaign_credits = about::get_campaign_credits(info.campaign);
if(campaign_credits != about::get_credits_data().end()) {