forked from mtcontrib/coloredwood
move various tables of colors, hues, greys, etc to init.lua
and reference them from the other files instead.
This commit is contained in:
parent
9e4b16df39
commit
4b08eb7a36
93
fence.lua
93
fence.lua
|
@ -11,90 +11,15 @@ local colored_block_walkable = "true"
|
||||||
local colored_block_groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1}
|
local colored_block_groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1}
|
||||||
local colored_block_sound = "default.node_sound_wood_defaults()"
|
local colored_block_sound = "default.node_sound_wood_defaults()"
|
||||||
|
|
||||||
-- ------------------------------------------------------------------
|
|
||||||
-- Generate all of the base color node definitions and all variations
|
|
||||||
-- except for the greyscale stuff.
|
|
||||||
|
|
||||||
-- Hues are on a 30 degree spacing starting at red = 0 degrees.
|
|
||||||
-- "s50" in a file/item name means "saturation: 50%".
|
|
||||||
-- Texture brightness levels for the colors are 100%, 66% ("medium"),
|
|
||||||
-- and 33% ("dark").
|
|
||||||
|
|
||||||
local shades = {
|
|
||||||
"dark_",
|
|
||||||
"medium_",
|
|
||||||
"" -- represents "no special shade name", e.g. full.
|
|
||||||
}
|
|
||||||
|
|
||||||
local shades2 = {
|
|
||||||
"Dark ",
|
|
||||||
"Medium ",
|
|
||||||
"" -- represents "no special shade name", e.g. full.
|
|
||||||
}
|
|
||||||
|
|
||||||
local hues = {
|
|
||||||
"red",
|
|
||||||
"orange",
|
|
||||||
"yellow",
|
|
||||||
"lime",
|
|
||||||
"green",
|
|
||||||
"aqua",
|
|
||||||
"cyan",
|
|
||||||
"skyblue",
|
|
||||||
"blue",
|
|
||||||
"violet",
|
|
||||||
"magenta",
|
|
||||||
"redviolet"
|
|
||||||
}
|
|
||||||
|
|
||||||
local hues2 = {
|
|
||||||
"Red ",
|
|
||||||
"Orange ",
|
|
||||||
"Yellow ",
|
|
||||||
"Lime ",
|
|
||||||
"Green ",
|
|
||||||
"Aqua ",
|
|
||||||
"Cyan ",
|
|
||||||
"Sky Blue ",
|
|
||||||
"Blue ",
|
|
||||||
"Violet ",
|
|
||||||
"Magenta ",
|
|
||||||
"Red-violet "
|
|
||||||
}
|
|
||||||
|
|
||||||
local greys = {
|
|
||||||
"black",
|
|
||||||
"darkgrey",
|
|
||||||
"grey",
|
|
||||||
"lightgrey",
|
|
||||||
"white"
|
|
||||||
}
|
|
||||||
|
|
||||||
local greys2 = {
|
|
||||||
"Black ",
|
|
||||||
"Dark Grey ",
|
|
||||||
"Medium Grey ",
|
|
||||||
"Light Grey ",
|
|
||||||
"White "
|
|
||||||
}
|
|
||||||
|
|
||||||
local greys3 = {
|
|
||||||
"black",
|
|
||||||
"darkgrey_paint",
|
|
||||||
"mediumgrey_paint",
|
|
||||||
"lightgrey_paint",
|
|
||||||
"white_paint"
|
|
||||||
}
|
|
||||||
|
|
||||||
for shade = 1, 3 do
|
for shade = 1, 3 do
|
||||||
|
|
||||||
local shadename = shades[shade]
|
local shadename = coloredwood.shades[shade]
|
||||||
local shadename2 = shades2[shade]
|
local shadename2 = coloredwood.shades2[shade]
|
||||||
|
|
||||||
for hue = 1, 12 do
|
for hue = 1, 12 do
|
||||||
|
|
||||||
local huename = hues[hue]
|
local huename = coloredwood.hues[hue]
|
||||||
local huename2 = hues2[hue]
|
local huename2 = coloredwood.hues2[hue]
|
||||||
|
|
||||||
local colorname = colored_block_modname..":fence_"..shadename..huename
|
local colorname = colored_block_modname..":fence_"..shadename..huename
|
||||||
local pngnameinv = colored_block_modname.."_fence_"..shadename..huename..".png"
|
local pngnameinv = colored_block_modname.."_fence_"..shadename..huename..".png"
|
||||||
|
@ -218,8 +143,8 @@ end
|
||||||
-- Generate the "light" shades separately, since they don"t have a low-sat version.
|
-- Generate the "light" shades separately, since they don"t have a low-sat version.
|
||||||
|
|
||||||
for hue = 1, 12 do
|
for hue = 1, 12 do
|
||||||
local huename = hues[hue]
|
local huename = coloredwood.hues[hue]
|
||||||
local huename2 = hues2[hue]
|
local huename2 = coloredwood.hues2[hue]
|
||||||
local colorname = colored_block_modname..":fence_light_"..huename
|
local colorname = colored_block_modname..":fence_light_"..huename
|
||||||
local pngname = colored_block_modname.."_wood_light_"..huename..".png"
|
local pngname = colored_block_modname.."_wood_light_"..huename..".png"
|
||||||
local pngnameinv = colored_block_modname.."_fence_light_"..huename..".png"
|
local pngnameinv = colored_block_modname.."_fence_light_"..huename..".png"
|
||||||
|
@ -289,9 +214,9 @@ end
|
||||||
|
|
||||||
for grey = 1,5 do
|
for grey = 1,5 do
|
||||||
|
|
||||||
local greyname = greys[grey]
|
local greyname = coloredwood.greys[grey]
|
||||||
local greyname2 = greys2[grey]
|
local greyname2 = coloredwood.greys2[grey]
|
||||||
local greyname3 = greys3[grey]
|
local greyname3 = coloredwood.greys3[grey]
|
||||||
|
|
||||||
local greyshadename = colored_block_modname..":fence_"..greyname
|
local greyshadename = colored_block_modname..":fence_"..greyname
|
||||||
local pngname = colored_block_modname.."_wood_"..greyname..".png"
|
local pngname = colored_block_modname.."_wood_"..greyname..".png"
|
||||||
|
|
73
init.lua
73
init.lua
|
@ -38,6 +38,79 @@
|
||||||
--
|
--
|
||||||
-- All materials are flammable and can be used as fuel.
|
-- All materials are flammable and can be used as fuel.
|
||||||
|
|
||||||
|
-- Hues are on a 30 degree spacing starting at red = 0 degrees.
|
||||||
|
-- "s50" in a file/item name means "saturation: 50%".
|
||||||
|
-- Texture brightness levels for the colors are 100%, 66% ("medium"),
|
||||||
|
-- and 33% ("dark").
|
||||||
|
|
||||||
|
coloredwood = {}
|
||||||
|
|
||||||
|
coloredwood.shades = {
|
||||||
|
"dark_",
|
||||||
|
"medium_",
|
||||||
|
"" -- represents "no special shade name", e.g. full.
|
||||||
|
}
|
||||||
|
|
||||||
|
coloredwood.shades2 = {
|
||||||
|
"Dark ",
|
||||||
|
"Medium ",
|
||||||
|
"" -- represents "no special shade name", e.g. full.
|
||||||
|
}
|
||||||
|
|
||||||
|
coloredwood.hues = {
|
||||||
|
"red",
|
||||||
|
"orange",
|
||||||
|
"yellow",
|
||||||
|
"lime",
|
||||||
|
"green",
|
||||||
|
"aqua",
|
||||||
|
"cyan",
|
||||||
|
"skyblue",
|
||||||
|
"blue",
|
||||||
|
"violet",
|
||||||
|
"magenta",
|
||||||
|
"redviolet"
|
||||||
|
}
|
||||||
|
|
||||||
|
coloredwood.hues2 = {
|
||||||
|
"Red ",
|
||||||
|
"Orange ",
|
||||||
|
"Yellow ",
|
||||||
|
"Lime ",
|
||||||
|
"Green ",
|
||||||
|
"Aqua ",
|
||||||
|
"Cyan ",
|
||||||
|
"Sky Blue ",
|
||||||
|
"Blue ",
|
||||||
|
"Violet ",
|
||||||
|
"Magenta ",
|
||||||
|
"Red-violet "
|
||||||
|
}
|
||||||
|
|
||||||
|
coloredwood.greys = {
|
||||||
|
"black",
|
||||||
|
"darkgrey",
|
||||||
|
"grey",
|
||||||
|
"lightgrey",
|
||||||
|
"white"
|
||||||
|
}
|
||||||
|
|
||||||
|
coloredwood.greys2 = {
|
||||||
|
"Black ",
|
||||||
|
"Dark Grey ",
|
||||||
|
"Medium Grey ",
|
||||||
|
"Light Grey ",
|
||||||
|
"White "
|
||||||
|
}
|
||||||
|
|
||||||
|
coloredwood.greys3 = {
|
||||||
|
"black",
|
||||||
|
"darkgrey_paint",
|
||||||
|
"mediumgrey_paint",
|
||||||
|
"lightgrey_paint",
|
||||||
|
"white_paint"
|
||||||
|
}
|
||||||
|
|
||||||
-- All of the actual code is contained in separate lua files:
|
-- All of the actual code is contained in separate lua files:
|
||||||
|
|
||||||
dofile(minetest.get_modpath("coloredwood").."/wood.lua")
|
dofile(minetest.get_modpath("coloredwood").."/wood.lua")
|
||||||
|
|
93
stick.lua
93
stick.lua
|
@ -7,90 +7,15 @@ local colored_block_modname = "coloredwood"
|
||||||
local colored_block_description = "Stick"
|
local colored_block_description = "Stick"
|
||||||
local neutral_block = "default:stick"
|
local neutral_block = "default:stick"
|
||||||
|
|
||||||
-- ------------------------------------------------------------------
|
|
||||||
-- Generate all of the base color node definitions and all variations
|
|
||||||
-- except for the greyscale stuff.
|
|
||||||
|
|
||||||
-- Hues are on a 30 degree spacing starting at red = 0 degrees.
|
|
||||||
-- "s50" in a file/item name means "saturation: 50%".
|
|
||||||
-- Texture brightness levels for the colors are 100%, 66% ("medium"),
|
|
||||||
-- and 33% ("dark").
|
|
||||||
|
|
||||||
local shades = {
|
|
||||||
"dark_",
|
|
||||||
"medium_",
|
|
||||||
"" -- represents "no special shade name", e.g. bright.
|
|
||||||
}
|
|
||||||
|
|
||||||
local shades2 = {
|
|
||||||
"Dark ",
|
|
||||||
"Medium ",
|
|
||||||
"" -- represents "no special shade name", e.g. bright.
|
|
||||||
}
|
|
||||||
|
|
||||||
local hues = {
|
|
||||||
"red",
|
|
||||||
"orange",
|
|
||||||
"yellow",
|
|
||||||
"lime",
|
|
||||||
"green",
|
|
||||||
"aqua",
|
|
||||||
"cyan",
|
|
||||||
"skyblue",
|
|
||||||
"blue",
|
|
||||||
"violet",
|
|
||||||
"magenta",
|
|
||||||
"redviolet"
|
|
||||||
}
|
|
||||||
|
|
||||||
local hues2 = {
|
|
||||||
"Red ",
|
|
||||||
"Orange ",
|
|
||||||
"Yellow ",
|
|
||||||
"Lime ",
|
|
||||||
"Green ",
|
|
||||||
"Aqua ",
|
|
||||||
"Cyan ",
|
|
||||||
"Sky Blue ",
|
|
||||||
"Blue ",
|
|
||||||
"Violet ",
|
|
||||||
"Magenta ",
|
|
||||||
"Red-violet "
|
|
||||||
}
|
|
||||||
|
|
||||||
local greys = {
|
|
||||||
"black",
|
|
||||||
"darkgrey",
|
|
||||||
"grey",
|
|
||||||
"lightgrey",
|
|
||||||
"white"
|
|
||||||
}
|
|
||||||
|
|
||||||
local greys2 = {
|
|
||||||
"Black ",
|
|
||||||
"Dark Grey ",
|
|
||||||
"Medium Grey ",
|
|
||||||
"Light Grey ",
|
|
||||||
"White "
|
|
||||||
}
|
|
||||||
|
|
||||||
local greys3 = {
|
|
||||||
"black",
|
|
||||||
"darkgrey_paint",
|
|
||||||
"mediumgrey_paint",
|
|
||||||
"lightgrey_paint",
|
|
||||||
"white_paint"
|
|
||||||
}
|
|
||||||
|
|
||||||
for shade = 1, 3 do
|
for shade = 1, 3 do
|
||||||
|
|
||||||
local shadename = shades[shade]
|
local shadename = coloredwood.shades[shade]
|
||||||
local shadename2 = shades2[shade]
|
local shadename2 = coloredwood.shades2[shade]
|
||||||
|
|
||||||
for hue = 1, 12 do
|
for hue = 1, 12 do
|
||||||
|
|
||||||
local huename = hues[hue]
|
local huename = coloredwood.hues[hue]
|
||||||
local huename2 = hues2[hue]
|
local huename2 = coloredwood.hues2[hue]
|
||||||
|
|
||||||
local colorname = colored_block_modname..":stick_"..shadename..huename
|
local colorname = colored_block_modname..":stick_"..shadename..huename
|
||||||
local pngname = colored_block_modname.."_stick_"..shadename..huename..".png"
|
local pngname = colored_block_modname.."_stick_"..shadename..huename..".png"
|
||||||
|
@ -147,8 +72,8 @@ end
|
||||||
-- Generate the "light" shades separately, since they don"t have a low-sat version.
|
-- Generate the "light" shades separately, since they don"t have a low-sat version.
|
||||||
|
|
||||||
for hue = 1, 12 do
|
for hue = 1, 12 do
|
||||||
local huename = hues[hue]
|
local huename = coloredwood.hues[hue]
|
||||||
local huename2 = hues2[hue]
|
local huename2 = coloredwood.hues2[hue]
|
||||||
local colorname = colored_block_modname..":stick_light_"..huename
|
local colorname = colored_block_modname..":stick_light_"..huename
|
||||||
local pngname = colored_block_modname.."_stick_light_"..huename..".png"
|
local pngname = colored_block_modname.."_stick_light_"..huename..".png"
|
||||||
local itemdesc = "Light "..huename2..colored_block_description
|
local itemdesc = "Light "..huename2..colored_block_description
|
||||||
|
@ -185,9 +110,9 @@ end
|
||||||
|
|
||||||
for grey = 1,5 do
|
for grey = 1,5 do
|
||||||
|
|
||||||
local greyname = greys[grey]
|
local greyname = coloredwood.greys[grey]
|
||||||
local greyname2 = greys2[grey]
|
local greyname2 = coloredwood.greys2[grey]
|
||||||
local greyname3 = greys3[grey]
|
local greyname3 = coloredwood.greys3[grey]
|
||||||
|
|
||||||
local greyshadename = colored_block_modname..":stick_"..greyname
|
local greyshadename = colored_block_modname..":stick_"..greyname
|
||||||
local pngname = colored_block_modname.."_stick_"..greyname..".png"
|
local pngname = colored_block_modname.."_stick_"..greyname..".png"
|
||||||
|
|
95
wood.lua
95
wood.lua
|
@ -3,8 +3,6 @@
|
||||||
--
|
--
|
||||||
-- License: WTFPL
|
-- License: WTFPL
|
||||||
|
|
||||||
local coloredwood = {}
|
|
||||||
|
|
||||||
coloredwood.enable_stairsplus = true
|
coloredwood.enable_stairsplus = true
|
||||||
|
|
||||||
if minetest.setting_getbool("coloredwood_enable_stairsplus") == false or not minetest.get_modpath("moreblocks") then
|
if minetest.setting_getbool("coloredwood_enable_stairsplus") == false or not minetest.get_modpath("moreblocks") then
|
||||||
|
@ -19,90 +17,15 @@ local colored_block_walkable = "true"
|
||||||
local colored_block_groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1}
|
local colored_block_groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1}
|
||||||
local colored_block_sound = "default.node_sound_wood_defaults()"
|
local colored_block_sound = "default.node_sound_wood_defaults()"
|
||||||
|
|
||||||
-- ------------------------------------------------------------------
|
|
||||||
-- Generate all of the base color node definitions and all variations
|
|
||||||
-- except for the greyscale stuff.
|
|
||||||
|
|
||||||
-- Hues are on a 30 degree spacing starting at red = 0 degrees.
|
|
||||||
-- "s50" in a file/item name means "saturation: 50%".
|
|
||||||
-- Texture brightness levels for the colors are 100%, 66% ("medium"),
|
|
||||||
-- and 33% ("dark").
|
|
||||||
|
|
||||||
local shades = {
|
|
||||||
"dark_",
|
|
||||||
"medium_",
|
|
||||||
"" -- represents "no special shade name", e.g. bright.
|
|
||||||
}
|
|
||||||
|
|
||||||
local shades2 = {
|
|
||||||
"Dark ",
|
|
||||||
"Medium ",
|
|
||||||
"" -- represents "no special shade name", e.g. bright.
|
|
||||||
}
|
|
||||||
|
|
||||||
local hues = {
|
|
||||||
"red",
|
|
||||||
"orange",
|
|
||||||
"yellow",
|
|
||||||
"lime",
|
|
||||||
"green",
|
|
||||||
"aqua",
|
|
||||||
"cyan",
|
|
||||||
"skyblue",
|
|
||||||
"blue",
|
|
||||||
"violet",
|
|
||||||
"magenta",
|
|
||||||
"redviolet"
|
|
||||||
}
|
|
||||||
|
|
||||||
local hues2 = {
|
|
||||||
"Red ",
|
|
||||||
"Orange ",
|
|
||||||
"Yellow ",
|
|
||||||
"Lime ",
|
|
||||||
"Green ",
|
|
||||||
"Aqua ",
|
|
||||||
"Cyan ",
|
|
||||||
"Sky Blue ",
|
|
||||||
"Blue ",
|
|
||||||
"Violet ",
|
|
||||||
"Magenta ",
|
|
||||||
"Red-violet "
|
|
||||||
}
|
|
||||||
|
|
||||||
local greys = {
|
|
||||||
"black",
|
|
||||||
"darkgrey",
|
|
||||||
"grey",
|
|
||||||
"lightgrey",
|
|
||||||
"white"
|
|
||||||
}
|
|
||||||
|
|
||||||
local greys2 = {
|
|
||||||
"Black ",
|
|
||||||
"Dark Grey ",
|
|
||||||
"Medium Grey ",
|
|
||||||
"Light Grey ",
|
|
||||||
"White "
|
|
||||||
}
|
|
||||||
|
|
||||||
local greys3 = {
|
|
||||||
"black",
|
|
||||||
"darkgrey_paint",
|
|
||||||
"mediumgrey_paint",
|
|
||||||
"lightgrey_paint",
|
|
||||||
"white_paint"
|
|
||||||
}
|
|
||||||
|
|
||||||
for shade = 1, 3 do
|
for shade = 1, 3 do
|
||||||
|
|
||||||
local shadename = shades[shade]
|
local shadename = coloredwood.shades[shade]
|
||||||
local shadename2 = shades2[shade]
|
local shadename2 = coloredwood.shades2[shade]
|
||||||
|
|
||||||
for hue = 1, 12 do
|
for hue = 1, 12 do
|
||||||
|
|
||||||
local huename = hues[hue]
|
local huename = coloredwood.hues[hue]
|
||||||
local huename2 = hues2[hue]
|
local huename2 = coloredwood.hues2[hue]
|
||||||
|
|
||||||
local colorname = colored_block_modname..":wood_"..shadename..huename
|
local colorname = colored_block_modname..":wood_"..shadename..huename
|
||||||
local pngname = colored_block_modname.."_wood_"..shadename..huename..".png"
|
local pngname = colored_block_modname.."_wood_"..shadename..huename..".png"
|
||||||
|
@ -201,8 +124,8 @@ end
|
||||||
|
|
||||||
for hue = 1, 12 do
|
for hue = 1, 12 do
|
||||||
|
|
||||||
local huename = hues[hue]
|
local huename = coloredwood.hues[hue]
|
||||||
local huename2 = hues2[hue]
|
local huename2 = coloredwood.hues2[hue]
|
||||||
local colorname = colored_block_modname..":wood_light_"..huename
|
local colorname = colored_block_modname..":wood_light_"..huename
|
||||||
local pngname = colored_block_modname.."_wood_light_"..huename..".png"
|
local pngname = colored_block_modname.."_wood_light_"..huename..".png"
|
||||||
local nodedesc = "Light "..huename2..colored_block_description
|
local nodedesc = "Light "..huename2..colored_block_description
|
||||||
|
@ -259,9 +182,9 @@ end
|
||||||
|
|
||||||
for grey = 1,5 do
|
for grey = 1,5 do
|
||||||
|
|
||||||
local greyname = greys[grey]
|
local greyname = coloredwood.greys[grey]
|
||||||
local greyname2 = greys2[grey]
|
local greyname2 = coloredwood.greys2[grey]
|
||||||
local greyname3 = greys3[grey]
|
local greyname3 = coloredwood.greys3[grey]
|
||||||
|
|
||||||
local greyshadename = colored_block_modname..":wood_"..greyname
|
local greyshadename = colored_block_modname..":wood_"..greyname
|
||||||
local pngname = colored_block_modname.."_wood_"..greyname..".png"
|
local pngname = colored_block_modname.."_wood_"..greyname..".png"
|
||||||
|
|
Loading…
Reference in New Issue