HPL1: change save file name pattern

This commit is contained in:
grisenti 2022-08-20 18:44:23 +02:00 committed by Eugene Sandulenko
parent 02caa68e79
commit 7c80f99276
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
3 changed files with 9 additions and 9 deletions

View File

@ -104,7 +104,7 @@ void cDeathMenuButton::OnMouseOver(bool abOver) {
//-----------------------------------------------------------------------
void cDeathMenuButton_Continue::OnMouseDown() {
tWString save = mpInit->mpSaveHandler->GetLatest(_W("save-????.*.sav"));
tWString save = mpInit->mpSaveHandler->GetLatest(_W("hpl1-po-????.*.sav"));
if (save != _W(""))
mpInit->mpSaveHandler->LoadGameFromFile(save);
}
@ -301,7 +301,7 @@ void cDeathMenu::SetActive(bool abX) {
STLDeleteAll(mlstButtons);
// Continue
tWString latestSave = mpInit->mpSaveHandler->GetLatest(_W("save-????.*.sav"));
tWString latestSave = mpInit->mpSaveHandler->GetLatest(_W("hpl1-po-????.*.sav"));
if (latestSave != _W("")) {
mlstButtons.push_back(hplNew(cDeathMenuButton_Continue, (mpInit, cVector2f(400, 290), kTranslate("DeathMenu", "Continue"))));
}

View File

@ -634,7 +634,7 @@ void cMainMenuWidget_Continue::OnMouseDown(eMButton aButton) {
mpInit->mpMainMenu->SetActive(false);
tWString latestSave = mpInit->mpSaveHandler->GetLatest(_W("save-????.*.sav"));
tWString latestSave = mpInit->mpSaveHandler->GetLatest(_W("hpl1-po-????.*.sav"));
if (latestSave != _W(""))
mpInit->mpSaveHandler->LoadGameFromFile(latestSave);
}
@ -2480,7 +2480,7 @@ void cMainMenu::CreateWidgets() {
AddWidgetToState(eMainMenuState_Start, hplNew(cMainMenuWidget_Resume, (mpInit, vPos, kTranslate("MainMenu", "Resume"))));
vPos.y += 60;
} else {
tWString latestSave = mpInit->mpSaveHandler->GetLatest(_W("save-????.*.sav"));
tWString latestSave = mpInit->mpSaveHandler->GetLatest(_W("hpl1-po-????.*.sav"));
if (latestSave != _W("")) {
AddWidgetToState(eMainMenuState_Start, hplNew(cMainMenuWidget_MainButton, (mpInit, vPos, kTranslate("MainMenu", "Continue"), eMainMenuState_Continue)));
@ -2577,11 +2577,11 @@ void cMainMenu::CreateWidgets() {
vPos.y += 46 + 30;
vPos.x += 15;
tWString sDir = _W("save-spot");
tWString sDir = _W("hpl1-po-spot");
if (i == 1)
sDir = _W("save-auto");
sDir = _W("hpl1-po-auto");
else if (i == 2)
sDir = _W("save-favorite");
sDir = _W("hpl1-po-favorite");
gpSaveGameList[i] = hplNew(cMainMenuWidget_SaveGameList, (
mpInit, vPos, cVector2f(355, 170), 15, sDir, (int)i));

View File

@ -610,7 +610,7 @@ void cSaveHandler::AutoSave(const tWString &asDir, int alMaxSaves) {
sMapName = cString::ReplaceCharToW(sMapName, _W(":"), _W(" "));
cDate date = mpInit->mpGame->GetSystem()->GetLowLevel()->getDate();
wchar_t sTemp[512];
swprintf(sTemp, 512, _W("save-%ls.%ls %d-%02d-%02d_%02d.%02d.%02d_%02d.sav"),
swprintf(sTemp, 512, _W("hpl1-po-%ls.%ls %d-%02d-%02d_%02d.%02d.%02d_%02d.sav"),
asDir.c_str(),
sMapName.c_str(),
date.year,
@ -629,7 +629,7 @@ void cSaveHandler::AutoSave(const tWString &asDir, int alMaxSaves) {
//-----------------------------------------------------------------------
void cSaveHandler::AutoLoad(const tWString &asDir) {
tWString latestSave = GetLatest(_W("save-") + asDir + _W(".*.sav"));
tWString latestSave = GetLatest(_W("hpl1-po-") + asDir + _W(".*.sav"));
LoadGameFromFile(latestSave);
mpInit->mpGame->ResetLogicTimer();
}