gui/dialogs/title_screen.hpp

Go to the documentation of this file.
00001 /* $Id: title_screen.hpp 52533 2012-01-07 02:35:17Z shadowmaster $ */
00002 /*
00003    Copyright (C) 2008 - 2012 by Mark de Wever <koraq@xs4all.nl>
00004    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY.
00012 
00013    See the COPYING file for more details.
00014 */
00015 
00016 #ifndef GUI_DIALOGS_TITLE_SCREEN_HPP_INCLUDED
00017 #define GUI_DIALOGS_TITLE_SCREEN_HPP_INCLUDED
00018 
00019 #include "gui/dialogs/dialog.hpp"
00020 
00021 namespace gui2 {
00022 
00023 class tpopup;
00024 
00025 /** Do we wish to show the button for the debug clock. */
00026 extern bool show_debug_clock_button;
00027 
00028 /**
00029  * This class implements the title screen.
00030  *
00031  * The menu buttons return a result back to the caller with the button pressed.
00032  * So at the moment it only handles the tips itself.
00033  *
00034  * @todo Evaluate whether we can handle more buttons in this class.
00035  */
00036 class ttitle_screen : public tdialog
00037 {
00038 public:
00039     ttitle_screen();
00040 
00041     ~ttitle_screen();
00042 
00043     /**
00044      * Values for the menu-items of the main menu.
00045      *
00046      * @todo Evaluate the best place for these items.
00047      */
00048     enum tresult {
00049               TUTORIAL = 1        /**< Start special campaign 'tutorial' */
00050             , NEW_CAMPAIGN        /**< Let user select a campaign to play */
00051             , MULTIPLAYER         /**<
00052                                    * Play single scenario against humans or AI
00053                                    */
00054             , LOAD_GAME
00055             , GET_ADDONS
00056             , START_MAP_EDITOR
00057             , CHANGE_LANGUAGE
00058             , EDIT_PREFERENCES
00059             , SHOW_ABOUT          /**< Show credits */
00060             , QUIT_GAME
00061             , TIP_PREVIOUS        /**< Show previous tip-of-the-day */
00062             , TIP_NEXT            /**< Show next tip-of-the-day */
00063             , SHOW_HELP
00064             , REDRAW_BACKGROUND   /**<
00065                                    * Used after an action needing a redraw (ex:
00066                                    * fullscreen)
00067                                    */
00068             , RELOAD_GAME_DATA    /**< Used to reload all game data */
00069             , NOTHING             /**<
00070                                    * Default, nothing done, no redraw needed
00071                                    */
00072             };
00073 
00074 private:
00075 
00076     /** Inherited from tdialog, implemented by REGISTER_DIALOG. */
00077     virtual const std::string& window_id() const;
00078 
00079     /** Inherited from tdialog. */
00080     virtual void post_build(CVideo& video, twindow& window);
00081 
00082     /** Inherited from tdialog. */
00083     void pre_show(CVideo& video, twindow& window);
00084 
00085     /** The progress bar time for the logo. */
00086     unsigned long logo_timer_id_;
00087 
00088     /** Holds the debug clock dialog. */
00089     tpopup* debug_clock_;
00090 
00091     /**
00092      * Updates the tip of day widget.
00093      *
00094      * @param window              The window being shown.
00095      * @param previous            Show the previous tip, else shows the next
00096      *                            one.
00097      */
00098     void update_tip(twindow& window, const bool previous);
00099 
00100     /** Shows the debug clock. */
00101     void show_debug_clock_window(CVideo& video);
00102 };
00103 
00104 } // namespace gui2
00105 
00106 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:02:58 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs