1 /***************************************************************************
2 leveleditor.h - built'in level editor
5 copyright : (C) 2004 by Ricardo Cruz
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
18 #ifndef SUPERTUX_LEVELEDITOR_H
19 #define SUPERTUX_LEVELEDITOR_H
26 #include "video/drawing_context.h"
27 #include "special/timer.h"
29 #include "level_subset.h"
31 using namespace SuperTux;
54 // creating subset menu ids:
55 MN_ID_FILENAME_SUBSET,
57 MN_ID_DESCRIPTION_SUBSET,
73 OBJ_TRAMPOLINE = -100,
74 OBJ_FLYING_PLATFORM = -101,
84 void run(const std::string filename = "");
89 void draw(DrawingContext& context);
91 void load_level_subset(std::string filename);
92 void load_level(std::string filename);
93 void load_level(int nb);
94 void load_sector(std::string name);
95 void load_sector(Sector* sector);
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 Sector* sector; // current sector
112 TileMap *solids, *foregrounds, *backgrounds;
113 std::string sector_name;
115 std::set<std::string> level_subsets;
116 LevelSubset* level_subset;
121 Menu* create_subset_menu;
124 bool left_button, middle_button, mouse_moved;
133 Timer 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;
143 std::vector <std::vector <int> > selection;
144 Vector selection_ini, selection_end;