Rewrite. Reduced size and use alpha instead of images
35
init.lua
@ -3,34 +3,35 @@ dofile(minetest.get_modpath("mymulch").."/machine.lua")
|
|||||||
|
|
||||||
|
|
||||||
local mulch_tab = {
|
local mulch_tab = {
|
||||||
{"black", "Black", "mymulch_black.png"},
|
{"black", "Black", "mymulch_black.png", "^[colorize:black:240"},
|
||||||
{"blue", "Blue", "mymulch_blue.png"},
|
{"blue", "Blue", "mymulch_blue.png", "^[colorize:#0404B4:100"},
|
||||||
{"brown", "Brown", "mymulch_brown.png"},
|
{"brown", "Brown", "mymulch_brown.png", "^[colorize:#190B07:160"},
|
||||||
{"cyan", "Cyan", "mymulch_cyan.png"},
|
{"cyan", "Cyan", "mymulch_cyan.png", "^[colorize:cyan:120"},
|
||||||
{"dark_green", "Dark Green", "mymulch_dark_green.png"},
|
{"dark_green", "Dark Green", "mymulch_dark_green.png", "^[colorize:#071907:200"},
|
||||||
{"dark_grey", "Dark Grey", "mymulch_dark_grey.png"},
|
{"dark_grey", "Dark Grey", "mymulch_dark_grey.png", "^[colorize:black:200"},
|
||||||
{"green", "Green", "mymulch_green.png"},
|
{"green", "Green", "mymulch_green.png", "^[colorize:green:160"},
|
||||||
{"grey", "Grey", "mymulch_grey.png"},
|
{"grey", "Grey", "mymulch_grey.png", "^[colorize:black:150"},
|
||||||
{"magenta", "Magenta", "mymulch_magenta.png"},
|
{"magenta", "Magenta", "mymulch_magenta.png", "^[colorize:magenta:160"},
|
||||||
{"orange", "Orange", "mymulch_orange.png"},
|
{"orange", "Orange", "mymulch_orange.png", "^[colorize:orange:220"},
|
||||||
{"pink", "Pink", "mymulch_pink.png"},
|
{"pink", "Pink", "mymulch_pink.png", "^[colorize:#FE2E9A:200"},
|
||||||
{"red", "Red", "mymulch_red.png"},
|
{"red", "Red", "mymulch_red.png", "^[colorize:#B40404:200"},
|
||||||
{"violet", "Violet", "mymulch_violet.png"},
|
{"violet", "Violet", "mymulch_violet.png", "^[colorize:#2F0B3A:220"},
|
||||||
{"white", "White", "mymulch_white.png"},
|
{"white", "White", "mymulch_white.png", "^[colorize:white:200"},
|
||||||
{"yellow", "Yellow", "mymulch_yellow.png"},
|
{"yellow", "Yellow", "mymulch_yellow.png", "^[colorize:yellow:200"},
|
||||||
{"tan", "Tan", "mymulch_tan.png"},
|
{"tan", "Tan", "mymulch_tan.png", ""},
|
||||||
}
|
}
|
||||||
for i in ipairs (mulch_tab) do
|
for i in ipairs (mulch_tab) do
|
||||||
local mat = mulch_tab[i][1]
|
local mat = mulch_tab[i][1]
|
||||||
local desc = mulch_tab[i][2]
|
local desc = mulch_tab[i][2]
|
||||||
local image = mulch_tab[i][3]
|
local image = mulch_tab[i][3]
|
||||||
|
local dye = mulch_tab[i][4]
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node("mymulch:mulch_"..mat, {
|
minetest.register_node("mymulch:mulch_"..mat, {
|
||||||
description = desc.." Mulch",
|
description = desc.." Mulch",
|
||||||
drawtype = "normal",
|
drawtype = "normal",
|
||||||
tiles = {
|
tiles = {
|
||||||
image
|
"mymulch_tan.png"..dye.."^mymulch_top.png"
|
||||||
},
|
},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
|
14
machine.lua
@ -130,7 +130,7 @@ end,
|
|||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.env:get_meta(pos)
|
||||||
meta:set_string("formspec", "invsize[8,10;]"..
|
meta:set_string("formspec", "invsize[8,10;]"..
|
||||||
"background[-0.15,-0.25;8.40,10.75;mysiding_background.png]"..
|
"background[-0.15,-0.25;8.40,10.75;mymulch_background.png]"..
|
||||||
|
|
||||||
"label[1.5,0.5; Craft Mulch]"..
|
"label[1.5,0.5; Craft Mulch]"..
|
||||||
"list[current_name;craft1;1.5,1;1,1; ]"..
|
"list[current_name;craft1;1.5,1;1,1; ]"..
|
||||||
@ -138,17 +138,15 @@ on_construct = function(pos)
|
|||||||
"list[current_name;craft3;2.5,1;1,1; ]"..
|
"list[current_name;craft3;2.5,1;1,1; ]"..
|
||||||
"list[current_name;craft4;2.5,2;1,1; ]"..
|
"list[current_name;craft4;2.5,2;1,1; ]"..
|
||||||
"button[4,1;1,1;make;Make]"..
|
"button[4,1;1,1;make;Make]"..
|
||||||
-- "label[4.5,1.5;Output:]"..
|
|
||||||
"list[current_name;res;4,2;1,1;]"..
|
"list[current_name;res;4,2;1,1;]"..
|
||||||
|
|
||||||
"label[5,2; +]"..
|
"label[5,2; +]"..
|
||||||
-- "list[current_name;mulch;7,1;1,1;]"..
|
"label[5.5,1.5; Dye]"..
|
||||||
"label[5.5,0.5; Dye]"..
|
"list[current_name;dye;5.5,2;1,1;]"..
|
||||||
"list[current_name;dye;5.5,1;1,1;]"..
|
"button[5.5,3;1,1;color;Color]"..
|
||||||
"button[5.5,2;1,1;color;Color]"..
|
|
||||||
|
|
||||||
"label[5.5,3;Output]"..
|
"label[5.5,4;Output]"..
|
||||||
"list[current_name;res2;5.5,3.5;1,1;]"..
|
"list[current_name;res2;5.5,4.5;1,1;]"..
|
||||||
|
|
||||||
|
|
||||||
"label[0.5,5.5;2 Mulch = 1 Dirt]"..
|
"label[0.5,5.5;2 Mulch = 1 Dirt]"..
|
||||||
|
@ -26,7 +26,7 @@ minetest.register_node("mymulch:mulch_"..mat, {
|
|||||||
description = desc.." Mulch",
|
description = desc.." Mulch",
|
||||||
drawtype = "normal",
|
drawtype = "normal",
|
||||||
tiles = {
|
tiles = {
|
||||||
image
|
"mymulch_tan.png^[colorize:"..mat..":120"
|
||||||
},
|
},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 307 B |
Before Width: | Height: | Size: 294 B |
Before Width: | Height: | Size: 216 B |
Before Width: | Height: | Size: 309 B |
Before Width: | Height: | Size: 325 B |
Before Width: | Height: | Size: 388 B |
Before Width: | Height: | Size: 343 B |
Before Width: | Height: | Size: 524 B After Width: | Height: | Size: 524 B |
Before Width: | Height: | Size: 248 B |
Before Width: | Height: | Size: 380 B |
Before Width: | Height: | Size: 678 B |
Before Width: | Height: | Size: 380 B |
Before Width: | Height: | Size: 331 B |
Before Width: | Height: | Size: 293 B |
Before Width: | Height: | Size: 380 B |
Before Width: | Height: | Size: 314 B |
Before Width: | Height: | Size: 380 B |
Before Width: | Height: | Size: 376 B |
Before Width: | Height: | Size: 298 B |
Before Width: | Height: | Size: 387 B |
BIN
textures/mymulch_top.png
Normal file
After Width: | Height: | Size: 216 B |
Before Width: | Height: | Size: 380 B |
Before Width: | Height: | Size: 319 B |
Before Width: | Height: | Size: 376 B |