Added support for setting up end sequence animations on levels.
[supertux.git] / src / leveleditor.cpp
index 790aa0f..7be8284 100644 (file)
@@ -496,7 +496,7 @@ void LevelEditor::init_menus()
       for(std::vector<int>::const_iterator sit = (*it).tiles.begin();
           sit != (*it).tiles.end(); ++sit, ++i)
       {
-        Tile& tile = TileManager::instance()->get(*sit);
+/*        Tile& tile = TileManager::instance()->get(*sit);
         Surface* image;
         if(tile.editor_images.size() > 0)
           image = tile.editor_images[0];
@@ -508,7 +508,7 @@ void LevelEditor::init_menus()
 
         Button* button = new Button(image, it->name, SDLKey(SDLK_a + i),
                                     0, 0, 32, 32);
-        tilegroups_map[it->name]->additem(button, *sit);
+        tilegroups_map[it->name]->additem(button, *sit);*/
       }
     }
   select_tilegroup_menu->additem(MN_HL,"",0,0);
@@ -544,8 +544,8 @@ void LevelEditor::update_level_settings_menu()
   level_settings_menu->get_item_by_id(MNID_NAME).change_input(le_level->name.c_str());
   level_settings_menu->get_item_by_id(MNID_AUTHOR).change_input(le_level->author.c_str());
 
-  level_settings_menu->get_item_by_id(MNID_SONG).list.first = FileSystem::dfiles("music/",NULL, "-fast");
-  level_settings_menu->get_item_by_id(MNID_BGIMG).list.first = FileSystem::dfiles("images/background",NULL, NULL);
+  level_settings_menu->get_item_by_id(MNID_SONG).list.first = FileSystem::dfiles("music/","", "-fast");
+  level_settings_menu->get_item_by_id(MNID_BGIMG).list.first = FileSystem::dfiles("images/background","", "");
   level_settings_menu->get_item_by_id(MNID_BGIMG).list.first.insert("");
   level_settings_menu->get_item_by_id(MNID_PARTICLE).list.first.insert("");
   level_settings_menu->get_item_by_id(MNID_PARTICLE).list.first.insert("snow");
@@ -827,20 +827,20 @@ void LevelEditor::drawinterface(DrawingContext &context)
     }
 
     sprintf(str, "%d/%d", le_levelnb, le_level_subset->get_num_levels());
-    context.draw_text(white_text, str, Vector((le_level_subset->get_num_levels() < 10) ? -10 : 0, 16), LAYER_GUI);
+    context.draw_text(white_text, str, Vector((le_level_subset->get_num_levels() < 10) ? -10 : 0, 16), LEFT_ALLIGN, LAYER_GUI);
 
     if(!le_help_shown)
-      context.draw_text(white_small_text, "F1 for Help", Vector(10, 430), LAYER_GUI);
+      context.draw_text(white_small_text, "F1 for Help", Vector(10, 430), LEFT_ALLIGN, LAYER_GUI);
 
     if(display_level_info.check())
-      context.draw_text_center(white_text, le_level->name.c_str(), Vector(0, 0), LAYER_GUI);
+      context.draw_text(white_text, le_level->name.c_str(), Vector(screen->w/2, 0), CENTER_ALLIGN, LAYER_GUI);
   }
   else
   {
     if(!Menu::current())
-      context.draw_text(white_small_text, "No Level Subset loaded - Press ESC and choose one in the menu", Vector(10, 430), LAYER_GUI);
+      context.draw_text(white_small_text, "No Level Subset loaded - Press ESC and choose one in the menu", Vector(10, 430), LEFT_ALLIGN, LAYER_GUI);
     else
-      context.draw_text(white_small_text, "No Level Subset loaded", Vector(10, 430), LAYER_GUI);
+      context.draw_text(white_small_text, "No Level Subset loaded", Vector(10, 430), LEFT_ALLIGN, LAYER_GUI);
   }
 
 }
@@ -930,7 +930,7 @@ le_level->get_sector("main")->solids->draw(context);
 
   /* Draw the player: */
   /* for now, the position is fixed at (100, 240) */
-  largetux.walk_right->draw(context, Vector(100 - pos_x, 240 - pos_y), LAYER_OBJECTS-1);
+//  largetux.walk_right->draw(context, Vector(100 - pos_x, 240 - pos_y), LAYER_OBJECTS-1);
 }
 
 void LevelEditor::change_object_properties(GameObject *pobj)
@@ -1782,13 +1782,13 @@ void LevelEditor::showhelp()
     context.draw_gradient(Color(0,0,0), Color(255,255,255), LAYER_BACKGROUND0);
     drawinterface(context);
 
-    context.draw_text_center(blue_text, "- Help -", Vector(0, 30), LAYER_GUI);
+    context.draw_text(blue_text, "- Help -", Vector(screen->w/2, 30), CENTER_ALLIGN, LAYER_GUI);
 
     for(unsigned int t = 0; t < sizeof(text[i])/sizeof(char *); t++)
-      context.draw_text(white_text, text[i][t], Vector(5, 80+(t*white_text->get_height())), LAYER_GUI);
+      context.draw_text(white_text, text[i][t], Vector(5, 80+(t*white_text->get_height())), LEFT_ALLIGN, LAYER_GUI);
 
     sprintf(str,"Press any key to continue - Page %d/%d?", i, static_cast<int>(sizeof(text)));
-    context.draw_text(gold_text, str, Vector(0, 0), LAYER_GUI);
+    context.draw_text(gold_text, str, Vector(0, 0), LEFT_ALLIGN, LAYER_GUI);
 
     context.do_drawing();