aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Ross <hugues.ross@gmail.com>2019-12-14 18:09:27 -0500
committersfan5 <sfan5@live.de>2019-12-16 19:26:57 +0100
commitb50dc43f67332e24c93dd8ea8edb8654d4753b11 (patch)
tree99577955ef70c8563399eab97ee853840520ca7e
parente42faae8d9db2381295fcbc85c860d328a3fe121 (diff)
downloadminetest-b50dc43f67332e24c93dd8ea8edb8654d4753b11.tar.gz
minetest-b50dc43f67332e24c93dd8ea8edb8654d4753b11.tar.bz2
minetest-b50dc43f67332e24c93dd8ea8edb8654d4753b11.zip
Don't override the FGIMG style property if the image parameter is null
-rw-r--r--src/gui/guiFormSpecMenu.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index 320608642..e6cd50d86 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -1835,9 +1835,6 @@ void GUIFormSpecMenu::parseImageButton(parserData* data, const std::string &elem
if (type == "image_button_exit")
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());
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
// order to override them if they are provided
- e->setForegroundImage(guiScalingImageButton(
- Environment->getVideoDriver(), texture, geom.X, geom.Y));
+ if (!image_name.empty())
+ {
+ video::ITexture *texture = m_tsrc->getTexture(image_name);
+ e->setForegroundImage(guiScalingImageButton(
+ Environment->getVideoDriver(), texture, geom.X, geom.Y));
+ }
if (!pressed_image_name.empty()) {
video::ITexture *pressed_texture = m_tsrc->getTexture(pressed_image_name);
e->setPressedForegroundImage(guiScalingImageButton(