The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
title_screen.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2016 by Mark de Wever <[email protected]>
3  Part of the Battle for Wesnoth Project http://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 #ifndef GUI_DIALOGS_TITLE_SCREEN_HPP_INCLUDED
16 #define GUI_DIALOGS_TITLE_SCREEN_HPP_INCLUDED
17 
18 #include "gui/dialogs/dialog.hpp"
19 
20 namespace gui2
21 {
22 
23 class tpopup;
24 
25 /** Do we wish to show the button for the debug clock. */
26 extern bool show_debug_clock_button;
27 
28 /**
29  * This class implements the title screen.
30  *
31  * The menu buttons return a result back to the caller with the button pressed.
32  * So at the moment it only handles the tips itself.
33  *
34  * @todo Evaluate whether we can handle more buttons in this class.
35  */
36 class ttitle_screen : public tdialog
37 {
38 public:
39  ttitle_screen();
40 
42 
43  /**
44  * Values for the menu-items of the main menu.
45  *
46  * @todo Evaluate the best place for these items.
47  */
48  enum tresult {
49  TUTORIAL = 1 /**< Start special campaign 'tutorial' */
50  ,
51  NEW_CAMPAIGN /**< Let user select a campaign to play */
52  ,
55  * Play single scenario against humans or AI
56  */
57  ,
64  SHOW_ABOUT /**< Show credits */
65  ,
67  TIP_PREVIOUS /**< Show previous tip-of-the-day */
68  ,
69  TIP_NEXT /**< Show next tip-of-the-day */
70  ,
73  * Used after an action needing a redraw (ex:
74  * fullscreen)
75  */
76  ,
77  RELOAD_GAME_DATA /**< Used to reload all game data */
78  ,
79  NOTHING /**<
80  * Default, nothing done, no redraw needed
81  */
82  };
83 
84 private:
85  /** Inherited from tdialog, implemented by REGISTER_DIALOG. */
86  virtual const std::string& window_id() const;
87 
88  /** Inherited from tdialog. */
89  virtual void post_build(twindow& window);
90 
91  /** Inherited from tdialog. */
92  void pre_show(twindow& window);
93 
94  /** Holds the debug clock dialog. */
96 
97  /**
98  * Updates the tip of day widget.
99  *
100  * @param window The window being shown.
101  * @param previous Show the previous tip, else shows the next
102  * one.
103  */
104  void update_tip(twindow& window, const bool previous);
105 
106  /** Shows the debug clock. */
107  void show_debug_clock_window(CVideo& video);
108 };
109 
110 } // namespace gui2
111 
112 #endif
Used to reload all game data.
Play single scenario against humans or AI.
void update_tip(twindow &window, const bool previous)
Updates the tip of day widget.
Definition: video.hpp:58
Used after an action needing a redraw (ex: fullscreen)
Default, nothing done, no redraw needed.
void pre_show(twindow &window)
Inherited from tdialog.
Start special campaign 'tutorial'.
base class of top level items, the only item which needs to store the final canvases to draw on ...
Definition: window.hpp:62
A class inherited from ttext_box that displays its input as stars.
Definition: field-fwd.hpp:23
Abstract base class for all dialogs.
Definition: dialog.hpp:121
The popup class shows windows that are shown non-modal.
Definition: popup.hpp:33
This class implements the title screen.
tresult
Values for the menu-items of the main menu.
Show next tip-of-the-day.
virtual const std::string & window_id() const
Inherited from tdialog, implemented by REGISTER_DIALOG.
virtual void post_build(twindow &window)
Inherited from tdialog.
Let user select a campaign to play.
tpopup * debug_clock_
Holds the debug clock dialog.
Show previous tip-of-the-day.
bool show_debug_clock_button
Do we wish to show the button for the debug clock.
void show_debug_clock_window(CVideo &video)
Shows the debug clock.
GLsizei const GLcharARB ** string
Definition: glew.h:4503