From 9ced56fd670140b49401a001023e363c668d545b Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Wed, 7 Mar 2018 16:37:20 +0000 Subject: [PATCH] Fix crash when running with formspec_prepend support --- api.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/api.lua b/api.lua index c2c45a0..cc1bde5 100644 --- a/api.lua +++ b/api.lua @@ -5,10 +5,14 @@ sfinv = { enabled = true } -if not minetest.features.formspec_prepends then - sfinv.gui_bg = "bgcolor[#080808BB;true]" +if minetest.features.formspec_prepends then + sfinv.gui_bg = "" + sfinv.gui_bg_img = "" + sfinv.gui_slots = "" +else + sfinv.gui_bg = "bgcolor[#080808BB;true]" sfinv.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]" - sfinv.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]" + sfinv.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]" end function sfinv.register_page(name, def)