diff --git a/homedecor/bathroom_furniture.lua b/homedecor/bathroom_furniture.lua index 0e839fda..7a79ecd8 100644 --- a/homedecor/bathroom_furniture.lua +++ b/homedecor/bathroom_furniture.lua @@ -11,7 +11,8 @@ minetest.register_node("homedecor:bathroom_tiles_dark", { mesh = "homedecor_block_with_overlay.obj", paramtype = "light", paramtype2 = "color", - palette = "unifieddyes_palette.png", + palette = "unifieddyes_palette_extended.png", + place_param2 = 240, groups = {cracky=3, ud_param2_colorable = 1}, sounds = default.node_sound_stone_defaults(), after_dig_node = unifieddyes.after_dig_node @@ -27,7 +28,8 @@ minetest.register_node("homedecor:bathroom_tiles_medium", { mesh = "homedecor_block_with_overlay.obj", paramtype = "light", paramtype2 = "color", - palette = "unifieddyes_palette.png", + palette = "unifieddyes_palette_extended.png", + place_param2 = 240, groups = {cracky=3, ud_param2_colorable = 1}, sounds = default.node_sound_stone_defaults(), after_dig_node = unifieddyes.after_dig_node @@ -43,7 +45,8 @@ minetest.register_node("homedecor:bathroom_tiles_light", { mesh = "homedecor_block_with_overlay.obj", paramtype = "light", paramtype2 = "color", - palette = "unifieddyes_palette.png", + palette = "unifieddyes_palette_extended.png", + place_param2 = 240, groups = {cracky=3, ud_param2_colorable = 1}, sounds = default.node_sound_stone_defaults(), after_dig_node = unifieddyes.after_dig_node @@ -163,3 +166,22 @@ minetest.register_lbm({ meta:set_string("dye", "unifieddyes:"..color) end }) + +minetest.register_lbm({ + name = "homedecor:recolor_bathroom_tiles", + label = "Convert bathroom tiles to use UD extended palette", + run_at_every_load = false, + nodenames = { + "homedecor:bathroom_tiles_light", + "homedecor:bathroom_tiles_medium", + "homedecor:bathroom_tiles_dark", + }, + action = function(pos, node) + local meta = minetest.get_meta(pos) + if meta:get_string("palette") ~= "ext" then + print(node.param2.." --> "..unifieddyes.convert_classic_palette[node.param2]) + minetest.swap_node(pos, { name = node.name, param2 = unifieddyes.convert_classic_palette[node.param2] }) + meta:set_string("palette", "ext") + end + end +}) diff --git a/homedecor/lighting.lua b/homedecor/lighting.lua index 369c5bd9..a9f8ad5d 100644 --- a/homedecor/lighting.lua +++ b/homedecor/lighting.lua @@ -414,7 +414,8 @@ local function reg_lamp(suffix, nxt, light, brightness) inventory_image = "homedecor_table_lamp_foot_inv.png^homedecor_table_lamp_top_inv.png", paramtype = "light", paramtype2 = "color", - palette = "unifieddyes_palette.png", + palette = "unifieddyes_palette_extended.png", + place_param2 = 240, walkable = false, light_source = light, selection_box = tlamp_cbox, @@ -442,7 +443,8 @@ local function reg_lamp(suffix, nxt, light, brightness) inventory_image = "homedecor_standing_lamp_foot_inv.png^homedecor_standing_lamp_top_inv.png", paramtype = "light", paramtype2 = "color", - palette = "unifieddyes_palette.png", + palette = "unifieddyes_palette_extended.png", + place_param2 = 240, walkable = false, light_source = light, groups = {cracky=2,oddly_breakable_by_hand=1, ud_param2_colorable = 1, @@ -691,3 +693,28 @@ minetest.register_lbm({ meta:set_string("dye", "unifieddyes:"..color) end }) + +minetest.register_lbm({ + name = "homedecor:recolor_lighting", + label = "Convert some kinds of lights to use UD extended palette", + run_at_every_load = false, + nodenames = { + "homedecor:table_lamp_off", + "homedecor:table_lamp_low", + "homedecor:table_lamp_med", + "homedecor:table_lamp_hi", + "homedecor:table_lamp_max", + "homedecor:standing_lamp_off", + "homedecor:standing_lamp_low", + "homedecor:standing_lamp_med", + "homedecor:standing_lamp_hi", + "homedecor:standing_lamp_max", + }, + action = function(pos, node) + local meta = minetest.get_meta(pos) + if meta:get_string("palette") ~= "ext" then + minetest.swap_node(pos, { name = node.name, param2 = unifieddyes.convert_classic_palette[node.param2] }) + meta:set_string("palette", "ext") + end + end +})