From baa3cfb35465d7982b6eb7317136e8694f8ca490 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 4 Jan 2025 18:30:57 +0100 Subject: [PATCH] fix: User folders being added twice --- plugins/builtin/source/content/settings_entries.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/builtin/source/content/settings_entries.cpp b/plugins/builtin/source/content/settings_entries.cpp index 7cffca949..a96cd942d 100644 --- a/plugins/builtin/source/content/settings_entries.cpp +++ b/plugins/builtin/source/content/settings_entries.cpp @@ -101,6 +101,7 @@ namespace hex::plugin::builtin { return false; } else { for (size_t n = 0; n < m_paths.size(); n++) { + ImGui::PushID(n + 1); const bool isSelected = (m_itemIndex == n); if (ImGui::Selectable(wolv::util::toUTF8String(m_paths[n]).c_str(), isSelected)) { m_itemIndex = n; @@ -109,6 +110,8 @@ namespace hex::plugin::builtin { if (isSelected) { ImGui::SetItemDefaultFocus(); } + + ImGui::PopID(); } ImGui::EndListBox(); } @@ -146,6 +149,7 @@ namespace hex::plugin::builtin { if (data.is_array()) { std::vector pathStrings = data; + m_paths.clear(); for (const auto &pathString : pathStrings) { m_paths.emplace_back(pathString); }