- active_tm = TM_IA;
-
- le_show_grid = true;
-
- /* level_changed = NO;*/
- fire = DOWN;
- done = 0;
- le_frame = 0; /* support for frames in some tiles, like waves and bad guys */
- le_level_changed = false;
- le_current_level = NULL;
-
- le_current_tile = 0;
- le_mouse_pressed[LEFT] = false;
- le_mouse_pressed[RIGHT] = false;
-
- le_selection = new Surface(datadir + "/images/leveleditor/select.png", USE_ALPHA);
-
- select_tilegroup_menu_effect.init(false);
-
- /* Load buttons */
- le_save_level_bt = new Button("/images/icons/save.png","Save level", SDLK_F6,screen->w-64,32);
- le_exit_bt = new Button("/images/icons/exit.png","Exit", SDLK_F6,screen->w-32,32);
- le_next_level_bt = new Button("/images/icons/up.png","Next level", SDLK_PAGEUP,screen->w-64,0);
- le_previous_level_bt = new Button("/images/icons/down.png","Previous level",SDLK_PAGEDOWN,screen->w-32,0);
- le_rubber_bt = new Button("/images/icons/rubber.png","Rubber",SDLK_DELETE,screen->w-32,48);
- le_select_mode_one_bt = new Button ("/images/icons/select-mode1.png","Select single tile",SDLK_F3,screen->w-64,48);
- le_select_mode_two_bt = new Button("/images/icons/select-mode2.png","Select multiple tiles",SDLK_F3,screen->w-64,64);
- le_test_level_bt = new Button("/images/icons/test-level.png","Test level",SDLK_F4,screen->w-64,screen->h - 64);
- le_settings_bt = new Button("/images/icons/settings.png","Level settings",SDLK_F5,screen->w-32,screen->h - 64);
- le_move_left_bt = new Button("/images/icons/left.png","Move left",SDLK_LEFT,0,0);
- le_move_right_bt = new Button("/images/icons/right.png","Move right",SDLK_RIGHT,screen->w-80,0);
- le_tilegroup_bt = new Button("/images/icons/tilegroup.png","Select Tilegroup", SDLK_F7,screen->w-64,80);
-
- le_tilemap_panel = new ButtonPanel(screen->w-64,screen->h-32,32,32);
- le_tilemap_panel->set_button_size(32,10);
- le_tilemap_panel->additem(new Button("/images/icons/bkgrd.png","Background",SDLK_F4,0,0),TM_BG);
- le_tilemap_panel->additem(new Button("/images/icons/intact.png","Interactive",SDLK_F4,0,0),TM_IA);
- le_tilemap_panel->additem(new Button("/images/icons/frgrd.png","Foreground",SDLK_F4,0,0),TM_FG);
-
- leveleditor_menu = new Menu();
- subset_load_menu = new Menu();
- subset_new_menu = new Menu();
- subset_settings_menu = new Menu();
- level_settings_menu = new Menu();
- select_tilegroup_menu = new Menu();
-
- leveleditor_menu->additem(MN_LABEL,"Level Editor Menu",0,0);
- leveleditor_menu->additem(MN_HL,"",0,0);
- leveleditor_menu->additem(MN_ACTION,"Return To Level Editor",0,0,MNID_RETURNLEVELEDITOR);
- leveleditor_menu->additem(MN_DEACTIVE,"Level Subset Settings",0,subset_settings_menu,MNID_SUBSETSETTINGS);
- leveleditor_menu->additem(MN_GOTO,"Load Level Subset",0,subset_load_menu);
- leveleditor_menu->additem(MN_GOTO,"New Level Subset",0,subset_new_menu);
- leveleditor_menu->additem(MN_HL,"",0,0);
- leveleditor_menu->additem(MN_ACTION,"Quit Level Editor",0,0,MNID_QUITLEVELEDITOR);
-
- Menu::set_current(leveleditor_menu);
-
- subset_load_menu->additem(MN_LABEL, "Load Level Subset", 0, 0);
- subset_load_menu->additem(MN_HL, "", 0, 0);
-
- for(i = 0; i < level_subsets.num_items; ++i)
- {
- subset_load_menu->additem(MN_ACTION,level_subsets.item[i],0,0, i+1);
- }
- subset_load_menu->additem(MN_HL,"",0,0);
- subset_load_menu->additem(MN_BACK,"Back",0,0);
-
- subset_new_menu->additem(MN_LABEL,"New Level Subset",0,0);
- subset_new_menu->additem(MN_HL,"",0,0);
- subset_new_menu->additem(MN_TEXTFIELD,"Enter Name",0,0);
- subset_new_menu->additem(MN_ACTION,"Create",0,0, MNID_CREATESUBSET);
- subset_new_menu->additem(MN_HL,"",0,0);
- subset_new_menu->additem(MN_BACK,"Back",0,0);
-
- subset_settings_menu->additem(MN_LABEL,"Level Subset Settings",0,0);
- subset_settings_menu->additem(MN_HL,"",0,0);
- subset_settings_menu->additem(MN_TEXTFIELD,"Title",0,0);
- subset_settings_menu->additem(MN_TEXTFIELD,"Description",0,0);
- subset_settings_menu->additem(MN_HL,"",0,0);
- subset_settings_menu->additem(MN_ACTION,"Save Changes",0,0);
- subset_settings_menu->additem(MN_HL,"",0,0);
- subset_settings_menu->additem(MN_BACK,"Back",0,0);
-
- level_settings_menu->arrange_left = true;
- level_settings_menu->additem(MN_LABEL,"Level Settings",0,0);
- level_settings_menu->additem(MN_HL,"",0,0);
- level_settings_menu->additem(MN_TEXTFIELD,"Name ",0,0);
- level_settings_menu->additem(MN_TEXTFIELD,"Author ",0,0);
- level_settings_menu->additem(MN_STRINGSELECT,"Theme ",0,0);
- level_settings_menu->additem(MN_STRINGSELECT,"Song ",0,0);
- level_settings_menu->additem(MN_STRINGSELECT,"Bg-Image",0,0);
- level_settings_menu->additem(MN_NUMFIELD,"Length ",0,0);
- level_settings_menu->additem(MN_NUMFIELD,"Time ",0,0);
- level_settings_menu->additem(MN_NUMFIELD,"Gravity",0,0);
- level_settings_menu->additem(MN_NUMFIELD,"Top Red ",0,0);
- level_settings_menu->additem(MN_NUMFIELD,"Top Green ",0,0);
- level_settings_menu->additem(MN_NUMFIELD,"Top Blue ",0,0);
- level_settings_menu->additem(MN_NUMFIELD,"Bottom Red ",0,0);
- level_settings_menu->additem(MN_NUMFIELD,"Bottom Green",0,0);
- level_settings_menu->additem(MN_NUMFIELD,"Bottom Blue",0,0);
- level_settings_menu->additem(MN_HL,"",0,0);
- level_settings_menu->additem(MN_ACTION,"Apply Changes",0,0,MNID_APPLY);
-
- select_tilegroup_menu->arrange_left = true;
- select_tilegroup_menu->additem(MN_LABEL,"Select Tilegroup",0,0);
- select_tilegroup_menu->additem(MN_HL,"",0,0);
- std::vector<TileGroup>* tilegroups = TileManager::tilegroups();
- for(std::vector<TileGroup>::iterator it = tilegroups->begin(); it != tilegroups->end(); ++it )