]> git.lizzy.rs Git - xdecor.git/commitdiff
Tweak hive formspec a bit and overall code reduction
authorjp <jeanpatrick.guerrero@gmail.com>
Sat, 8 Aug 2015 08:54:17 +0000 (10:54 +0200)
committerjp <jeanpatrick.guerrero@gmail.com>
Sat, 8 Aug 2015 11:23:47 +0000 (13:23 +0200)
enchanting.lua
hive.lua
textures/ench_mese_layout.png [deleted file]
textures/mese_layout.png [new file with mode: 0644]
worktable.lua
xwall.lua

index a79bc2248cf98f3e3ab798f1e16b45a249ec1f35..2e6612642751c77f5f0e39ae45c58c0adde87309 100644 (file)
@@ -3,11 +3,9 @@ local enchanting = {}
 function enchanting.construct(pos)
        local meta = minetest.get_meta(pos)
        meta:set_string("formspec", "size[8,7;]"..xdecor.fancy_gui..
-               "label[0.85,-0.15;Enchant]"..
-               "image[0.6,0.2;2,2;xdecor_enchbook.png]"..
-               "image[1.5,2;1,1;ench_mese_layout.png]"..
+               "label[0.85,-0.15;Enchant]".."image[0.6,0.2;2,2;xdecor_enchbook.png]"..
                "list[current_name;tool;0.5,2;1,1;]"..
-               "list[current_name;mese;1.5,2;1,1;]"..
+               "list[current_name;mese;1.5,2;1,1;]".."image[1.5,2;1,1;mese_layout.png]"..
                "image_button[2.75,0;5,1.5;ench_bg.png;durable;Durable]"..
                "image_button[2.75,1.5;5,1.5;ench_bg.png;fast;Fast]"..
                "list[current_player;main;0,3.3;8,4;]")
index 9a9ca7e652c1ecfb7b8fd6d3c2a2595c31b34592..66bca6ac244a5e42f199260d43abce4e8ce203c2 100644 (file)
--- a/hive.lua
+++ b/hive.lua
@@ -4,11 +4,9 @@ function hive.construct(pos)
        local meta = minetest.get_meta(pos)
        meta:set_string("formspec", "size[8,5;]"..xdecor.fancy_gui..
                "label[1.35,0;Bees are making honey\nwith pollen around...]"..
-               "image[-0.1,-0.2;1,1;flowers_tulip.png]"..
-               "image[0.5,0.2;1,1;flowers_dandelion_yellow.png]"..
-               "image[6.6,0.1;1,1;flowers_geranium.png]"..
-               "image[7.2,-0.1;1,1;flowers_rose.png]"..
-               "image[6,0;0.9,0.9;xdecor_bee.png]"..
+               "image[0.2,-0.1;1,1;flowers_dandelion_white.png]"..
+               "image[7,0.1;1,1;flowers_viola.png]"..
+               "image[6,0;1,1;xdecor_bee.png]"..
                "list[current_name;honey;5,0;1,1;]"..
                "list[current_player;main;0,1.35;8,4;]")
        meta:set_string("infotext", "Artificial Hive")
diff --git a/textures/ench_mese_layout.png b/textures/ench_mese_layout.png
deleted file mode 100644 (file)
index 830ece1..0000000
Binary files a/textures/ench_mese_layout.png and /dev/null differ
diff --git a/textures/mese_layout.png b/textures/mese_layout.png
new file mode 100644 (file)
index 0000000..830ece1
Binary files /dev/null and b/textures/mese_layout.png differ
index a6910f74b86005e9b4130bd8162141833c1eb70c..5d28a02f45e11c9c2482604265eaeae69a3f5c65 100644 (file)
@@ -14,14 +14,14 @@ local material = {
 }
 
 local def = { -- Node name, yield, nodebox shape.
-       {"nanoslab", "16", {-0.5, -0.5, -0.5, 0, -0.4375, 0}},
-       {"micropanel", "16", {-0.5, -0.5, -0.5, 0.5, -0.4375, 0}},
-       {"microslab", "8", {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}},
-       {"panel", "4", {-0.5, -0.5, -0.5, 0.5, 0, 0}},
-       {"slab", "2", {-0.5, -0.5, -0.5, 0.5, 0, 0.5}},
-       {"outerstair", "1", {{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, {-0.5, 0, 0, 0, 0.5, 0.5}}},
-       {"stair", "1", {{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, {-0.5, 0, 0, 0.5, 0.5, 0.5}}},
-       {"innerstair", "1", {{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, {-0.5, 0, 0, 0.5, 0.5, 0.5}, {-0.5, 0, -0.5, 0, 0.5, 0}}}
+       {"nanoslab", "16", {-.5,-.5,-.5,0,-.4375,0}},
+       {"micropanel", "16", {-.5,-.5,-.5,.5,-.4375,0}},
+       {"microslab", "8", {-.5,-.5,-.5,.5,-.4375,.5}},
+       {"panel", "4", {-.5,-.5,-.5,.5,0,0}},
+       {"slab", "2", {-.5,-.5,-.5,.5,0,.5}},
+       {"outerstair", "1", {{-.5,-.5,-.5,.5,0,.5},{-.5,0,0,0,.5,.5}}},
+       {"stair", "1", {{-.5,-.5,-.5,.5,0,.5},{-.5,0,0,.5,.5,.5}}},
+       {"innerstair", "1", {{-.5,-.5,-.5,.5,0,.5},{-.5,0,0,.5,.5,.5},{-.5,0,-.5,0,.5,0}}}
 }
 
 function worktable.construct(pos)
@@ -35,18 +35,13 @@ function worktable.construct(pos)
        nodebtn = table.concat(nodebtn)
 
        meta:set_string("formspec", "size[8,7;]"..xdecor.fancy_gui..
-               "label[0,0;Cut your material into...]"..
-               nodebtn..
-               "label[0,1.5;Input]"..
-               "list[current_name;input;0,2;1,1;]"..
+               "label[0,0;Cut your material into...]"..nodebtn..
+               "label[0,1.5;Input]".."list[current_name;input;0,2;1,1;]"..
                "image[1,2;1,1;xdecor_saw.png]"..
-               "label[2,1.5;Output]"..
-               "list[current_name;output;2,2;1,1;]"..
-               "label[5,1.5;Tool]"..
-               "list[current_name;tool;5,2;1,1;]"..
+               "label[2,1.5;Output]".."list[current_name;output;2,2;1,1;]"..
+               "label[5,1.5;Tool]".."list[current_name;tool;5,2;1,1;]"..
                "image[6,2;1,1;xdecor_anvil.png]"..
-               "label[6.8,1.5;Hammer]"..
-               "list[current_name;hammer;7,2;1,1;]"..
+               "label[6.8,1.5;Hammer]".."list[current_name;hammer;7,2;1,1;]"..
                "list[current_player;main;0,3.25;8,4;]")
        meta:set_string("infotext", "Work Table")
 
index 764b6ef97787115661cb75b78d0f14db8862c592..ffc82784e25750d53cccc9751d93aba4cf63d5fd 100644 (file)
--- a/xwall.lua
+++ b/xwall.lua
@@ -147,13 +147,13 @@ function xwall.construct_node_box_data(node_box_list, center_node_box_list, node
        for _, v in pairs(node_box_list) do
                pos3 = pos3 + 1
                pos4 = pos4 + 1
-               res.c3[pos3] = {v[4], v[2], v[3]-0.5, v[1], v[5], v[6]-0.5}
-               res.c4[pos4] = {v[4], v[2], v[3]-0.5, v[1], v[5], v[6]-0.5}
+               res.c3[pos3] = {v[4], v[2], v[3]-.5, v[1], v[5], v[6]-.5}
+               res.c4[pos4] = {v[4], v[2], v[3]-.5, v[1], v[5], v[6]-.5}
        end
 
        for _, v in pairs(node_box_list) do
                pos4 = pos4 + 1
-               res.c4[pos4] = {v[3]-0.5, v[2], v[4], v[6]-0.5, v[5], v[1]}
+               res.c4[pos4] = {v[3]-.5, v[2], v[4], v[6]-.5, v[5], v[1]}
        end
 
        for _, v in pairs(center_node_box_list) do
@@ -179,9 +179,8 @@ end
 
 function xwall.register_wall(name, tiles, def)
        local node_box_data = xwall.construct_node_box_data(
-               {{ -3/16, -0.5, 0,  3/16, 5/16, 0.5 }},
-               {{ -4/16, -0.5, -4/16, 4/16, 0.5, 4/16 }},
-               {{ -3/16, -0.5, -0.5, 3/16, 5/16, 0.5 }}
+               {{-.1875,-.5,0,.1875,.3125,.5}},{{-.25,-.5,-.25,.25,.5,.25}},
+               {{-.1875,-.5,-.5,.1875,.3125,.5}}
        )
 
        if def then return end
@@ -193,7 +192,7 @@ function xwall.register_wall(name, tiles, def)
                sunlight_propagates = true,
                collision_box = {
                        type = "fixed",
-                       fixed = {-0.5, -0.5, -0.25, 0.5, 1, 0.25}
+                       fixed = {-.5, -.5, -.25, .5, 1, .25}
                }
        }
        xwall.register(name, def, node_box_data)