1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Merge branch 'PregameCache' into develop

This commit is contained in:
AlexVinS 2016-11-03 17:10:54 +03:00
commit 9e366df70f

View File

@ -1088,9 +1088,9 @@ void SelectionTab::filter( int size, bool selectFirst )
{
slider->moveTo(0);
onSelect(curItems[0]);
}
selectAbs(0);
}
}
else
{
slider->block(true);
@ -1304,16 +1304,24 @@ SelectionTab::SelectionTab(CMenuScreen::EState Type, const std::function<void(CM
switch(tabType)
{
case CMenuScreen::newGame:
logGlobal->error(settings["session"]["lastMap"].String());
if(settings["session"]["lastMap"].isNull())
selectFName("Maps/Arrogance");
else
selectFName(settings["session"]["lastMap"].String());
break;
case CMenuScreen::loadGame:
case CMenuScreen::campaignList:
select(0);
break;
case CMenuScreen::loadGame:
case CMenuScreen::saveGame:;
if(saveGameName.empty())
{
if(tabType == CMenuScreen::saveGame)
txt->setText("NEWGAME");
else
select(0);
}
else
{
@ -1371,6 +1379,12 @@ void SelectionTab::select( int position )
else if(position >= positions)
slider->moveBy(position - positions + 1);
if(tabType == CMenuScreen::newGame)
{
Settings lastMap = settings.write["session"]["lastMap"];
lastMap->String() = getSelectedMapInfo()->fileURI;
}
if(txt)
{
auto filename = *CResourceHandler::get("local")->getResourceName(