mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-01-31 07:20:14 -05:00
sort patch otrs (#3430)
This commit is contained in:
parent
9d215b6dce
commit
621afc99f0
@ -253,15 +253,26 @@ OTRGlobals::OTRGlobals() {
|
|||||||
OTRFiles.push_back(sohOtrPath);
|
OTRFiles.push_back(sohOtrPath);
|
||||||
}
|
}
|
||||||
std::string patchesPath = LUS::Context::LocateFileAcrossAppDirs("mods", appShortName);
|
std::string patchesPath = LUS::Context::LocateFileAcrossAppDirs("mods", appShortName);
|
||||||
|
std::vector<std::string> patchOTRs = {};
|
||||||
if (patchesPath.length() > 0 && std::filesystem::exists(patchesPath)) {
|
if (patchesPath.length() > 0 && std::filesystem::exists(patchesPath)) {
|
||||||
if (std::filesystem::is_directory(patchesPath)) {
|
if (std::filesystem::is_directory(patchesPath)) {
|
||||||
for (const auto& p : std::filesystem::recursive_directory_iterator(patchesPath, std::filesystem::directory_options::follow_directory_symlink)) {
|
for (const auto& p : std::filesystem::recursive_directory_iterator(patchesPath, std::filesystem::directory_options::follow_directory_symlink)) {
|
||||||
if (StringHelper::IEquals(p.path().extension().string(), ".otr")) {
|
if (StringHelper::IEquals(p.path().extension().string(), ".otr")) {
|
||||||
OTRFiles.push_back(p.path().generic_string());
|
patchOTRs.push_back(p.path().generic_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
std::sort(patchOTRs.begin(), patchOTRs.end(), [](const std::string& a, const std::string& b) {
|
||||||
|
return std::lexicographical_compare(
|
||||||
|
a.begin(), a.end(),
|
||||||
|
b.begin(), b.end(),
|
||||||
|
[](char c1, char c2) {
|
||||||
|
return std::tolower(c1) < std::tolower(c2);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
OTRFiles.insert(OTRFiles.end(), patchOTRs.begin(), patchOTRs.end());
|
||||||
std::unordered_set<uint32_t> ValidHashes = {
|
std::unordered_set<uint32_t> ValidHashes = {
|
||||||
OOT_PAL_MQ,
|
OOT_PAL_MQ,
|
||||||
OOT_NTSC_JP_MQ,
|
OOT_NTSC_JP_MQ,
|
||||||
|
Loading…
Reference in New Issue
Block a user