The Battle for Wesnoth  1.17.0-dev
end_credits.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2016 - 2021
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #pragma once
16 
18 
19 #include <SDL2/SDL_keycode.h>
20 #include <vector>
21 
22 class display;
23 
24 namespace gui2
25 {
26 
27 class scroll_label;
28 
29 namespace dialogs
30 {
31 
32 class end_credits : public modal_dialog
33 {
34 public:
35  explicit end_credits(const std::string& campaign = "");
36 
38 
39 private:
40  virtual const std::string& window_id() const override;
41 
42  virtual void pre_show(window& window) override;
43 
44  void timer_callback();
45  void key_press_callback(const SDL_Keycode key);
46 
47  const std::string& focus_on_;
48 
49  std::vector<std::string> backgrounds_;
50 
52 
53  // The speed of auto-scrolling, specified as px/s
55 
56  uint32_t last_scroll_;
57 };
58 
59 } // namespace dialogs
60 } // namespace gui2
std::vector< std::string > backgrounds_
Definition: end_credits.hpp:49
virtual const std::string & window_id() const override
The id of the window to build.
const std::string & focus_on_
Definition: end_credits.hpp:47
Generic file dialog.
Definition: field-fwd.hpp:23
scroll_label * text_widget_
Definition: end_credits.hpp:51
void key_press_callback(const SDL_Keycode key)
Label showing a text.
end_credits(const std::string &campaign="")
Definition: end_credits.cpp:40
Various uncategorised dialogs.
Abstract base class for all modal dialogs.
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
Definition: end_credits.cpp:49
base class of top level items, the only item which needs to store the final canvases to draw on...
Definition: window.hpp:65