Skip to content

Commit

Permalink
fix: Template pattern types being placeable using right click menu
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Jan 4, 2023
1 parent 45bb9e6 commit e529a79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/external/pattern_language
3 changes: 2 additions & 1 deletion plugins/builtin/source/content/views/view_pattern_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e529a79

Please sign in to comment.