The Battle for Wesnoth  1.17.12+dev
achievements_dialog.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2022
3  by David White <dave@whitevine.net>
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 #include "achievements.hpp"
18 #include "gui/widgets/listbox.hpp"
20 
21 #pragma once
22 
23 namespace gui2::dialogs
24 {
25 
26 /**
27  * @ingroup GUIWindowDefinitionWML
28  *
29  * This shows a dialog displaying achievements.
30  *
31  * Key |Type |Mandatory|Description
32  * --------------------------|-------------|---------|-----------
33  * selected_achievements_list|menu_button |yes |Allows selecting achievements by what content they're for.
34  * name |label |yes |The user displayed name of the achievement.
35  * description |label |yes |The achievement's longer description.
36  * icon |image |yes |An icon to display to the left of the achievement.
37  */
39 {
40 public:
42 
44 
45 private:
49  /** variable of the most recently selected achievements, static to persist between closing and re-opening the dialog */
50  static unsigned int selected_index_;
51 
53 
54  virtual const std::string& window_id() const override;
55 
56  virtual void pre_show(window& window) override;
57 
58  virtual void post_show(window& window) override;
59 };
60 
61 } // namespace gui2::dialogs
This class is responsible for reading all available achievements from mainline&#39;s and any add-ons&#39; ach...
A menu_button is a styled_widget to choose an element from a list of elements.
Definition: menu_button.hpp:61
The listbox class.
Definition: listbox.hpp:45
This shows a dialog displaying achievements.
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
Abstract base class for all modal dialogs.
virtual const std::string & window_id() const override
The ID of the window to build.
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
base class of top level items, the only item which needs to store the final canvases to draw on...
Definition: window.hpp:66
static unsigned int selected_index_
variable of the most recently selected achievements, static to persist between closing and re-opening...