Rename loadgame to loadsave
parent
3400a0fab0
commit
14e7cd0e52
|
@ -246,7 +246,7 @@ ParseArgsStatus CApplication::ParseArguments(int argc, char *argv[])
|
||||||
OPT_DEBUG,
|
OPT_DEBUG,
|
||||||
OPT_RUNSCENE,
|
OPT_RUNSCENE,
|
||||||
OPT_SCENETEST,
|
OPT_SCENETEST,
|
||||||
OPT_LOADGAME,
|
OPT_LOADSAVE,
|
||||||
OPT_LOGLEVEL,
|
OPT_LOGLEVEL,
|
||||||
OPT_LANGDIR,
|
OPT_LANGDIR,
|
||||||
OPT_DATADIR,
|
OPT_DATADIR,
|
||||||
|
@ -265,7 +265,7 @@ ParseArgsStatus CApplication::ParseArguments(int argc, char *argv[])
|
||||||
{ "debug", required_argument, nullptr, OPT_DEBUG },
|
{ "debug", required_argument, nullptr, OPT_DEBUG },
|
||||||
{ "runscene", required_argument, nullptr, OPT_RUNSCENE },
|
{ "runscene", required_argument, nullptr, OPT_RUNSCENE },
|
||||||
{ "scenetest", no_argument, nullptr, OPT_SCENETEST },
|
{ "scenetest", no_argument, nullptr, OPT_SCENETEST },
|
||||||
{ "loadgame", required_argument, nullptr, OPT_LOADGAME },
|
{ "loadsave", required_argument, nullptr, OPT_LOADSAVE },
|
||||||
{ "loglevel", required_argument, nullptr, OPT_LOGLEVEL },
|
{ "loglevel", required_argument, nullptr, OPT_LOGLEVEL },
|
||||||
{ "langdir", required_argument, nullptr, OPT_LANGDIR },
|
{ "langdir", required_argument, nullptr, OPT_LANGDIR },
|
||||||
{ "datadir", required_argument, nullptr, OPT_DATADIR },
|
{ "datadir", required_argument, nullptr, OPT_DATADIR },
|
||||||
|
@ -311,7 +311,7 @@ ParseArgsStatus CApplication::ParseArguments(int argc, char *argv[])
|
||||||
GetLogger()->Message(" -debug modes enable debug modes (more info printed in logs; see code for reference of modes)\n");
|
GetLogger()->Message(" -debug modes enable debug modes (more info printed in logs; see code for reference of modes)\n");
|
||||||
GetLogger()->Message(" -runscene sceneNNN run given scene on start\n");
|
GetLogger()->Message(" -runscene sceneNNN run given scene on start\n");
|
||||||
GetLogger()->Message(" -scenetest win every mission right after it's loaded\n");
|
GetLogger()->Message(" -scenetest win every mission right after it's loaded\n");
|
||||||
GetLogger()->Message(" -loadgame path load given game on start (path is <player>/<game>\n");
|
GetLogger()->Message(" -loadsave path load given saved game on start (path is <player>/<save>\n");
|
||||||
GetLogger()->Message(" -loglevel level set log level to level (one of: trace, debug, info, warn, error, none)\n");
|
GetLogger()->Message(" -loglevel level set log level to level (one of: trace, debug, info, warn, error, none)\n");
|
||||||
GetLogger()->Message(" -langdir path set custom language directory path\n");
|
GetLogger()->Message(" -langdir path set custom language directory path\n");
|
||||||
GetLogger()->Message(" environment variable: COLOBOT_LANG_DIR\n");
|
GetLogger()->Message(" environment variable: COLOBOT_LANG_DIR\n");
|
||||||
|
@ -369,14 +369,14 @@ ParseArgsStatus CApplication::ParseArguments(int argc, char *argv[])
|
||||||
m_sceneTest = true;
|
m_sceneTest = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case OPT_LOADGAME:
|
case OPT_LOADSAVE:
|
||||||
{
|
{
|
||||||
std::string playerAndPath = optarg;
|
std::string playerAndPath = optarg;
|
||||||
size_t pos = playerAndPath.find_first_of("/");
|
size_t pos = playerAndPath.find_first_of("/");
|
||||||
if (pos != std::string::npos && pos > 0 && pos+1 < playerAndPath.length()) // Split player name from path
|
if (pos != std::string::npos && pos > 0 && pos+1 < playerAndPath.length()) // Split player name from path
|
||||||
{
|
{
|
||||||
m_loadGamePlayerName = playerAndPath.substr(0, pos);
|
m_loadSavePlayerName = playerAndPath.substr(0, pos);
|
||||||
m_loadGameDirName = playerAndPath.substr(pos+1, playerAndPath.length()-pos-1);
|
m_loadSaveDirName = playerAndPath.substr(pos+1, playerAndPath.length()-pos-1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -717,10 +717,10 @@ bool CApplication::Create()
|
||||||
|
|
||||||
StartLoadingMusic();
|
StartLoadingMusic();
|
||||||
|
|
||||||
if (!m_loadGameDirName.empty())
|
if (!m_loadSaveDirName.empty())
|
||||||
{
|
{
|
||||||
m_controller->GetRobotMain()->SelectPlayer(m_loadGamePlayerName);
|
m_controller->GetRobotMain()->SelectPlayer(m_loadSavePlayerName);
|
||||||
m_controller->GetRobotMain()->LoadGameFromDirName(m_loadGameDirName);
|
m_controller->GetRobotMain()->LoadSaveFromDirName(m_loadSaveDirName);
|
||||||
}
|
}
|
||||||
else if (m_runSceneCategory == LevelCategory::Max)
|
else if (m_runSceneCategory == LevelCategory::Max)
|
||||||
{
|
{
|
||||||
|
|
|
@ -406,8 +406,8 @@ protected:
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
//! Game to load on startup
|
//! Game to load on startup
|
||||||
std::string m_loadGamePlayerName;
|
std::string m_loadSavePlayerName;
|
||||||
std::string m_loadGameDirName;
|
std::string m_loadSaveDirName;
|
||||||
|
|
||||||
//! Scene test mode
|
//! Scene test mode
|
||||||
bool m_sceneTest;
|
bool m_sceneTest;
|
||||||
|
|
|
@ -5839,7 +5839,7 @@ void CRobotMain::QuickLoad()
|
||||||
m_playerProfile->LoadScene(dir);
|
m_playerProfile->LoadScene(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRobotMain::LoadGameFromDirName(const std::string& gameDir)
|
void CRobotMain::LoadSaveFromDirName(const std::string& gameDir)
|
||||||
{
|
{
|
||||||
std::string dir = m_playerProfile->GetSaveFile(gameDir);
|
std::string dir = m_playerProfile->GetSaveFile(gameDir);
|
||||||
if(!CResourceManager::Exists(dir))
|
if(!CResourceManager::Exists(dir))
|
||||||
|
|
|
@ -369,7 +369,7 @@ public:
|
||||||
void SetExitAfterMission(bool exit);
|
void SetExitAfterMission(bool exit);
|
||||||
|
|
||||||
//! Load saved game (used by command line argument)
|
//! Load saved game (used by command line argument)
|
||||||
void LoadGameFromDirName(const std::string& gameDir);
|
void LoadSaveFromDirName(const std::string& gameDir);
|
||||||
|
|
||||||
//! Returns true if player can interact with things manually
|
//! Returns true if player can interact with things manually
|
||||||
bool CanPlayerInteract();
|
bool CanPlayerInteract();
|
||||||
|
|
Loading…
Reference in New Issue