15 #define GETTEXT_DOMAIN "wesnoth-lib"
28 #include <SDL2/SDL_timer.h>
42 , text_widget_(
nullptr)
44 , last_scroll_(std::numeric_limits<uint32_t>::max())
46 , last_idx_(first_idx_ + sliding_size_)
57 std::stringstream focus_ss;
60 std::stringstream& group_stream = (
group.id ==
focus_on_) ? focus_ss : ss;
63 if(!
group.header.empty()) {
70 for(
const auto& entry :
about.names) {
71 group_stream << entry.first <<
"\n";
77 if(!focus_ss.str().empty()) {
78 focus_ss << ss.rdbuf();
91 text_widget_ = find_widget<scroll_label>(
"text",
false,
true);
96 content_ = focus_ss.str().empty() ? ss.str() : focus_ss.str();
104 for(
const std::string&
line : lines) {
109 last_chunk.emplace_back(
line.size() < 200 ?
line :
line.substr(0, 200));
134 uint32_t now = SDL_GetTicks();
145 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(std::string_view size, Args &&... data)
Applies Pango markup to the input specifying its display size.
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)