fix: Template pattern types being placeable using right click menu

This commit is contained in:
WerWolv
2023-01-04 15:50:37 +01:00
parent 45bb9e6706
commit e529a79ddb
2 changed files with 3 additions and 2 deletions

View File

@@ -928,7 +928,8 @@ namespace hex::plugin::builtin {
ImGui::EndMenu();
}
if (ImGui::BeginMenu("hex.builtin.view.pattern_editor.menu.edit.place_pattern.custom"_lang, !types.empty())) {
bool hasPlaceableTypes = std::any_of(types.begin(), types.end(), [](const auto &type) { return !type.second->isTemplateType(); });
if (ImGui::BeginMenu("hex.builtin.view.pattern_editor.menu.edit.place_pattern.custom"_lang, hasPlaceableTypes)) {
for (const auto &[typeName, type] : types) {
if (type->isTemplateType())
continue;