// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <sstream>
+#include "gameconfig.hpp"
#include "gettext.hpp"
#include "gui/menu.hpp"
{
std::ostringstream out;
out << "Profile " << i+1;
- add_entry(i, out.str());
+ add_entry(i+1, out.str());
}
add_hl();
add_back(_("Back"));
}
-
+
+ void menu_action(MenuItem* item) {
+ config->profile = item->id;
+ Menu::set_current(0);
+ }
};
Menu* profile_menu = 0;
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 */