- stream << "save/" << worlddirname << "_" << slot << ".stsg";
- std::string slotfile = stream.str();
-
- if(Unison::VFS::FileSystem::get().exists(slotfile))
- {
- lisp::Parser parser;
- const lisp::Lisp* root = parser.parse(slotfile);
-
- const lisp::Lisp* savegame = root->get_lisp("supertux-savegame");
- if(!savegame)
- throw std::runtime_error("file is not a supertux-savegame.");
-
- savegame->get("title", title);
- }
- else
- {
- std::ostringstream slottitle;
- slottitle << _("Slot") << " " << slot << " - " << _("Free");
- return slottitle.str();
- }
-
- std::ostringstream slottitle;
- slottitle << _("Slot") << " " << slot << " - " << title;
- return slottitle.str();
-}
-
-bool
-TitleScreen::process_load_game_menu()
-{
- int slot = load_game_menu->check();
-
- if(slot == -1)
- return false;
-
- if(load_game_menu->get_item_by_id(slot).kind != MN_ACTION)
- return false;
-
- std::string basename = current_world->get_basedir();
- basename = basename.substr(0, basename.length()-1);
- std::string worlddirname = FileSystem::basename(basename);
- std::stringstream stream;
- stream << "save/" << worlddirname << "_" << slot << ".stsg";