Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/client.cc34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/client/client.cc b/src/client/client.cc
index 897ab41..1ee53d3 100644
--- a/src/client/client.cc
+++ b/src/client/client.cc
@@ -17,6 +17,7 @@
#include "client/video.h"
#include "client/input.h"
#include "client/soundext.h"
+#include "client/savegamemenu.h"
#include "core/core.h"
#include "core/loader.h"
#include "core/zone.h"
@@ -643,30 +644,31 @@ void Client::func_testmodel(std::string const &args)
}
// quick load
-void Client::func_loadgame(std::string const &args)
+void Client::func_savegame(std::string const &args)
{
- std::string savegamepath(filesystem::writedir());
- savegamepath.append("savegames");
-
- filesystem::Directory directory(savegamepath);
+ std::stringstream argstr(args);
+ std::string savename;
+ argstr >> savename;
+ aux::to_label(savename);
- for (filesystem::Directory::FileNames::const_iterator it = directory.filenames().begin();
- it != directory.filenames().end(); ++it)
- {
- con_print << (*it) << std::endl;
- }
+ if (!savename.size()) {
+ savename.assign("quick");
+ }
+ SaveGameMenu::savegame(savename);
}
// quik save
-void Client::func_savegame(std::string const &args)
+void Client::func_loadgame(std::string const &args)
{
- // make sure the screenshots folder exists
- std::string savegamepath(filesystem::writedir());
- savegamepath.append("savegames");
+ std::stringstream argstr(args);
+ std::string savename;
+ argstr >> savename;
+ aux::to_label(savename);
- if (!sys::directory_exists(savegamepath)) {
- sys::mkdir(savegamepath);
+ if (!savename.size()) {
+ savename.assign("quick");
}
+ SaveGameMenu::loadgame(savename);
}
} // namespace client