From 375d0268c84a05b4b14378bc9fbf3c340af85628 Mon Sep 17 00:00:00 2001 From: FlayaN Date: Sat, 7 Dec 2024 00:50:14 +0100 Subject: [PATCH] feat: group not loaded features in UI --- src/Menu.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Menu.cpp b/src/Menu.cpp index 6d2ffafdb..fff9f5218 100644 --- a/src/Menu.cpp +++ b/src/Menu.cpp @@ -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());