mirror of
https://github.com/minetest/minetest.git
synced 2024-12-24 15:12:23 +01:00
Don't override the FGIMG style property if the image parameter is null
This commit is contained in:
parent
e42faae8d9
commit
b50dc43f67
@ -1835,9 +1835,6 @@ void GUIFormSpecMenu::parseImageButton(parserData* data, const std::string &elem
|
|||||||
if (type == "image_button_exit")
|
if (type == "image_button_exit")
|
||||||
spec.is_exit = true;
|
spec.is_exit = true;
|
||||||
|
|
||||||
video::ITexture *texture = 0;
|
|
||||||
texture = m_tsrc->getTexture(image_name);
|
|
||||||
|
|
||||||
GUIButtonImage *e = GUIButtonImage::addButton(Environment, rect, this, spec.fid, spec.flabel.c_str());
|
GUIButtonImage *e = GUIButtonImage::addButton(Environment, rect, this, spec.fid, spec.flabel.c_str());
|
||||||
|
|
||||||
if (spec.fname == data->focused_fieldname) {
|
if (spec.fname == data->focused_fieldname) {
|
||||||
@ -1849,8 +1846,12 @@ void GUIFormSpecMenu::parseImageButton(parserData* data, const std::string &elem
|
|||||||
|
|
||||||
// We explicitly handle these arguments *after* the style properties in
|
// We explicitly handle these arguments *after* the style properties in
|
||||||
// order to override them if they are provided
|
// order to override them if they are provided
|
||||||
e->setForegroundImage(guiScalingImageButton(
|
if (!image_name.empty())
|
||||||
Environment->getVideoDriver(), texture, geom.X, geom.Y));
|
{
|
||||||
|
video::ITexture *texture = m_tsrc->getTexture(image_name);
|
||||||
|
e->setForegroundImage(guiScalingImageButton(
|
||||||
|
Environment->getVideoDriver(), texture, geom.X, geom.Y));
|
||||||
|
}
|
||||||
if (!pressed_image_name.empty()) {
|
if (!pressed_image_name.empty()) {
|
||||||
video::ITexture *pressed_texture = m_tsrc->getTexture(pressed_image_name);
|
video::ITexture *pressed_texture = m_tsrc->getTexture(pressed_image_name);
|
||||||
e->setPressedForegroundImage(guiScalingImageButton(
|
e->setPressedForegroundImage(guiScalingImageButton(
|
||||||
|
Loading…
Reference in New Issue
Block a user