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
21 #ifndef SUPERTUX_LEVELEDITOR_H
22 #define SUPERTUX_LEVELEDITOR_H
27 #include "video/drawing_context.h"
30 #include "level_subset.h"
32 using namespace SuperTux;
55 // creating subset menu ids:
56 MN_ID_FILENAME_SUBSET,
58 MN_ID_DESCRIPTION_SUBSET,
74 OBJ_TRAMPOLINE = -100,
75 OBJ_FLYING_PLATFORM = -101,
85 void run(const std::string filename = "");
90 void draw(DrawingContext& context);
92 void load_level_subset(std::string filename);
93 void load_level(std::string filename);
94 void load_level(int nb);
95 void load_sector(size_t num);
103 void change(int x, int y, int newtile, int layer);
105 void load_buttons_gfx();
106 void free_buttons_gfx();
109 std::string level_filename;
111 size_t sectornum; // number of current sector
112 Sector* sector; // current sector
113 TileMap *solids, *foregrounds, *backgrounds;
114 std::string sector_name;
116 std::set<std::string> level_subsets;
117 LevelSubset* level_subset;
122 Menu* create_subset_menu;
125 bool left_button, middle_button, mouse_moved;
126 int mouse_x, mouse_y;
133 Timer2 level_name_timer;
135 Surface *img_background_bt, *img_foreground_bt, *img_interactive_bt;
136 Surface *img_save_level_bt, *img_setup_level_bt, *img_test_level_bt;
137 Surface *img_rubber_bt;
138 Surface *img_previous_level_bt, *img_next_level_bt, *img_previous_sector_bt, *img_next_sector_bt;
140 ButtonGroup *tiles_board, *tiles_layer, *level_options;
141 int gameobjs_first_id, cur_layer;
143 std::vector <std::vector <int> > selection;
144 Vector selection_ini, selection_end;
149 Sector* create_sector(const std::string& name, size_t width, size_t height);