From 1782d1332e71655746f3102b6d613a0cd11b92fb Mon Sep 17 00:00:00 2001 From: adrido Date: Sat, 13 Jun 2015 15:41:02 +0200 Subject: [PATCH] formspec style like default, if aviable --- functions.lua | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/functions.lua b/functions.lua index 12750ab..8d96ef9 100644 --- a/functions.lua +++ b/functions.lua @@ -114,12 +114,35 @@ cannons.formspec = "list[current_name;muni;0,1;1,1;] label[0,0.5;Muni:]".. "list[current_name;gunpowder;0,3;1,1;] label[0,2.5;Gunpowder:]".. "list[current_player;main;0,5;8,4;]" - +if default and default.gui_bg then + cannons.formspec = cannons.formspec..default.gui_bg; +end + +if default and default.gui_bg_img then + cannons.formspec = cannons.formspec..default.gui_bg_img; +end + +if default and default.gui_slots then + cannons.formspec = cannons.formspec..default.gui_slots; +end + cannons.disabled_formspec = "size[8,9]".. "label[1,0.5;Cannon is Disabled. Place it on a cannonstand to activate it]".. "list[current_player;main;0,5;8,4;]" +if default and default.gui_bg then + cannons.disabled_formspec = cannons.disabled_formspec..default.gui_bg; +end + +if default and default.gui_bg_img then + cannons.disabled_formspec = cannons.disabled_formspec..default.gui_bg_img; +end + +if default and default.gui_slots then + cannons.disabled_formspec = cannons.disabled_formspec..default.gui_slots; +end + cannons.on_construct = function(pos) local node = minetest.get_node({x = pos.x ,y = pos.y-1, z = pos.z}) if minetest.registered_nodes[node.name].groups.cannonstand then