hopefully fixed the crash on exit, keep sectors script bundled in the sector and...
[supertux.git] / src / misc.cpp
1 //  SuperTux
2 //  Copyright (C) 2004 Tobas Glaesser <tobi.web@gmx.de>
3 //
4 //  This program is free software; you can redistribute it and/or
5 //  modify it under the terms of the GNU General Public License
6 //  as published by the Free Software Foundation; either version 2
7 //  of the License, or (at your option) any later version.
8 //
9 //  This program is distributed in the hope that it will be useful,
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 //  GNU General Public License for more details.
13 // 
14 //  You should have received a copy of the GNU General Public License
15 //  along with this program; if not, write to the Free Software
16 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17 #include <config.h>
18
19 #include "misc.hpp"
20 #include "main.hpp"
21 #include "gameconfig.hpp"
22 #include "game_session.hpp"
23 #include "gui/menu.hpp"
24 #include "gui/button.hpp"
25 #include "audio/sound_manager.hpp"
26 #include "title.hpp"
27 #include "resources.hpp"
28 #include "worldmap.hpp"
29 #include "gettext.hpp"
30 #include "options_menu.hpp"
31 #include "control/joystickkeyboardcontroller.hpp"
32
33 Menu* main_menu      = 0;
34 Menu* game_menu      = 0;
35
36 void setup_menu()
37 {
38   main_menu      = new Menu();
39   game_menu      = new Menu();
40   worldmap_menu  = new Menu();
41
42   main_menu->set_pos(SCREEN_WIDTH/2, 335);
43   main_menu->add_entry(MNID_STARTGAME, _("Start Game"));
44   main_menu->add_entry(MNID_LEVELS_CONTRIB, _("Contrib Levels"));
45   main_menu->add_submenu(_("Options"), get_options_menu());
46   main_menu->add_entry(MNID_CREDITS, _("Credits"));
47   main_menu->add_entry(MNID_QUITMAINMENU, _("Quit"));
48   
49   game_menu->add_label(_("Pause"));
50   game_menu->add_hl();
51   game_menu->add_entry(MNID_CONTINUE, _("Continue"));
52   game_menu->add_submenu(_("Options"), get_options_menu());
53   game_menu->add_hl();
54   game_menu->add_entry(MNID_ABORTLEVEL, _("Abort Level"));
55
56   worldmap_menu->add_label(_("Pause"));
57   worldmap_menu->add_hl();
58   worldmap_menu->add_entry(WorldMapNS::MNID_RETURNWORLDMAP, _("Continue"));
59   worldmap_menu->add_submenu(_("Options"), get_options_menu());
60   worldmap_menu->add_hl();
61   worldmap_menu->add_entry(WorldMapNS::MNID_QUITWORLDMAP, _("Quit Game"));
62 }
63
64 void free_menu()
65 {
66   delete worldmap_menu;
67   delete main_menu;
68   delete game_menu;
69   free_options_menu();
70 }
71