Ver Fonte

Update maps sorting logic

MichalZr6 há 8 meses atrás
pai
commit
ea1c911e4d
2 ficheiros alterados com 4 adições e 2 exclusões
  1. 2 2
      client/lobby/SelectionTab.cpp
  2. 2 0
      lib/mapping/CMapInfo.cpp

+ 2 - 2
client/lobby/SelectionTab.cpp

@@ -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

+ 2 - 0
lib/mapping/CMapInfo.cpp

@@ -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();
 }