// 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;
#include <physfs.h>
#include <algorithm>
+#include "gameconfig.hpp"
#include "title.hpp"
#include "mainloop.hpp"
#include "video/drawing_context.hpp"
std::string str = _("Are you sure you want to delete slot") + stream.str() + "?";
if(confirm_dialog(bkg_title, str.c_str())) {
- str = "save/slot" + stream.str() + ".stsg";
+ str = "profile1/slot" + stream.str() + ".stsg";
log_debug << "Removing: " << str << std::endl;
PHYSFS_delete(str.c_str());
}
basename = basename.substr(0, basename.length()-1);
std::string worlddirname = FileSystem::basename(basename);
std::ostringstream stream;
- stream << "save/" << worlddirname << "_" << slot << ".stsg";
+ stream << "profile" << config->profile << "/" << worlddirname << "_" << slot << ".stsg";
std::string slotfile = stream.str();
try {
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";
+ std::ostringstream stream;
+ stream << "profile" << config->profile << "/" << worlddirname << "_" << slot << ".stsg";
std::string slotfile = stream.str();
try {