Skip to content

Commit

Permalink
feat: group not loaded features in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
FlayaN committed Dec 7, 2024
1 parent 8c7a40c commit 375d026
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,17 +498,25 @@ void Menu::DrawSettings()
menuList.push_back("Core Features"s);
std::ranges::copy(
sortedFeatureList | std::ranges::views::filter([](Feature* feat) {
return feat->IsCore();
return feat->IsCore() && feat->loaded;
}),
std::back_inserter(menuList));

menuList.push_back("Features"s);
std::ranges::copy(
sortedFeatureList | std::ranges::views::filter([](Feature* feat) {
return !feat->IsCore();
return !feat->IsCore() && feat->loaded;
}),
std::back_inserter(menuList));

auto unloadedFeatures = sortedFeatureList | std::ranges::views::filter([](Feature* feat) {
return !feat->loaded;
});
if (std::ranges::distance(unloadedFeatures) != 0) {
menuList.push_back("Unloaded Features"s);
std::ranges::copy(unloadedFeatures, std::back_inserter(menuList));
}

ImGui::TableNextColumn();
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4());
Expand Down

0 comments on commit 375d026

Please sign in to comment.