X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fprofile_menu.cpp;h=f215b2af407291ab95314df9f585a1ae92e892cb;hb=904852246d59d4988c3e85290dd4601713e42db5;hp=70d8402625dc2a448def1c373de58d4c12b8e31d;hpb=44a22ced3db79b25504d506e74e4e31d63446f1a;p=supertux.git diff --git a/src/profile_menu.cpp b/src/profile_menu.cpp index 70d840262..f215b2af4 100644 --- a/src/profile_menu.cpp +++ b/src/profile_menu.cpp @@ -62,4 +62,39 @@ void free_profile_menu() profile_menu = 0; } +/* +std::string +TitleScreen::get_slotinfo(int slot) +{ + std::string tmp; + std::string title; + + std::string basename = current_world->get_basedir(); + basename = basename.substr(0, basename.length()-1); + std::string worlddirname = FileSystem::basename(basename); + std::ostringstream stream; + stream << "profile" << config->profile << "/" << worlddirname << "_" << slot << ".stsg"; + std::string slotfile = stream.str(); + + try { + 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); + } catch(std::exception& ) { + std::ostringstream slottitle; + slottitle << _("Slot") << " " << slot << " - " << _("Free"); + return slottitle.str(); + } + + std::ostringstream slottitle; + slottitle << _("Slot") << " " << slot << " - " << title; + return slottitle.str(); +} +*/ + /* EOF */