summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2019-10-06 14:50:45 +0200
committerGitHub <noreply@github.com>2019-10-06 14:50:45 +0200
commitdee22104b7a9220e365f5d3aa95e2fd20cebfcf5 (patch)
treef3fd5dfffe8de67fd8747dcf79f86ed07350a352 /src
parentdde062897657d43161b33739a79481cbd6b0baad (diff)
downloadminetest-dee22104b7a9220e365f5d3aa95e2fd20cebfcf5.tar.gz
minetest-dee22104b7a9220e365f5d3aa95e2fd20cebfcf5.tar.bz2
minetest-dee22104b7a9220e365f5d3aa95e2fd20cebfcf5.zip
Revert "Fix the bgcolor formspec element (#8716)" (#9018)
This reverts commit 1db3d252cff9e8d61fecf1052d7497813851da51. Temporary solution until a compatible solution is found to define both - formspec and fullscreen backgrounds.
Diffstat (limited to 'src')
-rw-r--r--src/gui/guiFormSpecMenu.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index 9dacf37d7..aee7da869 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -1885,17 +1885,17 @@ void GUIFormSpecMenu::parseBox(parserData* data, const std::string &element)
errorstream<< "Invalid Box element(" << parts.size() << "): '" << element << "'" << std::endl;
}
-void GUIFormSpecMenu::parseBackgroundColor(parserData *data, const std::string &element)
+void GUIFormSpecMenu::parseBackgroundColor(parserData* data, const std::string &element)
{
std::vector<std::string> parts = split(element,';');
if (((parts.size() == 1) || (parts.size() == 2)) ||
((parts.size() > 2) && (m_formspec_version > FORMSPEC_API_VERSION))) {
- if (parts.size() == 1) {
- parseColorString(parts[0], m_bgcolor, false);
- } else if (parts.size() == 2) {
- parseColorString(parts[0], m_fullscreen_bgcolor, false);
- m_bgfullscreen = is_yes(parts[1]);
+ parseColorString(parts[0], m_bgcolor, false);
+
+ if (parts.size() == 2) {
+ std::string fullscreen = parts[1];
+ m_bgfullscreen = is_yes(fullscreen);
}
return;
@@ -2925,7 +2925,8 @@ void GUIFormSpecMenu::drawMenu()
if (m_bgfullscreen)
driver->draw2DRectangle(m_fullscreen_bgcolor, allbg, &allbg);
- driver->draw2DRectangle(m_bgcolor, AbsoluteRect, &AbsoluteClippingRect);
+ else
+ driver->draw2DRectangle(m_bgcolor, AbsoluteRect, &AbsoluteClippingRect);
m_tooltip_element->setVisible(false);