Define all node names explicitly

master
Wuzzy 2016-11-10 21:03:36 +01:00
parent 706125b505
commit edb7f1ac97
1 changed files with 108 additions and 8 deletions

116
init.lua
View File

@ -2,7 +2,108 @@ local cc = {}
cc.colors = { "white", "yellow", "orange", "red", "redviolet", "magenta", "violet", "blue", "skyblue", "cyan", "aqua", "green", "lime", "pink", "brown", "dark_green", "light_gray", "dark_gray", "black" }
cc.dye_colors = {
white = "unicolor_white", yellow = "unicolor_yellow", orange = "unicolor_orange", red = "unicolor_red", redviolet = "unicolor_red_violet", magenta = "unicolor_magenta", violet = "unicolor_violet", blue = "unicolor_blue", skyblue = "unicolor_sky_blue", cyan = "unicolor_cyan", aqua = "unicolor_aqua", green = "unicolor_green", lime = "unicolor_lime", pink = "unicolor_light_red", brown = "unicolor_dark_orange", dark_green = "unicolor_dark_green", light_gray = "unicolor_grey", dark_gray = "unicolor_darkgrey", black = "unicolor_black" }
cc.human_colors = { white = "white", yellow = "yellow", orange = "orange", red = "red", redviolet = "red-violet", magenta = "magenta", violet = "violet", blue = "blue", skyblue = "skyblue", cyan = "cyan", aqua = "aqua", green = "green", lime = "lime", pink = "pink", brown = "brown", dark_green = "dark green", light_gray = "light gray", dark_gray = "dark gray", black = "black" }
cc.human_colors = {
single = {
white = "White basic color cube",
yellow = "Yellow basic color cube",
orange = "Orange basic color cube",
red = "Red basic color cube",
redviolet = "Red-violet basic color cube",
magenta = "Magenta basic color cube",
violet = "Violet basic color cube",
blue = "Blue basic color cube",
skyblue = "Skyblue basic color cube",
cyan = "Cyan basic color cube",
aqua = "Aqua basic color cube",
green = "Green basic color cube",
lime = "Lime basic color cube",
pink = "Pink basic color cube",
brown = "Brown basic color cube",
dark_green = "Dark green basic color cube",
light_gray = "Light gray basic color cube",
dark_gray = "Dark gray basic color cube",
black = "Black basic color cube",
},
window = {
white = "White window color cube",
yellow = "Yellow window color cube",
orange = "Orange window color cube",
red = "Red window color cube",
redviolet = "Red-violet window color cube",
magenta = "Magenta window color cube",
violet = "Violet window color cube",
blue = "Blue window color cube",
skyblue = "Skyblue window color cube",
cyan = "Cyan window color cube",
aqua = "Aqua window color cube",
green = "Green window color cube",
lime = "Lime window color cube",
pink = "Pink window color cube",
brown = "Brown window color cube",
dark_green = "Dark green window color cube",
light_gray = "Light gray window color cube",
dark_gray = "Dark gray window color cube",
black = "Black window color cube",
},
tiled = {
white = "White tiled color cube",
yellow = "Yellow tiled color cube",
orange = "Orange tiled color cube",
red = "Red tiled color cube",
redviolet = "Red-violet tiled color cube",
magenta = "Magenta tiled color cube",
violet = "Violet tiled color cube",
blue = "Blue tiled color cube",
skyblue = "Skyblue tiled color cube",
cyan = "Cyan tiled color cube",
aqua = "Aqua tiled color cube",
green = "Green tiled color cube",
lime = "Lime tiled color cube",
pink = "Pink tiled color cube",
brown = "Brown tiled color cube",
dark_green = "Dark green tiled color cube",
light_gray = "Light gray tiled color cube",
dark_gray = "Dark gray tiled color cube",
black = "Black tiled color cube",
},
inward = {
white = "White concentric color cube",
yellow = "Yellow concentric color cube",
orange = "Orange concentric color cube",
red = "Red concentric color cube",
redviolet = "Red-violet concentric color cube",
magenta = "Magenta concentric color cube",
violet = "Violet concentric color cube",
blue = "Blue concentric color cube",
skyblue = "Skyblue concentric color cube",
cyan = "Cyan concentric color cube",
aqua = "Aqua concentric color cube",
green = "Green concentric color cube",
lime = "Lime concentric color cube",
pink = "Pink concentric color cube",
brown = "Brown concentric color cube",
dark_green = "Dark green concentric color cube",
light_gray = "Light gray concentric color cube",
dark_gray = "Dark gray concentric color cube",
black = "Black concentric color cube",
},
light = {
white = "White light color cube",
yellow = "Yellow light color cube",
orange = "Orange light color cube",
red = "Red light color cube",
redviolet = "Red-violet light color cube",
magenta = "Magenta light color cube",
violet = "Violet light color cube",
blue = "Blue light color cube",
skyblue = "Skyblue light color cube",
cyan = "Cyan light color cube",
aqua = "Aqua light color cube",
green = "Green light color cube",
lime = "Lime light color cube",
}
}
local light_level = 14
@ -32,11 +133,10 @@ colorcube_light=1: light color cube
for i=1,#cc.colors do
local c = cc.colors[i]
local h = cc.human_colors[c]
local d = cc.dye_colors[c]
-- Blocks with a simple square pattern
local nodedef1 = {
description = h.." basic color cube",
description = cc.human_colors.single[c],
tiles = { "colorcubes_1_"..c..".png" },
groups = { dig_immediate = 2, colorcube = 1, colorcube_single = 1 },
sounds = soundmaker(0),
@ -44,7 +144,7 @@ for i=1,#cc.colors do
minetest.register_node("colorcubes:"..c.."_single", nodedef1)
-- Windows
local nodedef_window = {
description = h.." window color cube",
description = cc.human_colors.window[c],
tiles = { "colorcubes_window_"..c..".png" },
inventory_image = minetest.inventorycube("colorcubes_window_"..c..".png"),
groups = { dig_immediate = 2, colorcube = 1, colorcube_window = 1 },
@ -57,7 +157,7 @@ for i=1,#cc.colors do
minetest.register_node("colorcubes:"..c.."_window", nodedef_window)
-- Blocks with a tile pattern (4 tiles)
local nodedef4 = {
description = h.." tiled color cube",
description = cc.human_colors.tiled[c],
tiles = { "colorcubes_4_"..c..".png" },
groups = { dig_immediate = 2, colorcube = 1, colorcube_tiled = 1 },
sounds = soundmaker(0.1),
@ -65,7 +165,7 @@ for i=1,#cc.colors do
minetest.register_node("colorcubes:"..c.."_tiled", nodedef4)
-- Blocks with a concentric square pattern
local nodedef_inward = {
description = h.." concentric color cube",
description = cc.human_colors.inward[c],
tiles = { "colorcubes_inward_"..c..".png" },
groups = { dig_immediate = 2, colorcube = 1, colorcube_inward = 1},
sounds = soundmaker(0.15),
@ -74,7 +174,7 @@ for i=1,#cc.colors do
-- Lamps in different brightness levels
if light_level > 1 then
local nodedef_light = {
description = h.." light color cube",
description = cc.human_colors.light[c],
tiles = { "colorcubes_light_"..c..".png" },
groups = { dig_immediate = 2, colorcube = 1, colorcube_light = 1 },
sounds = soundmaker(-0.05),
@ -156,7 +256,7 @@ end
--[[ Tiled blocks with 2 different colors (usuall complementary colors) ]]
local complementary = { { "yellow", "blue"}, {"aqua", "redviolet"}, {"red", "cyan"}, {"light_gray", "dark_gray"}, {"green", "magenta"}, {"orange", "skyblue"}, {"lime", "violet"}, {"black", "white"}, {"orange", "brown"} }
local complementary_names = { "yellow/blue tiled color cube", "aqua/red-violet tiled color cube", "red/cyan tiled color cube", "light/dark gray tiled color cube", "green/magenta tiled color cube", "orange/skyblue tiled color cube", "lime/violet tiled color cube", "black/white tiled color cube", "orange/brown tiled color cube" }
local complementary_names = { "Yellow/blue tiled color cube", "Aqua/red-violet tiled color cube", "Red/cyan tiled color cube", "Light/dark gray tiled color cube", "Green/magenta tiled color cube", "Orange/skyblue tiled color cube", "Lime/violet tiled color cube", "Black/white tiled color cube", "Orange/brown tiled color cube" }
for i=1,#complementary do
local c1, c2