4 // Copyright (C) 2005 Matthias Braun <matze@braunis.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 #ifndef SUPERTUX_LEVELEDITOR_H
21 #define SUPERTUX_LEVELEDITOR_H
28 #include "video/drawing_context.h"
31 #include "level_subset.h"
33 using namespace SuperTux;
56 // creating subset menu ids:
57 MN_ID_FILENAME_SUBSET,
59 MN_ID_DESCRIPTION_SUBSET,
75 OBJ_TRAMPOLINE = -100,
76 OBJ_FLYING_PLATFORM = -101,
86 void run(const std::string filename = "");
91 void draw(DrawingContext& context);
93 void load_level_subset(std::string filename);
94 void load_level(std::string filename);
95 void load_level(int nb);
96 void load_sector(size_t num);
104 void change(int x, int y, int newtile, int layer);
106 void load_buttons_gfx();
107 void free_buttons_gfx();
110 std::string level_filename;
112 size_t sectornum; // number of current sector
113 Sector* sector; // current sector
114 TileMap *solids, *foregrounds, *backgrounds;
115 std::string sector_name;
117 std::set<std::string> level_subsets;
118 LevelSubset* level_subset;
123 Menu* create_subset_menu;
126 bool left_button, middle_button, mouse_moved;
127 int mouse_x, mouse_y;
134 Timer2 level_name_timer;
136 Surface *img_background_bt, *img_foreground_bt, *img_interactive_bt;
137 Surface *img_save_level_bt, *img_setup_level_bt, *img_test_level_bt;
138 Surface *img_rubber_bt;
139 Surface *img_previous_level_bt, *img_next_level_bt, *img_previous_sector_bt, *img_next_sector_bt;
141 ButtonGroup *tiles_board, *tiles_layer, *level_options;
142 int gameobjs_first_id, cur_layer;
144 std::vector <std::vector <int> > selection;
145 Vector selection_ini, selection_end;
150 Sector* create_sector(const std::string& name, size_t width, size_t height);