mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-10 22:31:40 +02:00
Update maps sorting logic
This commit is contained in:
@@ -114,13 +114,13 @@ bool mapSorter::operator()(const std::shared_ptr<ElementInfo> aaa, const std::sh
|
||||
return (a->victoryIconIndex < b->victoryIconIndex);
|
||||
break;
|
||||
case _name: //by name
|
||||
return boost::ilexicographical_compare(a->name.toString(), b->name.toString());
|
||||
return aaa->name < bbb->name;
|
||||
case _fileName: //by filename
|
||||
return boost::ilexicographical_compare(aaa->fileURI, bbb->fileURI);
|
||||
case _changeDate: //by changedate
|
||||
return aaa->lastWrite < bbb->lastWrite;
|
||||
default:
|
||||
return boost::ilexicographical_compare(a->name.toString(), b->name.toString());
|
||||
return aaa->name < bbb->name;
|
||||
}
|
||||
}
|
||||
else //if we are sorting campaigns
|
||||
|
@@ -48,6 +48,8 @@ void CMapInfo::mapInit(const std::string & fname)
|
||||
originalFileURI = resource.getOriginalName();
|
||||
fullFileURI = boost::filesystem::canonical(*CResourceHandler::get()->getResourceName(resource)).string();
|
||||
mapHeader = mapService.loadMapHeader(resource);
|
||||
lastWrite = boost::filesystem::last_write_time(*CResourceHandler::get()->getResourceName(resource));
|
||||
date = TextOperations::getFormattedDateTimeLocal(lastWrite);
|
||||
countPlayers();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user