The Battle for Wesnoth  1.17.17+dev
end_credits.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2016 - 2023
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  /** TLD override to update animations, called once per frame */
40  virtual void update() override;
41 
42 private:
43  virtual const std::string& window_id() const override;
44 
45  virtual void pre_show(window& window) override;
46 
48  void key_press_callback(const SDL_Keycode key);
49 
50  const std::string& focus_on_;
51 
52  std::vector<std::string> backgrounds_;
53 
55 
56  // The speed of auto-scrolling, specified as px/s
58 
59  uint32_t last_scroll_;
60 };
61 
62 } // namespace dialogs
63 } // namespace gui2
Sort-of-Singleton that many classes, both GUI and non-GUI, use to access the game data.
Definition: display.hpp:87
std::vector< std::string > backgrounds_
Definition: end_credits.hpp:52
scroll_label * text_widget_
Definition: end_credits.hpp:54
const std::string & focus_on_
Definition: end_credits.hpp:50
void key_press_callback(const SDL_Keycode key)
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
Definition: end_credits.cpp:50
virtual void update() override
TLD override to update animations, called once per frame.
end_credits(const std::string &campaign="")
Definition: end_credits.cpp:40
virtual const std::string & window_id() const override
The ID of the window to build.
Abstract base class for all modal dialogs.
Label showing a text.
base class of top level items, the only item which needs to store the final canvases to draw on.
Definition: window.hpp:67
#define DEFINE_SIMPLE_DISPLAY_WRAPPER(dialog)
Adds a bare-bones static display function to a dialog class that immediately invokes the dialogs's mo...
Various uncategorised dialogs.
Generic file dialog.