| 3248 | } |
| 3249 | #if RESHADE_ADDON |
| 3250 | void reshade::runtime::draw_gui_addons() |
| 3251 | { |
| 3252 | ini_file &config = global_config(); |
| 3253 | |
| 3254 | #if RESHADE_ADDON == 1 |
| 3255 | if (!addon_enabled) |
| 3256 | { |
| 3257 | ImGui::PushTextWrapPos(); |
| 3258 | ImGui::TextColored(COLOR_YELLOW, _("High network activity discovered.\nAll add-ons are disabled to prevent exploitation.")); |
| 3259 | ImGui::PopTextWrapPos(); |
| 3260 | return; |
| 3261 | } |
| 3262 | |
| 3263 | ImGui::AlignTextToFramePadding(); |
| 3264 | ImGui::TextUnformatted(_("This build of ReShade has only limited add-on functionality.")); |
| 3265 | #else |
| 3266 | std::filesystem::path addon_search_path = L".\\"; |
| 3267 | config.get("ADDON", "AddonPath", addon_search_path); |
| 3268 | if (imgui::directory_input_box(_("Add-on search path"), addon_search_path, _file_selection_path)) |
| 3269 | config.set("ADDON", "AddonPath", addon_search_path); |
| 3270 | #endif |
| 3271 | |
| 3272 | ImGui::Spacing(); |
| 3273 | ImGui::Separator(); |
| 3274 | ImGui::Spacing(); |
| 3275 | |
| 3276 | imgui::search_input_box(_addons_filter, sizeof(_addons_filter)); |
| 3277 | |
| 3278 | ImGui::Spacing(); |
| 3279 | |
| 3280 | if (!addon_all_loaded) |
| 3281 | { |
| 3282 | ImGui::PushTextWrapPos(); |
| 3283 | #if RESHADE_ADDON == 1 |
| 3284 | ImGui::TextColored(COLOR_YELLOW, _("Some add-ons were not loaded because this build of ReShade has only limited add-on functionality.")); |
| 3285 | #else |
| 3286 | ImGui::PushStyleColor(ImGuiCol_Text, COLOR_RED); |
| 3287 | ImGui::TextUnformatted(_("There were errors loading some add-ons.")); |
| 3288 | ImGui::TextUnformatted(_("Check the log for more details.")); |
| 3289 | ImGui::PopStyleColor(); |
| 3290 | #endif |
| 3291 | ImGui::PopTextWrapPos(); |
| 3292 | ImGui::Spacing(); |
| 3293 | } |
| 3294 | |
| 3295 | if (ImGui::BeginChild("##addons", ImVec2(0, -(ImGui::GetFrameHeightWithSpacing() + _imgui_context->Style.ItemSpacing.y)), ImGuiChildFlags_NavFlattened)) |
| 3296 | { |
| 3297 | std::vector<std::string> disabled_addons; |
| 3298 | config.get("ADDON", "DisabledAddons", disabled_addons); |
| 3299 | std::vector<std::string> collapsed_or_expanded_addons; |
| 3300 | config.get("ADDON", "OverlayCollapsed", collapsed_or_expanded_addons); |
| 3301 | |
| 3302 | const float child_window_width = ImGui::GetContentRegionAvail().x; |
| 3303 | |
| 3304 | for (addon_info &info : addon_loaded_info) |
| 3305 | { |
| 3306 | if (!string_contains(info.name, _addons_filter)) |
| 3307 | continue; |
nothing calls this directly
no test coverage detected