summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2018-08-28 22:38:22 -0400
committerVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2018-08-28 22:39:57 -0400
commit1851f0f57f617ff01da5b932c11114cc73e75d0a (patch)
treec9e396238b84e843b7944b9384a41c17e2112ecd
parentc14eca1317b4b7641a4527602e602182e5105c13 (diff)
downloadunifiedmesecons-1851f0f57f617ff01da5b932c11114cc73e75d0a.tar
unifiedmesecons-1851f0f57f617ff01da5b932c11114cc73e75d0a.tar.gz
unifiedmesecons-1851f0f57f617ff01da5b932c11114cc73e75d0a.tar.bz2
unifiedmesecons-1851f0f57f617ff01da5b932c11114cc73e75d0a.tar.xz
unifiedmesecons-1851f0f57f617ff01da5b932c11114cc73e75d0a.zip
add keys for airbrush special case mode
needs unified dyes commit bdecad65 or later
-rw-r--r--init.lua29
1 files changed, 23 insertions, 6 deletions
diff --git a/init.lua b/init.lua
index 195eab0..2c1994d 100644
--- a/init.lua
+++ b/init.lua
@@ -66,6 +66,9 @@ minetest.register_alias("mesecons_extrawires:corner_off", "mesecons_extrawires:i
minetest.register_alias("mesecons_extrawires:tjunction_off", "mesecons_extrawires:insulated_tjunction_white_off")
for _,color in pairs(hues) do
+ local cstart = 30
+ local cend = cstart + string.len(color) - 1
+
local palettecolor = color
if color == "black" or string.find(color, "grey") or color == "white" then
palettecolor = "grey"
@@ -86,6 +89,8 @@ for _,color in pairs(hues) do
on_place = minetest.rotate_node,
drop = "mesecons_insulated:insulated_white_off",
palette = "unifieddyes_palette_"..palettecolor.."s.png",
+ ud_color_start = cstart,
+ ud_color_end = cend,
selection_box = {
type = "fixed",
fixed = { -16/32-0.001, -18/32, -7/32, 16/32+0.001, -12/32, 7/32 }
@@ -96,7 +101,7 @@ for _,color in pairs(hues) do
},
},
{
- groups = {dig_immediate = 3,not_in_creative_inventory = (color~="white" and 1 or nil)},
+ groups = {ud_param2_colorable = 1, dig_immediate = 3,not_in_creative_inventory = (color~="white" and 1 or nil)},
mesecons = {conductor = {
state = mesecon.state.off,
onstate = "mesecons_insulated:insulated_"..color.."_on",
@@ -112,7 +117,7 @@ for _,color in pairs(hues) do
},
},
{
- groups = {dig_immediate = 3,not_in_creative_inventory = 1},
+ groups = {ud_param2_colorable = 1, dig_immediate = 3,not_in_creative_inventory = 1},
mesecons = {conductor = {
state = mesecon.state.on,
offstate = "mesecons_insulated:insulated_"..color.."_off",
@@ -127,6 +132,10 @@ for _,color in pairs(hues) do
"unifiedmesecons_wire_on.png",
},
})
+
+ cstart = 38
+ cend = cstart + string.len(color) - 1
+
mesecon.register_node(":mesecons_extrawires:insulated_corner_"..color, {
drawtype = "nodebox",
description = "Insulated Mesecon Corner",
@@ -137,6 +146,8 @@ for _,color in pairs(hues) do
on_place = minetest.rotate_node,
drop = "mesecons_extrawires:insulated_corner_white_off",
palette = "unifieddyes_palette_"..palettecolor.."s.png",
+ ud_color_start = cstart,
+ ud_color_end = cend,
selection_box = {
type = "fixed",
fixed = { -16/32-0.001, -18/32, -16/32, 5/32, -12/32, 5/32 },
@@ -148,7 +159,7 @@ for _,color in pairs(hues) do
},
},
{
- groups = {dig_immediate = 3,not_in_creative_inventory = (color~="white" and 1 or nil)},
+ groups = {ud_param2_colorable = 1, dig_immediate = 3,not_in_creative_inventory = (color~="white" and 1 or nil)},
mesecons = {conductor = {
state = mesecon.state.off,
onstate = "mesecons_extrawires:insulated_corner_"..color.."_on",
@@ -164,7 +175,7 @@ for _,color in pairs(hues) do
},
},
{
- groups = {dig_immediate = 3,not_in_creative_inventory = 1},
+ groups = {ud_param2_colorable = 1, dig_immediate = 3,not_in_creative_inventory = 1},
mesecons = {conductor = {
state = mesecon.state.on,
offstate = "mesecons_extrawires:insulated_corner_"..color.."_off",
@@ -179,6 +190,10 @@ for _,color in pairs(hues) do
"unifiedmesecons_wire_end_on.png",
},
})
+
+ cstart = 41
+ cend = cstart + string.len(color) - 1
+
mesecon.register_node(":mesecons_extrawires:insulated_tjunction_"..color, {
drawtype = "nodebox",
description = "Insulated Mesecon T-Junction",
@@ -189,6 +204,8 @@ for _,color in pairs(hues) do
on_place = minetest.rotate_node,
drop = "mesecons_extrawires:insulated_tjunction_white_off",
palette = "unifieddyes_palette_"..palettecolor.."s.png",
+ ud_color_start = cstart,
+ ud_color_end = cend,
node_box = {
type = "fixed",
fixed = {{ -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 },
@@ -200,7 +217,7 @@ for _,color in pairs(hues) do
},
},
{
- groups = {dig_immediate = 3,not_in_creative_inventory = (color~="white" and 1 or nil)},
+ groups = {ud_param2_colorable = 1, dig_immediate = 3,not_in_creative_inventory = (color~="white" and 1 or nil)},
mesecons = {conductor = {
state = mesecon.state.off,
onstate = "mesecons_extrawires:insulated_tjunction_"..color.."_on",
@@ -216,7 +233,7 @@ for _,color in pairs(hues) do
},
},
{
- groups = {dig_immediate = 3,not_in_creative_inventory = 1},
+ groups = {ud_param2_colorable = 1, dig_immediate = 3,not_in_creative_inventory = 1},
mesecons = {conductor = {
state = mesecon.state.on,
offstate = "mesecons_extrawires:insulated_tjunction_"..color.."_off",