fix: Language setting not defaulting to English anymore

This commit is contained in:
WerWolv
2023-10-22 17:31:53 +02:00
parent beca8033cf
commit c51db87c34
3 changed files with 14 additions and 4 deletions

View File

@@ -289,15 +289,22 @@ namespace hex {
void DropDown::load(const nlohmann::json &data) {
this->m_value = 0;
int defaultItemIndex = 0;
int index = 0;
for (const auto &item : this->m_settingsValues) {
if (item == this->m_defaultItem)
defaultItemIndex = index;
if (item == data) {
this->m_value = index;
break;
return;
}
index += 1;
}
this->m_value = defaultItemIndex;
}
nlohmann::json DropDown::store() {