1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

- fixed save games issues (#1044)

- hopefully some speedup for filesystem loading (#1048)
This commit is contained in:
Ivan Savenko
2012-08-07 11:28:52 +00:00
parent 708ad6ac7f
commit 8040a81eec
17 changed files with 268 additions and 283 deletions

View File

@@ -843,13 +843,13 @@ void CSelectionScreen::startGame()
if(!(sel && sel->txt && sel->txt->text.size()))
return;
selectedName = GVCMIDirs.UserPath + "/Games/" + sel->txt->text + ".vlgm1";
selectedName = "Saves/" + sel->txt->text;
CFunctionList<void()> overWrite;
overWrite += boost::bind(&CCallback::save, LOCPLINT->cb, sel->txt->text);
overWrite += boost::bind(&CCallback::save, LOCPLINT->cb, selectedName);
overWrite += bind(&CGuiHandler::popIntTotally, &GH, this);
if(fs::exists(selectedName))
if(CResourceHandler::get()->existsResource(ResourceID(selectedName, EResType::LIB_SAVEGAME)))
{
std::string hlp = CGI->generaltexth->allTexts[493]; //%s exists. Overwrite?
boost::algorithm::replace_first(hlp, "%s", sel->txt->text);
@@ -857,9 +857,6 @@ void CSelectionScreen::startGame()
}
else
overWrite();
// LOCPLINT->cb->save(sel->txt->text);
// GH.popIntTotally(this);
}
}
@@ -1417,7 +1414,8 @@ void SelectionTab::printMaps(SDL_Surface *to)
}
else
{
name = fs::basename(currentItem->fileURI);
name = CFileInfo(CResourceHandler::get()->getResourceName(
ResourceID(currentItem->fileURI, EResType::LIB_SAVEGAME))).getBaseName();
}
//print name