16 #define GETTEXT_DOMAIN "wesnoth-lib"
39 , duration_(
info.end_text_duration)
44 if(!
info.end_text.empty()) {
45 text_.push_back(
info.end_text);
47 text_.push_back(
_(
"The End"));
50 if(
info.end_credits) {
51 text_.push_back(
"<span size='large'>" +
info.campaign_name +
"</span>");
54 for(
const auto&
about : (*campaign_credits)->sections) {
55 if(
about.names.empty()) {
60 static const float chunk_size = 5.0;
62 const unsigned num_names =
about.names.size();
63 const unsigned num_chunks = std::ceil(num_names / chunk_size);
65 for(std::size_t
i = 0;
i < num_chunks; ++
i) {
70 ss <<
about.title <<
"\n\n";
73 for(std::size_t k =
i * chunk_size; k < std::min<unsigned>((
i + 1) * chunk_size, num_names); ++k) {
74 ss <<
"<span size='xx-small'>" <<
about.names[k].first <<
"</span>\n";
78 std::string section_text = ss.str();
79 section_text.pop_back();
81 text_.push_back(std::move(section_text));
87 current_text_ = text_.begin();
A simple canvas which can be drawn upon.
void set_variable(const std::string &key, wfl::variant &&value)
void update_size_variables()
Update WFL size variables.
Abstract base class for all modal dialogs.
Dialog to display 'The End' at the end of a campaign.
std::vector< std::string >::iterator current_text_
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
virtual void update() override
Displays a simple fading screen with any user-provided text.
std::vector< std::string > text_
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
base class of top level items, the only item which needs to store the final canvases to draw on.
void set_enter_disabled(const bool enter_disabled)
Disable the enter key.
void close()
Requests to close the window.
static std::string _(const char *str)
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
Display credits about all contributors.
std::optional< credits_data::const_iterator > get_campaign_credits(const std::string &campaign)
Gets credits for a given campaign.
std::size_t add_timer(const uint32_t interval, const std::function< void(std::size_t id)> &callback, const bool repeat)
Adds a new timer.
bool remove_timer(const std::size_t id)
Removes a timer.
This file contains the settings handling of the widget library.
Contains the gui2 timer routines.