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