background_it->drop();
for (auto &tooltip_rect_it : m_tooltip_rects)
tooltip_rect_it.first->drop();
+ for (auto &clickthrough_it : m_clickthrough_elements)
+ clickthrough_it->drop();
delete m_selected_item;
delete m_form_src;
e->setNotClipped(style.getBool(StyleSpec::NOCLIP, m_formspec_version < 3));
m_fields.push_back(spec);
+ // images should let events through
+ e->grab();
+ m_clickthrough_elements.push_back(e);
return;
}
e->setNotClipped(style.getBool(StyleSpec::NOCLIP, m_formspec_version < 3));
m_fields.push_back(spec);
+ // images should let events through
+ e->grab();
+ m_clickthrough_elements.push_back(e);
return;
}
errorstream<< "Invalid image element(" << parts.size() << "): '" << element << "'" << std::endl;
core::rect<s32>(pos, pos + geom), name, m_font, m_client);
auto style = getStyleForElement("item_image", spec.fname);
e->setNotClipped(style.getBool(StyleSpec::NOCLIP, false));
- e->drop();
+
+ // item images should let events through
+ m_clickthrough_elements.push_back(e);
m_fields.push_back(spec);
return;
e->setOverrideColor(style.getColor(StyleSpec::TEXTCOLOR, video::SColor(0xFFFFFFFF)));
m_fields.push_back(spec);
+
+ // labels should let events through
+ e->grab();
+ m_clickthrough_elements.push_back(e);
}
return;
e->setOverrideColor(style.getColor(StyleSpec::TEXTCOLOR, video::SColor(0xFFFFFFFF)));
m_fields.push_back(spec);
+
+ // vertlabels should let events through
+ e->grab();
+ m_clickthrough_elements.push_back(e);
return;
}
errorstream<< "Invalid vertlabel element(" << parts.size() << "): '" << element << "'" << std::endl;
background_it->drop();
for (auto &tooltip_rect_it : m_tooltip_rects)
tooltip_rect_it.first->drop();
+ for (auto &clickthrough_it : m_clickthrough_elements)
+ clickthrough_it->drop();
mydata.size= v2s32(100,100);
mydata.screensize = screensize;
m_dropdowns.clear();
theme_by_name.clear();
theme_by_type.clear();
+ m_clickthrough_elements.clear();
m_bgnonfullscreen = true;
m_bgfullscreen = false;
e->setVisible(false);
}
+ // Some elements are only visible while being drawn
+ for (gui::IGUIElement *e : m_clickthrough_elements)
+ e->setVisible(true);
+
/*
Call base class
(This is where all the drawing happens.)
*/
gui::IGUIElement::draw();
+ for (gui::IGUIElement *e : m_clickthrough_elements)
+ e->setVisible(false);
+
// Draw hovered item tooltips
for (const std::string &tooltip : m_hovered_item_tooltips) {
showTooltip(utf8_to_wide(tooltip), m_default_tooltip_color,