fix: User folders being added twice
This commit is contained in:
parent
aea9bab853
commit
baa3cfb354
@ -101,6 +101,7 @@ namespace hex::plugin::builtin {
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
for (size_t n = 0; n < m_paths.size(); n++) {
|
for (size_t n = 0; n < m_paths.size(); n++) {
|
||||||
|
ImGui::PushID(n + 1);
|
||||||
const bool isSelected = (m_itemIndex == n);
|
const bool isSelected = (m_itemIndex == n);
|
||||||
if (ImGui::Selectable(wolv::util::toUTF8String(m_paths[n]).c_str(), isSelected)) {
|
if (ImGui::Selectable(wolv::util::toUTF8String(m_paths[n]).c_str(), isSelected)) {
|
||||||
m_itemIndex = n;
|
m_itemIndex = n;
|
||||||
@ -109,6 +110,8 @@ namespace hex::plugin::builtin {
|
|||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
ImGui::SetItemDefaultFocus();
|
ImGui::SetItemDefaultFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::PopID();
|
||||||
}
|
}
|
||||||
ImGui::EndListBox();
|
ImGui::EndListBox();
|
||||||
}
|
}
|
||||||
@ -146,6 +149,7 @@ namespace hex::plugin::builtin {
|
|||||||
if (data.is_array()) {
|
if (data.is_array()) {
|
||||||
std::vector<std::string> pathStrings = data;
|
std::vector<std::string> pathStrings = data;
|
||||||
|
|
||||||
|
m_paths.clear();
|
||||||
for (const auto &pathString : pathStrings) {
|
for (const auto &pathString : pathStrings) {
|
||||||
m_paths.emplace_back(pathString);
|
m_paths.emplace_back(pathString);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user