1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-12-23 00:20:17 +01:00

use new Unified Dyes "extended" palette

for bathroom tiles, table lamps, and standing lamps
requires unified dyes commit d2819353 or newer
This commit is contained in:
Vanessa Ezekowitz 2017-02-24 19:06:17 -05:00
parent 8e6fa4cdff
commit efbc491245
2 changed files with 54 additions and 5 deletions

View File

@ -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
})

View File

@ -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
})