The Battle for Wesnoth  1.15.12+dev
outro.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2017-2018 by Charles Dang <exodia339@gmail.com>
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 
20 
21 namespace gui2::dialogs
22 {
23 /** Dialog to display 'The End' at the end of a campaign. */
24 class outro : public modal_dialog
25 {
26 public:
28 
29  /**
30  * Displays a simple fading screen with any user-provided text.
31  * Used after the end of single-player campaigns.
32  *
33  * @param text Text to display, centered on the screen.
34  *
35  * @param duration In milliseconds, for how much time the text will
36  * be displayed on screen.
37  */
39 
40 private:
41  virtual const std::string& window_id() const override;
42 
43  virtual void pre_show(window& window) override;
44 
45  virtual void post_show(window& window) override;
46 
47  void draw_callback();
48 
49  std::vector<std::string> text_;
51 
52  unsigned int duration_;
54 
55  bool fading_in_;
56 
57  std::size_t timer_id_;
58 };
59 
60 } // namespace dialogs
std::vector< std::string > text_
Definition: outro.hpp:49
logger & info()
Definition: log.cpp:88
unsigned int duration_
Definition: outro.hpp:52
std::vector< std::string >::iterator current_text_
Definition: outro.hpp:50
std::size_t timer_id_
Definition: outro.hpp:57
outro(const game_classification &info)
Definition: outro.cpp:34
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:24
Abstract base class for all modal dialogs.
void draw_callback()
Definition: outro.cpp:102
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
Definition: outro.cpp:153
base class of top level items, the only item which needs to store the final canvases to draw on...
Definition: window.hpp:64
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
Definition: outro.cpp:94
std::string::const_iterator iterator
Definition: tokenizer.hpp:24