| 4108 | ImGui::EndDisabled(); |
| 4109 | } |
| 4110 | void reshade::runtime::draw_technique_editor() |
| 4111 | { |
| 4112 | if (_reload_count != 0 && _effects.empty()) |
| 4113 | { |
| 4114 | ImGui::PushStyleColor(ImGuiCol_Text, COLOR_YELLOW); |
| 4115 | ImGui::TextWrapped(_("No effect files (.fx) found in the configured effect search paths%c"), _effect_search_paths.empty() ? '.' : ':'); |
| 4116 | for (const std::filesystem::path &search_path : _effect_search_paths) |
| 4117 | ImGui::Text(" %s", (g_reshade_base_path / search_path).lexically_normal().u8string().c_str()); |
| 4118 | ImGui::Spacing(); |
| 4119 | ImGui::TextWrapped(_("Go to the settings and configure the 'Effect search paths' option to point to the directory containing effect files, then hit 'Reload'!")); |
| 4120 | ImGui::PopStyleColor(); |
| 4121 | return; |
| 4122 | } |
| 4123 | |
| 4124 | ImGui::BeginDisabled(_is_in_preset_transition); |
| 4125 | |
| 4126 | if (!_last_reload_successful) |
| 4127 | { |
| 4128 | // Add fake items at the top for effects that failed to compile |
| 4129 | for (size_t effect_index = 0; effect_index < _effects.size(); ++effect_index) |
| 4130 | { |
| 4131 | const effect &effect = _effects[effect_index]; |
| 4132 | |
| 4133 | if (effect.compiled || effect.skipped) |
| 4134 | continue; |
| 4135 | |
| 4136 | ImGui::PushID(static_cast<int>(_technique_sorting.size() + effect_index)); |
| 4137 | |
| 4138 | ImGui::PushStyleColor(ImGuiCol_Text, COLOR_RED); |
| 4139 | ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true); |
| 4140 | |
| 4141 | { |
| 4142 | char label[128] = ""; |
| 4143 | ImFormatString(label, IM_ARRAYSIZE(label), _("[%s] failed to compile"), effect.source_file.filename().u8string().c_str()); |
| 4144 | |
| 4145 | bool value = false; |
| 4146 | ImGui::Checkbox(label, &value); |
| 4147 | } |
| 4148 | |
| 4149 | ImGui::PopItemFlag(); |
| 4150 | |
| 4151 | // Display tooltip |
| 4152 | if (!effect.errors.empty() && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_ForTooltip)) |
| 4153 | { |
| 4154 | if (ImGui::BeginTooltip()) |
| 4155 | { |
| 4156 | ImGui::TextUnformatted(effect.errors.c_str(), effect.errors.c_str() + effect.errors.size()); |
| 4157 | ImGui::EndTooltip(); |
| 4158 | } |
| 4159 | } |
| 4160 | |
| 4161 | ImGui::PopStyleColor(); |
| 4162 | |
| 4163 | // Create context menu |
| 4164 | if (ImGui::IsMouseReleased(ImGuiMouseButton_Right) && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenDisabled)) |
| 4165 | ImGui::OpenPopup("##context", ImGuiPopupFlags_MouseButtonRight); |
| 4166 | |
| 4167 | if (ImGui::BeginPopup("##context")) |
nothing calls this directly
no test coverage detected