From 8aeb2f1007908880987bff455a3b9c64fca18b10 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Sun, 27 Jul 2014 09:04:53 -0400 Subject: [PATCH] condense node defs for bathroom tiles give slightly more meaningful filenames for their textures --- homedecor/misc-bathroom.lua | 82 +++++------------- ...es1.png => homedecor_bathroom_tiles_1.png} | Bin ...es2.png => homedecor_bathroom_tiles_2.png} | Bin ...es3.png => homedecor_bathroom_tiles_3.png} | Bin ...es4.png => homedecor_bathroom_tiles_4.png} | Bin 5 files changed, 24 insertions(+), 58 deletions(-) rename homedecor/textures/{homedecor_tiles1.png => homedecor_bathroom_tiles_1.png} (100%) rename homedecor/textures/{homedecor_tiles2.png => homedecor_bathroom_tiles_2.png} (100%) rename homedecor/textures/{homedecor_tiles3.png => homedecor_bathroom_tiles_3.png} (100%) rename homedecor/textures/{homedecor_tiles4.png => homedecor_bathroom_tiles_4.png} (100%) diff --git a/homedecor/misc-bathroom.lua b/homedecor/misc-bathroom.lua index 1ef80e4..b3c1f4d 100644 --- a/homedecor/misc-bathroom.lua +++ b/homedecor/misc-bathroom.lua @@ -1,64 +1,30 @@ local S = homedecor.gettext -minetest.register_node("homedecor:tiles_1", { - description = "Bathroom/kitchen tiles (shade #1)", - tiles = { - "homedecor_tiles1.png", - "homedecor_tiles1.png", - "homedecor_tiles1.png", - "homedecor_tiles1.png", - "homedecor_tiles1.png^[transformR90", - "homedecor_tiles1.png^[transformR90" - }, - is_ground_content = true, - groups = {cracky=3}, - sounds = default.node_sound_stone_defaults(), -}) +local bathroom_tile_colors = { + { "1", "white/grey" }, + { "2", "white/dark grey" }, + { "3", "white/black" }, + { "4", "black/dark grey" }, +} -minetest.register_node("homedecor:tiles_2", { - description = "Bathroom/kitchen tiles (shade #2)", - tiles = { - "homedecor_tiles2.png", - "homedecor_tiles2.png", - "homedecor_tiles2.png", - "homedecor_tiles2.png", - "homedecor_tiles2.png^[transformR90", - "homedecor_tiles2.png^[transformR90" - }, - is_ground_content = true, - groups = {cracky=3}, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_node("homedecor:tiles_3", { - description = "Bathroom/kitchen tiles (shade #3)", - tiles = { - "homedecor_tiles3.png", - "homedecor_tiles3.png", - "homedecor_tiles3.png", - "homedecor_tiles3.png", - "homedecor_tiles3.png^[transformR90", - "homedecor_tiles3.png^[transformR90" - }, - is_ground_content = true, - groups = {cracky=3}, - sounds = default.node_sound_stone_defaults(), -}) - -minetest.register_node("homedecor:tiles_4", { - description = "Bathroom/kitchen tiles (shade #4)", - tiles = { - "homedecor_tiles4.png", - "homedecor_tiles4.png", - "homedecor_tiles4.png", - "homedecor_tiles4.png", - "homedecor_tiles4.png^[transformR90", - "homedecor_tiles4.png^[transformR90" - }, - is_ground_content = true, - groups = {cracky=3}, - sounds = default.node_sound_stone_defaults(), -}) +for i in ipairs(bathroom_tile_colors) do + local color = bathroom_tile_colors[i][1] + local shade = bathroom_tile_colors[i][2] + minetest.register_node("homedecor:tiles_"..color, { + description = "Bathroom/kitchen tiles ("..shade..")", + tiles = { + "homedecor_bathroom_tiles_"..color..".png", + "homedecor_bathroom_tiles_"..color..".png", + "homedecor_bathroom_tiles_"..color..".png", + "homedecor_bathroom_tiles_"..color..".png", + "homedecor_bathroom_tiles_"..color..".png^[transformR90", + "homedecor_bathroom_tiles_"..color..".png^[transformR90" + }, + is_ground_content = true, + groups = {cracky=3}, + sounds = default.node_sound_stone_defaults(), + }) +end minetest.register_node("homedecor:towel_rod", { description = "Towel rod with towel", diff --git a/homedecor/textures/homedecor_tiles1.png b/homedecor/textures/homedecor_bathroom_tiles_1.png similarity index 100% rename from homedecor/textures/homedecor_tiles1.png rename to homedecor/textures/homedecor_bathroom_tiles_1.png diff --git a/homedecor/textures/homedecor_tiles2.png b/homedecor/textures/homedecor_bathroom_tiles_2.png similarity index 100% rename from homedecor/textures/homedecor_tiles2.png rename to homedecor/textures/homedecor_bathroom_tiles_2.png diff --git a/homedecor/textures/homedecor_tiles3.png b/homedecor/textures/homedecor_bathroom_tiles_3.png similarity index 100% rename from homedecor/textures/homedecor_tiles3.png rename to homedecor/textures/homedecor_bathroom_tiles_3.png diff --git a/homedecor/textures/homedecor_tiles4.png b/homedecor/textures/homedecor_bathroom_tiles_4.png similarity index 100% rename from homedecor/textures/homedecor_tiles4.png rename to homedecor/textures/homedecor_bathroom_tiles_4.png