added immersive formspec (and fixed potential unitiliazed array access)
This commit is contained in:
parent
e42bc90b47
commit
27f1942e3d
@ -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
|
|
@ -1,7 +1,7 @@
|
|||||||
local DEFAULT_BG_COLOR = "fc05e344"
|
local DEFAULT_BG_COLOR = "fc05e344"
|
||||||
local DEFAULT_FG_COLOR = "fc059dd0"
|
local DEFAULT_FG_COLOR = "fc059dd0"
|
||||||
local DEFAULT_HL_COLOR = "fc059db0"
|
local DEFAULT_HL_COLOR = "fc059db0"
|
||||||
|
if not sparktech then sparktech = {} end
|
||||||
function sparktech.makebar(texture, posx, posy, sizex, sizey, value, maxvalue, direction)
|
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)
|
-- direction = where to cut the texture either from thr right(0), below(1) left(2) or above (3)
|
||||||
-- default is right(0)
|
-- 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 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_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 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_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
|
if not size_y or size_y < 0 then size_y = 0 end
|
||||||
local l_formspec = "size[" .. tostring(size_x) .. "," .. (size_y + 4.8) .. "]" ..
|
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;craft;10.4," .. size_y .. ";3,3]" ..
|
||||||
"list[current_player;craftpreview;10.4," .. (size_y + 3.8) .. ";1,1]" ..
|
"list[current_player;craftpreview;10.4," .. (size_y + 3.8) .. ";1,1]" ..
|
||||||
"listcolors[#" .. fg_color .. ";#" .. fg_highlight .. "]" ..
|
"listcolors[#" .. fg_color .. ";#" .. fg_highlight .. "]" ..
|
||||||
"bgcolor[#" .. bg_color .. ";false]"
|
"bgcolor[#" .. bg_color .. ";" .. gui_immersive .. "]"
|
||||||
if not formspec then formspec = "" end
|
if not formspec then formspec = "" end
|
||||||
l_formspec = l_formspec .. formspec
|
l_formspec = l_formspec .. formspec
|
||||||
return l_formspec
|
return l_formspec
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
if not sparktech then sparktech = {} end
|
||||||
function sparktech.register_wrench(name, dictionary)
|
function sparktech.register_wrench(name, dictionary)
|
||||||
local dig_stlye_alt = minetest.settings:get_bool("spark_dig_stlye_alt")
|
local dig_stlye_alt = minetest.settings:get_bool("spark_dig_stlye_alt")
|
||||||
local on_use = nil
|
local on_use = nil
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
spark_gui_background (GUI background color <RGBA>) string fc05e344
|
spark_gui_background (GUI background color <RGBA>) string fc05e344
|
||||||
spark_gui_foreground (GUI foreground color <RGBA>) string fc059dd0
|
spark_gui_foreground (GUI foreground color <RGBA>) string fc059dd0
|
||||||
spark_gui_highlight (GUI highlight color <RGBA>) string fc059db0
|
spark_gui_highlight (GUI highlight color <RGBA>) string fc059db0
|
||||||
|
spark_gui_full (GUI Full background <BOOL>) bool false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user