mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2024-11-24 13:49:17 +01:00
Sort configs in config menu by name
This commit is contained in:
parent
f9b67d57ea
commit
ac05cf8231
@ -12,6 +12,7 @@
|
||||
#include <coreinit/screen.h>
|
||||
#include <gx2/display.h>
|
||||
#include <memory/mappedmemory.h>
|
||||
#include <ranges>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -123,6 +124,21 @@ void ConfigUtils::displayMenu() {
|
||||
configs.emplace_back(info, std::move(config));
|
||||
}
|
||||
|
||||
// Sort Configs by name
|
||||
std::sort(
|
||||
configs.begin(),
|
||||
configs.end(),
|
||||
[](const ConfigDisplayItem &lhs, const ConfigDisplayItem &rhs) {
|
||||
auto &str1 = lhs.getConfigInformation().name;
|
||||
auto &str2 = rhs.getConfigInformation().name;
|
||||
return lexicographical_compare(
|
||||
begin(str1), end(str1),
|
||||
begin(str2), end(str2),
|
||||
[](const char &char1, const char &char2) {
|
||||
return tolower(char1) < tolower(char2);
|
||||
});
|
||||
});
|
||||
|
||||
ConfigRenderer renderer(std::move(configs));
|
||||
configs.clear();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user