Removed old Menu::check_menu() and replaced it with Menu::menu_action()
[supertux.git] / src / supertux / menu / contrib_levelset_menu.cpp
index 3ef0b3b..b0197d4 100644 (file)
@@ -69,20 +69,16 @@ ContribLevelsetMenu::ContribLevelsetMenu(std::unique_ptr<World> world) :
 }
 
 void
-ContribLevelsetMenu::check_menu()
+ContribLevelsetMenu::menu_action(MenuItem* item)
 {
-  int index = check();
-  if (index != -1)
+  if (item->kind == MN_ACTION)
   {
-    if (get_item_by_id(index).kind == MN_ACTION)
-    {
-      sound_manager->stop_music();
+    sound_manager->stop_music();
 
-      // reload the World so that we have something that we can safely
-      // std::move() around without wreaking the ContribMenu
-      std::unique_ptr<World> world = World::load(m_world->get_basedir());
-      GameManager::current()->start_level(std::move(world), m_levelset->get_level_filename(index));
-    }
+    // reload the World so that we have something that we can safely
+    // std::move() around without wreaking the ContribMenu
+    std::unique_ptr<World> world = World::load(m_world->get_basedir());
+    GameManager::current()->start_level(std::move(world), m_levelset->get_level_filename(item->id));
   }
 }