The Battle for Wesnoth  1.17.0-dev
outro.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2017 - 2021
3  by Charles Dang <exodia339@gmail.com>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #pragma once
17 
19 
21 
22 namespace gui2::dialogs
23 {
24 /** Dialog to display 'The End' at the end of a campaign. */
25 class outro : public modal_dialog
26 {
27 public:
29 
30  /**
31  * Displays a simple fading screen with any user-provided text.
32  * Used after the end of single-player campaigns.
33  *
34  * @param text Text to display, centered on the screen.
35  *
36  * @param duration In milliseconds, for how much time the text will
37  * be displayed on screen.
38  */
40 
41 private:
42  virtual const std::string& window_id() const override;
43 
44  virtual void pre_show(window& window) override;
45 
46  virtual void post_show(window& window) override;
47 
48  void draw_callback();
49 
50  std::vector<std::string> text_;
52 
53  unsigned int duration_;
55 
56  bool fading_in_;
57 
58  std::size_t timer_id_;
59 };
60 
61 } // namespace dialogs
std::vector< std::string > text_
Definition: outro.hpp:50
logger & info()
Definition: log.cpp:89
unsigned int duration_
Definition: outro.hpp:53
std::vector< std::string >::iterator current_text_
Definition: outro.hpp:51
std::size_t timer_id_
Definition: outro.hpp:58
outro(const game_classification &info)
Definition: outro.cpp:35
virtual const std::string & window_id() const override
Displays a simple fading screen with any user-provided text.
Dialog to display &#39;The End&#39; at the end of a campaign.
Definition: outro.hpp:25
Abstract base class for all modal dialogs.
void draw_callback()
Definition: outro.cpp:101
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
Definition: outro.cpp:152
base class of top level items, the only item which needs to store the final canvases to draw on...
Definition: window.hpp:65
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
Definition: outro.cpp:93
std::string::const_iterator iterator
Definition: tokenizer.hpp:25