diff --git a/sparkapi/lua/api.lua b/sparkapi/lua/api.lua deleted file mode 100644 index 798ded1..0000000 --- a/sparkapi/lua/api.lua +++ /dev/null @@ -1,2 +0,0 @@ -sparktech = {} --- api starts with an a, should load first, if you split out any of the files in this dir into other stuff remember to declare this diff --git a/sparkapi/lua/formspec.lua b/sparkapi/lua/formspec.lua index 9ba11e8..036fd42 100644 --- a/sparkapi/lua/formspec.lua +++ b/sparkapi/lua/formspec.lua @@ -1,7 +1,7 @@ local DEFAULT_BG_COLOR = "fc05e344" local DEFAULT_FG_COLOR = "fc059dd0" local DEFAULT_HL_COLOR = "fc059db0" - +if not sparktech then sparktech = {} end function sparktech.makebar(texture, posx, posy, sizex, sizey, value, maxvalue, direction) -- direction = where to cut the texture either from thr right(0), below(1) left(2) or above (3) -- default is right(0) @@ -38,7 +38,12 @@ function sparktech.add_inventory(size_x, size_y, formspec) -- pass an unfinished local bg_color = verify_hexcolor_or_nil(minetest.settings:get("spark_gui_background")) or DEFAULT_BG_COLOR local fg_color = verify_hexcolor_or_nil(minetest.settings:get("spark_gui_foreground")) or DEFAULT_FG_COLOR local fg_highlight = verify_hexcolor_or_nil(minetest.settings:get("spark_gui_highlight")) or DEFAULT_HL_COLOR - + local gui_immersive + if minetest.settings:get("spark_gui_full") then + gui_immersive = "true" + else + gui_immersive = "false" + end if not size_x or size_x < 13.9 then size_x = 13.9 end if not size_y or size_y < 0 then size_y = 0 end local l_formspec = "size[" .. tostring(size_x) .. "," .. (size_y + 4.8) .. "]" .. @@ -48,7 +53,7 @@ function sparktech.add_inventory(size_x, size_y, formspec) -- pass an unfinished "list[current_player;craft;10.4," .. size_y .. ";3,3]" .. "list[current_player;craftpreview;10.4," .. (size_y + 3.8) .. ";1,1]" .. "listcolors[#" .. fg_color .. ";#" .. fg_highlight .. "]" .. - "bgcolor[#" .. bg_color .. ";false]" + "bgcolor[#" .. bg_color .. ";" .. gui_immersive .. "]" if not formspec then formspec = "" end l_formspec = l_formspec .. formspec return l_formspec diff --git a/sparkapi/lua/tool.lua b/sparkapi/lua/tool.lua index c85a7ad..fc35c04 100644 --- a/sparkapi/lua/tool.lua +++ b/sparkapi/lua/tool.lua @@ -1,3 +1,4 @@ +if not sparktech then sparktech = {} end function sparktech.register_wrench(name, dictionary) local dig_stlye_alt = minetest.settings:get_bool("spark_dig_stlye_alt") local on_use = nil diff --git a/sparkapi/settingtypes.txt b/sparkapi/settingtypes.txt index 8e60351..b031418 100644 --- a/sparkapi/settingtypes.txt +++ b/sparkapi/settingtypes.txt @@ -1,3 +1,4 @@ spark_gui_background (GUI background color ) string fc05e344 spark_gui_foreground (GUI foreground color ) string fc059dd0 spark_gui_highlight (GUI highlight color ) string fc059db0 +spark_gui_full (GUI Full background ) bool false