15 #define GETTEXT_DOMAIN "wesnoth-lib"
44 , text_widget_(
nullptr)
46 , last_scroll_(std::numeric_limits<uint32_t>::max())
48 , last_idx_(first_idx_ + sliding_size_)
59 std::stringstream focus_ss;
62 std::stringstream& group_stream = (
group.id ==
focus_on_) ? focus_ss : ss;
65 if(!
group.header.empty()) {
66 group_stream <<
"<span size='xx-large'>" <<
group.header <<
"</span>" <<
"\n";
70 group_stream <<
"\n" <<
"<span size='x-large'>" <<
about.title <<
"</span>" <<
"\n";
72 for(
const auto& entry :
about.names) {
73 group_stream << entry.first <<
"\n";
79 if(!focus_ss.str().empty()) {
80 focus_ss << ss.rdbuf();
98 content_ = focus_ss.str().empty() ? ss.str() : focus_ss.str();
106 for(
const std::string&
line : lines) {
111 last_chunk.emplace_back(
line.size() < 200 ?
line :
line.substr(0, 200));
136 uint32_t now = SDL_GetTicks();
147 unsigned int needed_dist = missed_time *
scroll_speed_ / 1000;
void set_variable(const std::string &key, wfl::variant &&value)
std::string sliding_content_
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 pre_show(window &window) override
Actions to be taken before showing the window.
virtual void update() override
TLD override to update animations, called once per frame.
Abstract base class for all modal dialogs.
base class of top level items, the only item which needs to store the final canvases to draw on.
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
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
void connect_signal_pre_key_press(dispatcher &dispatcher, const signal_keyboard &signal)
Connects the signal for 'snooping' on the keypress.
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)
This file contains the settings handling of the widget library.