From ba5b7aee52af1280fdb3c019bba3b5b92c001e96 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rollo Date: Mon, 26 Nov 2018 21:05:58 +0100 Subject: Red and blue signs, node names tidy up --- signs_road/compatibility.lua | 7 +- signs_road/crafts.lua | 130 +++++++++++-- signs_road/nodes.lua | 207 +++++++++++++++++---- signs_road/textures/signs_road_blue.png | Bin 436 -> 302 bytes .../textures/signs_road_blue_dir_inventory.png | Bin 0 -> 377 bytes signs_road/textures/signs_road_blue_direction.png | Bin 0 -> 1108 bytes signs_road/textures/signs_road_blue_street.png | Bin 0 -> 436 bytes signs_road/textures/signs_road_red.png | Bin 0 -> 282 bytes .../textures/signs_road_red_dir_inventory.png | Bin 0 -> 289 bytes signs_road/textures/signs_road_red_direction.png | Bin 0 -> 1071 bytes 10 files changed, 284 insertions(+), 60 deletions(-) create mode 100644 signs_road/textures/signs_road_blue_dir_inventory.png create mode 100644 signs_road/textures/signs_road_blue_direction.png create mode 100644 signs_road/textures/signs_road_blue_street.png create mode 100644 signs_road/textures/signs_road_red.png create mode 100644 signs_road/textures/signs_road_red_dir_inventory.png create mode 100644 signs_road/textures/signs_road_red_direction.png diff --git a/signs_road/compatibility.lua b/signs_road/compatibility.lua index 9e6b29b..5fb673a 100644 --- a/signs_road/compatibility.lua +++ b/signs_road/compatibility.lua @@ -22,7 +22,7 @@ ------------------------------------ local wallmounted_to_facedir = { - [0]=1, -- Should not happend with signs + [0]=1, -- Should not happend with signs [1]=1, -- Should not happend with signs [2]=1, [3]=3, @@ -82,4 +82,9 @@ minetest.register_lbm({ name = "signs_road:conpatibility_2", action = compatibility_check_2, }) +-- Node name tidy up +-------------------- +minetest.register_alias("signs_road:green_street_sign", "signs_road:green_sign") +minetest.register_alias("signs_road:yellow_street_sign", "signs_road:yellow_sign") +minetest.register_alias("signs_road:white_street_sign", "signs_road:white_sign") diff --git a/signs_road/crafts.lua b/signs_road/crafts.lua index 3c15437..314a91a 100644 --- a/signs_road/crafts.lua +++ b/signs_road/crafts.lua @@ -19,57 +19,54 @@ along with signs_road. If not, see . --]] +-- Standard rectangle signs + minetest.register_craft({ - output = 'signs_road:blue_street_sign 2', + output = 'signs_road:white_sign 2', recipe = { - {'dye:blue', 'dye:white', ''}, + {'dye:white', 'dye:black', ''}, {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, {'', '', ''}, } }) minetest.register_craft({ - output = 'signs_road:red_street_sign 2', + output = 'signs_road:blue_sign 2', recipe = { - {'dye:white', 'dye:red', ''}, + {'dye:blue', 'dye:white', ''}, {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, {'', '', ''}, } }) minetest.register_craft({ - output = 'signs_road:white_street_sign 2', + output = 'signs_road:green_sign 2', recipe = { - {'dye:white', 'dye:black', ''}, + {'dye:green', 'dye:white', ''}, {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, {'', '', ''}, } }) minetest.register_craft({ - type = "shapeless", - output = 'signs_road:large_street_sign', - recipe = {'signs_road:white_street_sign', 'signs_road:white_street_sign', 'signs_road:white_street_sign', 'signs_road:white_street_sign'}, -}) - -minetest.register_craft({ - output = 'signs_road:green_street_sign 2', + output = 'signs_road:yellow_sign 2', recipe = { - {'dye:green', 'dye:white', ''}, + {'dye:yellow', 'dye:black', ''}, {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, {'', '', ''}, } }) minetest.register_craft({ - output = 'signs_road:yellow_street_sign 2', + output = 'signs_road:red_sign 2', recipe = { - {'dye:yellow', 'dye:black', ''}, + {'dye:red', 'dye:white', ''}, {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, {'', '', ''}, } }) +-- Standard direction signs minetest.register_craft({ output = 'signs_road:black_right_sign 2', @@ -80,6 +77,24 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = 'signs_road:white_right_sign 2', + recipe = { + {'dye:white', 'dye:black', 'default:steel_ingot'}, + {'default:steel_ingot', 'default:steel_ingot', ''}, + {'', '', ''}, + } +}) + +minetest.register_craft({ + output = 'signs_road:blue_right_sign 2', + recipe = { + {'dye:blue', 'dye:white', 'default:steel_ingot'}, + {'default:steel_ingot', 'default:steel_ingot', ''}, + {'', '', ''}, + } +}) + minetest.register_craft({ output = 'signs_road:green_right_sign 2', recipe = { @@ -92,18 +107,95 @@ minetest.register_craft({ minetest.register_craft({ output = 'signs_road:yellow_right_sign 2', recipe = { - {'dye:yellow', 'dye:white', 'default:steel_ingot'}, + {'dye:yellow', 'dye:black', 'default:steel_ingot'}, {'default:steel_ingot', 'default:steel_ingot', ''}, {'', '', ''}, } }) minetest.register_craft({ - output = 'signs_road:white_right_sign 2', + output = 'signs_road:red_right_sign 2', recipe = { - {'dye:white', 'dye:black', 'default:steel_ingot'}, + {'dye:red', 'dye:white', 'default:steel_ingot'}, {'default:steel_ingot', 'default:steel_ingot', ''}, {'', '', ''}, } }) +-- Transform Rectangle <-> Direction + +minetest.register_craft({ + type = 'shapeless', output = 'signs_road:white_right_sign', + recipe = {'signs_road:white_sign'}, +}) + +minetest.register_craft({ + type = 'shapeless', output = 'signs_road:white_sign', + recipe = {'signs_road:white_right_sign'}, +}) + +minetest.register_craft({ + type = 'shapeless', output = 'signs_road:blue_right_sign', + recipe = {'signs_road:blue_sign'}, +}) + +minetest.register_craft({ + type = 'shapeless', output = 'signs_road:blue_sign', + recipe = {'signs_road:blue_right_sign'}, +}) + +minetest.register_craft({ + type = 'shapeless', output = 'signs_road:green_right_sign', + recipe = {'signs_road:green_sign'}, +}) + +minetest.register_craft({ + type = 'shapeless', output = 'signs_road:green_sign', + recipe = {'signs_road:green_right_sign'}, +}) + +minetest.register_craft({ + type = 'shapeless', output = 'signs_road:yellow_right_sign', + recipe = {'signs_road:yellow_sign'}, +}) + +minetest.register_craft({ + type = 'shapeless', output = 'signs_road:yellow_sign', + recipe = {'signs_road:yellow_right_sign'}, +}) + +minetest.register_craft({ + type = 'shapeless', output = 'signs_road:red_right_sign', + recipe = {'signs_road:red_sign'}, +}) + +minetest.register_craft({ + type = 'shapeless', output = 'signs_road:red_sign', + recipe = {'signs_road:red_right_sign'}, +}) + +-- Various signs + +minetest.register_craft({ + output = 'signs_road:blue_street_sign 4', + recipe = { + {'dye:blue', 'dye:white', 'dye:blue'}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + } +}) + +minetest.register_craft({ + output = 'signs_road:red_street_sign 2', + recipe = { + {'dye:white', 'dye:red', 'dye:black'}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + {'', '', ''}, + } +}) + +minetest.register_craft({ + type = "shapeless", + output = 'signs_road:large_street_sign', + recipe = {'signs_road:white_street_sign', 'signs_road:white_street_sign', 'signs_road:white_street_sign', 'signs_road:white_street_sign'}, +}) diff --git a/signs_road/nodes.lua b/signs_road/nodes.lua index b560e96..74eca23 100644 --- a/signs_road/nodes.lua +++ b/signs_road/nodes.lua @@ -33,10 +33,10 @@ local models = { }, node_fields = { description = S("Blue street sign"), - tiles = { "signs_road_sides.png", "signs_road_sides.png", - "signs_road_sides.png", "signs_road_sides.png", - "signs_road_sides.png", "signs_road_blue.png" }, - inventory_image = "signs_road_blue.png", + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_blue_street.png" }, + inventory_image = "signs_road_blue_street.png", }, }, large_street_sign = { @@ -50,8 +50,8 @@ local models = { node_fields = { visual_scale = 1, description = S("Large banner"), - tiles = { "signs_road_sides.png", "signs_road_sides.png", - "signs_road_sides.png", "signs_road_sides.png", + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", "signs_road_sides.png", "signs_road_large_white.png" }, inventory_image = "signs_road_white.png", }, @@ -67,13 +67,13 @@ local models = { }, node_fields = { description = S("Red and white town sign"), - tiles = { "signs_road_sides.png", "signs_road_sides.png", - "signs_road_sides.png", "signs_road_sides.png", + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", "signs_road_sides.png", "signs_road_red_white.png" }, inventory_image="signs_road_red_white.png", }, }, - white_street_sign = { + white_sign = { depth = 1/16, width = 1, height = 7/16, @@ -84,13 +84,13 @@ local models = { }, node_fields = { description = S("White street sign"), - tiles = { "signs_road_sides.png", "signs_road_sides.png", - "signs_road_sides.png", "signs_road_sides.png", + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", "signs_road_sides.png", "signs_road_white.png" }, inventory_image = "signs_road_white.png", }, }, - green_street_sign = { + blue_sign = { depth = 1/16, width = 1, height = 7/16, @@ -100,14 +100,31 @@ local models = { color = "#fff", }, node_fields = { - description = S("Green street sign"), - tiles = { "signs_road_sides.png", "signs_road_sides.png", - "signs_road_sides.png", "signs_road_sides.png", + description = S("Blue road sign"), + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_blue.png" }, + inventory_image = "signs_road_blue.png", + }, + }, + green_sign = { + depth = 1/16, + width = 1, + height = 7/16, + entity_fields = { + size = { x = 1, y = 6/16 }, + maxlines = 2, + color = "#fff", + }, + node_fields = { + description = S("Green road sign"), + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", "signs_road_sides.png", "signs_road_green.png" }, inventory_image = "signs_road_green.png", }, }, - yellow_street_sign = { + yellow_sign = { depth = 1/16, width = 1, height = 7/16, @@ -117,13 +134,30 @@ local models = { color = "#000", }, node_fields = { - description = S("Yellow street sign"), - tiles = { "signs_road_sides.png", "signs_road_sides.png", - "signs_road_sides.png", "signs_road_sides.png", + description = S("Yellow road sign"), + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", "signs_road_sides.png", "signs_road_yellow.png" }, inventory_image="signs_road_yellow.png", }, }, + red_sign = { + depth = 1/16, + width = 1, + height = 7/16, + entity_fields = { + size = { x = 1, y = 6/16 }, + maxlines = 2, + color = "#fff", + }, + node_fields = { + description = S("Red road sign"), + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_red.png" }, + inventory_image = "signs_road_red.png", + }, + }, black_right_sign = { depth = 1/32, width = 1, @@ -136,8 +170,8 @@ local models = { }, node_fields = { description = S("Black direction sign"), - tiles = { "signs_road_sides.png", "signs_road_sides.png", - "signs_road_sides.png", "signs_road_sides.png", + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", "signs_road_sides.png", "signs_road_black_dir_right.png" }, inventory_image = "signs_road_black_dir_inventory.png", signs_other_dir = "signs_road:black_left_sign", @@ -157,8 +191,8 @@ local models = { }, node_fields = { description = S("Black direction sign"), - tiles = { "signs_road_sides.png", "signs_road_sides.png", - "signs_road_sides.png", "signs_road_sides.png", + tiles = { "signs_road_sides.png", "signs_road_sides.png", + "signs_road_sides.png", "signs_road_sides.png", "signs_road_sides.png", "signs_road_black_dir_left.png" }, inventory_image = "signs_road_black_dir_inventory.png", signs_other_dir = "signs_road:black_right_sign", @@ -168,7 +202,102 @@ local models = { on_rightclick = signs_api.on_right_click_direction, }, }, - + white_right_sign = { + depth = 1/16, + width = 14/16, + height = 7/16, + entity_fields = { + right = -3/32, + size = { x = 12/16, y = 6/16 }, + maxlines = 2, + color = "#000", + }, + node_fields = { + description = S("White direction sign"), + tiles = { "signs_road_white_direction.png" }, + inventory_image = "signs_road_white_dir_inventory.png", + signs_other_dir = "signs_road:white_left_sign", + on_place = signs_api.on_place_direction, + on_rightclick = signs_api.on_right_click_direction, + drawtype = "mesh", + mesh = "signs_dir_right.obj", + selection_box = { type = "fixed", fixed = { -0.5, -7/32, 0.5, 7/16, 7/32, 7/16 } }, + collision_box = { type = "fixed", fixed = { -0.5, -7/32, 0.5, 7/16, 7/32, 7/16 } }, + }, + }, + white_left_sign = { + depth = 1/16, + width = 14/16, + height = 7/16, + entity_fields = { + right = 3/32, + size = { x = 12/16, y = 6/16 }, + maxlines = 2, + color = "#000", + }, + node_fields = { + description = S("White direction sign"), + tiles = { "signs_road_white_direction.png" }, + inventory_image = "signs_road_white_dir_inventory.png", + signs_other_dir = "signs_road:white_right_sign", + on_place=signs_api.on_place_direction, + on_rightclick = signs_api.on_right_click_direction, + drawtype = "mesh", + mesh = "signs_dir_left.obj", + selection_box = { type = "fixed", fixed = { -7/16, -7/32, 0.5, 0.5, 7/32, 7/16 } }, + collision_box = { type = "fixed", fixed = { -7/16, -7/32, 0.5, 0.5, 7/32, 7/16 } }, + groups = { not_in_creative_inventory = 1 }, + drop = "signs_road:white_right_sign", + }, + }, + blue_right_sign = { + depth = 1/16, + width = 14/16, + height = 7/16, + entity_fields = { + right = -3/32, + size = { x = 12/16, y = 6/16 }, + maxlines = 2, + color = "#fff", + }, + node_fields = { + description = S("Blue direction sign"), + tiles = { "signs_road_blue_direction.png" }, + inventory_image = "signs_road_blue_dir_inventory.png", + signs_other_dir = "signs_road:blue_left_sign", + on_place = signs_api.on_place_direction, + on_rightclick = signs_api.on_right_click_direction, + drawtype = "mesh", + mesh = "signs_dir_right.obj", + selection_box = { type = "fixed", fixed = { -0.5, -7/32, 0.5, 7/16, 7/32, 7/16 } }, + collision_box = { type = "fixed", fixed = { -0.5, -7/32, 0.5, 7/16, 7/32, 7/16 } }, + }, + }, + blue_left_sign = { + depth = 1/16, + width = 14/16, + height = 7/16, + entity_fields = { + right = 3/32, + size = { x = 12/16, y = 6/16 }, + maxlines = 2, + color="#fff", + }, + node_fields = { + description = S("Blue direction sign"), + tiles = { "signs_road_blue_direction.png" }, + inventory_image = "signs_road_blue_dir_inventory.png", + signs_other_dir = "signs_road:blue_right_sign", + on_place = signs_api.on_place_direction, + on_rightclick = signs_api.on_right_click_direction, + drawtype = "mesh", + mesh = "signs_dir_left.obj", + selection_box = { type = "fixed", fixed = { -7/16, -7/32, 0.5, 0.5, 7/32, 7/16 } }, + collision_box = { type = "fixed", fixed = { -7/16, -7/32, 0.5, 0.5, 7/32, 7/16 } }, + groups = { not_in_creative_inventory = 1 }, + drop = "signs_road:blue_right_sign", + }, + }, green_right_sign = { depth = 1/16, width = 14/16, @@ -265,7 +394,7 @@ local models = { drop = "signs_road:yellow_right_sign", }, }, - white_right_sign = { + red_right_sign = { depth = 1/16, width = 14/16, height = 7/16, @@ -273,13 +402,13 @@ local models = { right = -3/32, size = { x = 12/16, y = 6/16 }, maxlines = 2, - color = "#000", + color = "#fff", }, node_fields = { - description = S("White direction sign"), - tiles = { "signs_road_white_direction.png" }, - inventory_image = "signs_road_white_dir_inventory.png", - signs_other_dir = "signs_road:white_left_sign", + description = S("Red direction sign"), + tiles = { "signs_road_red_direction.png" }, + inventory_image = "signs_road_red_dir_inventory.png", + signs_other_dir = "signs_road:red_left_sign", on_place = signs_api.on_place_direction, on_rightclick = signs_api.on_right_click_direction, drawtype = "mesh", @@ -288,7 +417,7 @@ local models = { collision_box = { type = "fixed", fixed = { -0.5, -7/32, 0.5, 7/16, 7/32, 7/16 } }, }, }, - white_left_sign = { + red_left_sign = { depth = 1/16, width = 14/16, height = 7/16, @@ -296,21 +425,21 @@ local models = { right = 3/32, size = { x = 12/16, y = 6/16 }, maxlines = 2, - color = "#000", + color = "#fff", }, node_fields = { - description = S("White direction sign"), - tiles = { "signs_road_white_direction.png" }, - inventory_image = "signs_road_white_dir_inventory.png", - signs_other_dir = "signs_road:white_right_sign", - on_place=signs_api.on_place_direction, + description = S("Red direction sign"), + tiles = { "signs_road_red_direction.png" }, + inventory_image = "signs_road_red_dir_inventory.png", + signs_other_dir = "signs_road:red_right_sign", + on_place = signs_api.on_place_direction, on_rightclick = signs_api.on_right_click_direction, drawtype = "mesh", mesh = "signs_dir_left.obj", selection_box = { type = "fixed", fixed = { -7/16, -7/32, 0.5, 0.5, 7/32, 7/16 } }, collision_box = { type = "fixed", fixed = { -7/16, -7/32, 0.5, 0.5, 7/32, 7/16 } }, groups = { not_in_creative_inventory = 1 }, - drop = "signs_road:white_right_sign", + drop = "signs_road:red_right_sign", }, }, } @@ -320,5 +449,3 @@ for name, model in pairs(models) do signs_api.register_sign("signs_road", name, model) end - - diff --git a/signs_road/textures/signs_road_blue.png b/signs_road/textures/signs_road_blue.png index 540a390..51dc83b 100644 Binary files a/signs_road/textures/signs_road_blue.png and b/signs_road/textures/signs_road_blue.png differ diff --git a/signs_road/textures/signs_road_blue_dir_inventory.png b/signs_road/textures/signs_road_blue_dir_inventory.png new file mode 100644 index 0000000..426c997 Binary files /dev/null and b/signs_road/textures/signs_road_blue_dir_inventory.png differ diff --git a/signs_road/textures/signs_road_blue_direction.png b/signs_road/textures/signs_road_blue_direction.png new file mode 100644 index 0000000..bba2b00 Binary files /dev/null and b/signs_road/textures/signs_road_blue_direction.png differ diff --git a/signs_road/textures/signs_road_blue_street.png b/signs_road/textures/signs_road_blue_street.png new file mode 100644 index 0000000..540a390 Binary files /dev/null and b/signs_road/textures/signs_road_blue_street.png differ diff --git a/signs_road/textures/signs_road_red.png b/signs_road/textures/signs_road_red.png new file mode 100644 index 0000000..5614f6f Binary files /dev/null and b/signs_road/textures/signs_road_red.png differ diff --git a/signs_road/textures/signs_road_red_dir_inventory.png b/signs_road/textures/signs_road_red_dir_inventory.png new file mode 100644 index 0000000..4d9d559 Binary files /dev/null and b/signs_road/textures/signs_road_red_dir_inventory.png differ diff --git a/signs_road/textures/signs_road_red_direction.png b/signs_road/textures/signs_road_red_direction.png new file mode 100644 index 0000000..632a925 Binary files /dev/null and b/signs_road/textures/signs_road_red_direction.png differ -- cgit v1.2.3