From 1a488853607fad0a76fad172a9d5aa253df64ee3 Mon Sep 17 00:00:00 2001 From: hotline1337 Date: Wed, 13 Dec 2023 12:43:35 +0100 Subject: [PATCH] Feature Request: #645 --- R3nzSkin/SkinDatabase.cpp | 12 ++++++++++-- R3nzSkin/SkinDatabase.hpp | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/R3nzSkin/SkinDatabase.cpp b/R3nzSkin/SkinDatabase.cpp index c6461b5d..6013b0d1 100644 --- a/R3nzSkin/SkinDatabase.cpp +++ b/R3nzSkin/SkinDatabase.cpp @@ -37,7 +37,8 @@ void SkinDatabase::load() noexcept const auto champ_name{ fnv::hash_runtime(champion->champion_name.str) }; this->champions_skins[champ_name].push_back({ champion->champion_name.str, skin_display_name_translated, i }); - if (i == 7 && champ_name == FNV("Lux")) { + if (i == 7 && champ_name == FNV("Lux")) + { this->champions_skins[champ_name].push_back({ "LuxAir", "Elementalist Air Lux", i }); this->champions_skins[champ_name].push_back({ "LuxDark", "Elementalist Dark Lux", i }); this->champions_skins[champ_name].push_back({ "LuxFire", "Elementalist Fire Lux", i }); @@ -47,7 +48,9 @@ void SkinDatabase::load() noexcept this->champions_skins[champ_name].push_back({ "LuxNature", "Elementalist Nature Lux", i }); this->champions_skins[champ_name].push_back({ "LuxStorm", "Elementalist Storm Lux", i }); this->champions_skins[champ_name].push_back({ "LuxWater", "Elementalist Water Lux", i }); - } else if (i == 6 && champ_name == FNV("Sona")) { + } + else if (i == 6 && champ_name == FNV("Sona")) + { this->champions_skins[champ_name].push_back({ "SonaDJGenre02", "DJ Sona 2", i }); this->champions_skins[champ_name].push_back({ "SonaDJGenre03", "DJ Sona 3", i }); } @@ -63,4 +66,9 @@ void SkinDatabase::load() noexcept this->wards_skins.emplace_back(ward_skin_id, ward_display_name_translated); } + + /* sort wards */ + std::ranges::sort(this->wards_skins, [](const auto& a, const auto& b) { + return std::strong_ordering::less == std::strcmp(a.second, b.second) <=> 0; + }); } diff --git a/R3nzSkin/SkinDatabase.hpp b/R3nzSkin/SkinDatabase.hpp index 83984dcd..00cee4f1 100644 --- a/R3nzSkin/SkinDatabase.hpp +++ b/R3nzSkin/SkinDatabase.hpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "fnv_hash.hpp"