diff options
-rw-r--r-- | coloredwood/init.lua | 1 | ||||
-rw-r--r-- | homedecor/misc-nodes.lua | 1 | ||||
-rw-r--r-- | unifieddyes/init.lua | 23 |
3 files changed, 17 insertions, 8 deletions
diff --git a/coloredwood/init.lua b/coloredwood/init.lua index 0af56c3..4a62435 100644 --- a/coloredwood/init.lua +++ b/coloredwood/init.lua @@ -125,6 +125,7 @@ if coloredwood.enable_stairsplus then minetest.override_item(i.name, { groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1, not_in_creative_inventory=1, ud_param2_colorable = 1}, paramtype2 = "colorfacedir", + palette = "unifieddyes_palette_greys.png", airbrush_replacement_node = "coloredwood:"..class.."_wood_grey_"..shape }) end diff --git a/homedecor/misc-nodes.lua b/homedecor/misc-nodes.lua index 389d26d..9be77cb 100644 --- a/homedecor/misc-nodes.lua +++ b/homedecor/misc-nodes.lua @@ -515,6 +515,7 @@ for _, side in ipairs({"diagonal_left", "diagonal_right", "horizontal"}) do end if name == "wood" then + def.palette = "unifieddyes_palette_greys.png" def.airbrush_replacement_node = "homedecor:banister_wood_"..side.."_grey" def.groups.ud_param2_colorable = 1 def.paramtype2 = "colorfacedir" diff --git a/unifieddyes/init.lua b/unifieddyes/init.lua index 8f6de0f..c371b69 100644 --- a/unifieddyes/init.lua +++ b/unifieddyes/init.lua @@ -654,12 +654,14 @@ function unifieddyes.on_airbrush(itemstack, player, pointed_thing) local palette = nil local fdir = 0 - if def.paramtype2 == "color" then + if def.palette == "unifieddyes_palette_extended.png" then palette = "extended" - elseif def.paramtype2 == "colorwallmounted" then + elseif def.palette == "unifieddyes_palette_colorwallmounted.png" then palette = "wallmounted" fdir = node.param2 % 8 - elseif def.paramtype2 == "colorfacedir" then + elseif def.palette ~= "unifieddyes_palette_extended.png" + and def.palette ~= "unifieddyes_palette_colorwallmounted.png" + and string.find(def.palette, "unifieddyes_palette_") then palette = "split" fdir = node.param2 % 32 else @@ -871,19 +873,24 @@ function unifieddyes.show_airbrush_form(player) local last_right_click = unifieddyes.player_last_right_clicked[player_name] if last_right_click then - if last_right_click.def and last_right_click.def.paramtype2 then - if last_right_click.def.paramtype2 == "colorwallmounted" then + if last_right_click.def and last_right_click.def.palette then + if last_right_click.def.palette == "unifieddyes_palette_colorwallmounted.png" then nodepalette = "wallmounted" - elseif last_right_click.def.paramtype2 == "color" then + elseif last_right_click.def.palette == "unifieddyes_palette_extended.png" then t[#t+1] = "label[0.5,8.25;(Right-clicked a node that supports all 256 colors, showing them all)]" showall = true - elseif last_right_click.def.paramtype2 == "colorfacedir" then + elseif last_right_click.def.palette ~= "unifieddyes_palette_extended.png" + and last_right_click.def.palette ~= "unifieddyes_palette_colorwallmounted.png" + and string.find(last_right_click.def.palette, "unifieddyes_palette_") then nodepalette = "split" end end end - if not last_right_click.def.groups or not last_right_click.def.groups.ud_param2_colorable then + if not last_right_click.def.groups + or not last_right_click.def.groups.ud_param2_colorable + or not last_right_click.def.palette + or not string.find(last_right_click.def.palette, "unifieddyes_palette_") then t[#t+1] = "label[0.5,8.25;(Right-clicked a node not supported by the Airbrush, showing all colors)]" end |