Fix error message caused by adding new parameter to background (#8922)
authorrubenwardy <rw@rubenwardy.com>
Sun, 29 Sep 2019 11:40:59 +0000 (12:40 +0100)
committerSmallJoker <SmallJoker@users.noreply.github.com>
Sun, 29 Sep 2019 11:40:59 +0000 (13:40 +0200)
Adds background9[] element to keep backwards compatibility in formspec prepends.

doc/lua_api.txt
src/gui/guiFormSpecMenu.cpp

index cefc535699ea5c0138fb88ee7fec686f9d716210..b4cf65e54646eba2cd09dcfb24fdcd0d5a6f17cb 100644 (file)
@@ -2114,7 +2114,7 @@ Elements
 * If `auto_clip` is `true`, the background is clipped to the formspec size
   (`x` and `y` are used as offset values, `w` and `h` are ignored)
 
-### `background[<X>,<Y>;<W>,<H>;<texture name>;<auto_clip>;<middle>]`
+### `background9[<X>,<Y>;<W>,<H>;<texture name>;<auto_clip>;<middle>]`
 
 * 9-sliced background. See https://en.wikipedia.org/wiki/9-slice_scaling
 * Middle is a rect which defines the middle of the 9-slice.
index 390c81bc168f94c3e47283b3c48efd56992979e0..ebcc6b67e47666492cb3650d1682f1b4792fe82c 100644 (file)
@@ -2231,8 +2231,8 @@ void GUIFormSpecMenu::parseElement(parserData* data, const std::string &element)
                return;
        }
 
-       if (type == "background") {
-               parseBackground(data,description);
+       if (type == "background" || type == "background9") {
+               parseBackground(data, description);
                return;
        }