restore trunk
[supertux.git] / src / title.hpp
1 //  $Id$
2 //
3 //  SuperTux
4 //  Copyright (C) 2004 Tobias Glaesser <tobi.web@gmx.de>
5 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
6 //
7 //  This program is free software; you can redistribute it and/or
8 //  modify it under the terms of the GNU General Public License
9 //  as published by the Free Software Foundation; either version 2
10 //  of the License, or (at your option) any later version.
11 //
12 //  This program is distributed in the hope that it will be useful,
13 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 //  GNU General Public License for more details.
16 //
17 //  You should have received a copy of the GNU General Public License
18 //  along with this program; if not, write to the Free Software
19 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 //  02111-1307, USA.
21 #ifndef SUPERTUX_TITLE_H
22 #define SUPERTUX_TITLE_H
23
24 #include <memory>
25 #include <vector>
26 #include "screen.hpp"
27 #include "game_session.hpp"
28 #include "addon.hpp"
29
30 class Menu;
31 class World;
32 class CodeController;
33
34 class TitleScreen : public Screen
35 {
36 public:
37   TitleScreen();
38   virtual ~TitleScreen();
39
40   virtual void setup();
41   virtual void leave();
42
43   virtual void draw(DrawingContext& context);
44
45   virtual void update(float elapsed_time);
46
47 private:
48   std::string get_slotinfo(int slot);
49   std::string get_level_name(const std::string& levelfile);
50   bool process_load_game_menu();
51   void make_tux_jump();
52   void update_load_game_menu();
53   void generate_main_menu();
54   void generate_contrib_menu();
55   void check_levels_contrib_menu();
56   void check_contrib_world_menu();
57   void free_contrib_menu();
58   void generate_addons_menu();
59   void check_addons_menu();
60   void free_addons_menu();
61
62   std::auto_ptr<Menu> main_menu;
63   std::auto_ptr<Menu> load_game_menu;
64   std::auto_ptr<Menu> contrib_menu;
65   std::auto_ptr<Menu> contrib_world_menu;
66   std::auto_ptr<World> main_world;
67   std::vector<World*> contrib_worlds;
68   std::auto_ptr<Menu> addons_menu;
69   std::vector<Addon> addons; /**< shown list of Add-ons */
70   std::vector<Addon> available_addons; /**< list of downloadable Add-ons */
71   std::vector<Addon> installed_addons; /**< list of currently installed Add-ons */
72   World* current_world;
73
74   std::auto_ptr<CodeController> controller;
75   std::auto_ptr<GameSession> titlesession;
76 };
77
78 #endif