File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
plugins/builtin/source/content Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -482,6 +482,17 @@ namespace hex::plugin::builtin {
482482 ContentRegistry::UserInterface::addToolbarItem ([] {
483483
484484 for (const auto &menuItem : ContentRegistry::UserInterface::impl::getToolbarMenuItems ()) {
485+ // Remove invalid toolbar items from the toolbar
486+ if (menuItem == nullptr )
487+ continue ;
488+ if (menuItem->unlocalizedNames .empty () || menuItem->icon .glyph .empty ()) {
489+ menuItem->toolbarIndex = -1 ;
490+ continue ;
491+ }
492+
493+ ImGui::PushID (menuItem);
494+ ON_SCOPE_EXIT { ImGui::PopID (); };
495+
485496 const auto &unlocalizedItemName = menuItem->unlocalizedNames .back ();
486497 if (unlocalizedItemName.get () == ContentRegistry::UserInterface::impl::SeparatorValue) {
487498 ImGui::SeparatorEx (ImGuiSeparatorFlags_Vertical);
You can’t perform that action at this time.
0 commit comments