15 #define GETTEXT_DOMAIN "wesnoth-lib"
41 , text_widget_(
nullptr)
43 , last_scroll_(std::numeric_limits<uint32_t>::max())
45 , last_idx_(first_idx_ + sliding_size_)
56 std::stringstream focus_ss;
59 std::stringstream& group_stream = (
group.id ==
focus_on_) ? focus_ss : ss;
62 if(!
group.header.empty()) {
69 for(
const auto& entry :
about.names) {
70 group_stream << entry.first <<
"\n";
76 if(!focus_ss.str().empty()) {
77 focus_ss << ss.rdbuf();
90 text_widget_ = find_widget<scroll_label>(
"text",
false,
true);
95 content_ = focus_ss.str().empty() ? ss.str() : focus_ss.str();
103 for(
const std::string&
line : lines) {
108 last_chunk.emplace_back(
line.size() < 200 ?
line :
line.substr(0, 200));
133 uint32_t now = SDL_GetTicks();
144 unsigned int needed_dist = missed_time *
scroll_speed_ / 1000;
void set_variable(const std::string &key, wfl::variant &&value)
std::string sliding_content_
virtual void pre_show() override
Actions to be taken before showing the window.
std::vector< std::string > backgrounds_
scroll_label * text_widget_
static constexpr std::size_t lines_per_chunk_
number of lines to put in each chunk of text to display the final chunk will of course probably have ...
const std::string & focus_on_
void key_press_callback(const SDL_Keycode key)
std::vector< std::vector< std::string > > chunks_
static constexpr std::size_t sliding_size_
sliding_size_ alters how many of the sliding contents are to be run at once n-1 = 2 => 3 strings at o...
virtual void update() override
TLD override to update animations, called once per frame.
Abstract base class for all modal dialogs.
Display credits about all contributors.
std::vector< std::string > get_background_images(const std::string &campaign)
Gets credit background images for a given campaign.
const credits_data & get_credits_data()
Gets all credits data.
void line(int from_x, int from_y, int to_x, int to_y)
Draw a line.
std::string game_title_background
REGISTER_DIALOG(editor_edit_unit)
void connect_signal_pre_key_press(dispatcher &dispatcher, const signal_keyboard &signal)
Connects the signal for 'snooping' on the keypress.
std::string span_size(const std::string &size, Args &&... data)
std::string join(const T &v, const std::string &s=",")
Generates a new string joining container items in a list.
std::vector< std::string > split(const config_attribute_value &val)