2016-08-25 21:58:28 +02:00
|
|
|
--[[
|
|
|
|
signs_road mod for Minetest - Various road signs with text displayed
|
|
|
|
on.
|
|
|
|
(c) Pierre-Yves Rollo
|
|
|
|
|
|
|
|
This file is part of signs_road.
|
|
|
|
|
|
|
|
signs_road is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
signs_road is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with signs_road. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
--]]
|
2015-11-28 20:44:41 +01:00
|
|
|
|
2017-08-05 10:12:43 +02:00
|
|
|
local S = signs_road.intllib
|
|
|
|
|
2015-11-28 20:44:41 +01:00
|
|
|
local models = {
|
2017-08-26 14:12:38 +02:00
|
|
|
blue_street_sign = {
|
2015-11-28 20:44:41 +01:00
|
|
|
depth = 1/16,
|
|
|
|
width = 14/16,
|
|
|
|
height = 12/16,
|
|
|
|
entity_fields = {
|
|
|
|
resolution = { x = 144, y = 64 },
|
|
|
|
maxlines = 3,
|
2017-08-26 14:12:38 +02:00
|
|
|
color = "#fff",
|
2015-11-28 20:44:41 +01:00
|
|
|
},
|
|
|
|
node_fields = {
|
2017-08-26 14:12:38 +02:00
|
|
|
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",
|
2015-11-28 20:44:41 +01:00
|
|
|
},
|
|
|
|
},
|
2017-08-26 14:12:38 +02:00
|
|
|
red_street_sign = {
|
|
|
|
depth = 1/16,
|
2015-11-28 20:44:41 +01:00
|
|
|
width = 1,
|
2017-08-26 14:12:38 +02:00
|
|
|
height = 7/16,
|
2015-11-28 20:44:41 +01:00
|
|
|
entity_fields = {
|
|
|
|
resolution = { x = 96, y = 64 },
|
|
|
|
maxlines = 1,
|
2017-08-26 14:12:38 +02:00
|
|
|
color = "#000",
|
|
|
|
},
|
|
|
|
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",
|
|
|
|
"signs_road_sides.png", "signs_road_red_white.png" },
|
|
|
|
inventory_image="signs_road_red_white.png",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
white_street_sign = {
|
|
|
|
depth = 1/16,
|
|
|
|
width = 1,
|
|
|
|
height = 7/16,
|
|
|
|
entity_fields = {
|
|
|
|
resolution = { x = 96, y = 64 },
|
|
|
|
maxlines = 2,
|
|
|
|
color = "#000",
|
|
|
|
},
|
|
|
|
node_fields = {
|
|
|
|
description = S("White 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_white.png" },
|
|
|
|
inventory_image = "signs_road_white.png",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
green_street_sign = {
|
|
|
|
depth = 1/16,
|
|
|
|
width = 1,
|
|
|
|
height = 7/16,
|
|
|
|
entity_fields = {
|
|
|
|
resolution = { x = 96, y = 64 },
|
|
|
|
maxlines = 2,
|
|
|
|
color = "#fff",
|
2015-11-28 20:44:41 +01:00
|
|
|
},
|
|
|
|
node_fields = {
|
2017-08-26 14:12:38 +02:00
|
|
|
description = S("Green 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_green.png" },
|
|
|
|
inventory_image = "signs_road_green.png",
|
2015-11-28 20:44:41 +01:00
|
|
|
},
|
|
|
|
},
|
2017-08-26 14:12:38 +02:00
|
|
|
yellow_street_sign = {
|
|
|
|
depth = 1/16,
|
|
|
|
width = 1,
|
|
|
|
height = 7/16,
|
|
|
|
entity_fields = {
|
|
|
|
resolution = { x = 96, y = 64 },
|
|
|
|
maxlines = 2,
|
|
|
|
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",
|
|
|
|
"signs_road_sides.png", "signs_road_yellow.png" },
|
|
|
|
inventory_image="signs_road_yellow.png",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
black_right_sign = {
|
2016-12-24 21:45:27 +01:00
|
|
|
depth = 1/32,
|
2015-11-28 20:44:41 +01:00
|
|
|
width = 1,
|
|
|
|
height = 0.5,
|
|
|
|
entity_fields = {
|
2017-08-26 14:12:38 +02:00
|
|
|
resolution = { x = 96, y = 64 },
|
2015-11-28 20:44:41 +01:00
|
|
|
maxlines = 1,
|
2017-08-26 14:12:38 +02:00
|
|
|
color = "#000",
|
2015-11-28 20:44:41 +01:00
|
|
|
},
|
|
|
|
node_fields = {
|
2017-08-26 14:12:38 +02:00
|
|
|
description = S("Black direction sign"),
|
|
|
|
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",
|
|
|
|
on_place = signs.on_place_direction,
|
|
|
|
on_rightclick = signs.on_right_click_direction,
|
2015-11-28 20:44:41 +01:00
|
|
|
},
|
|
|
|
},
|
2017-08-26 14:12:38 +02:00
|
|
|
black_left_sign = {
|
2016-12-24 21:45:27 +01:00
|
|
|
depth = 1/32,
|
2015-11-28 20:44:41 +01:00
|
|
|
width = 1,
|
|
|
|
height = 0.5,
|
|
|
|
entity_fields = {
|
|
|
|
resolution = { x = 96, y = 64 },
|
|
|
|
maxlines = 1,
|
2017-08-26 14:12:38 +02:00
|
|
|
color = "#000",
|
2015-11-28 20:44:41 +01:00
|
|
|
},
|
|
|
|
node_fields = {
|
2017-08-26 14:12:38 +02:00
|
|
|
description = S("Black direction sign"),
|
|
|
|
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",
|
|
|
|
groups = { not_in_creative_inventory = 1 },
|
|
|
|
drop = "signs_road:black_right_sign",
|
|
|
|
on_place = signs.on_place_direction,
|
|
|
|
on_rightclick = signs.on_right_click_direction,
|
2015-11-28 20:44:41 +01:00
|
|
|
},
|
|
|
|
},
|
2017-08-26 14:12:38 +02:00
|
|
|
|
|
|
|
green_right_sign = {
|
2016-12-24 21:45:27 +01:00
|
|
|
depth = 1/16,
|
|
|
|
width = 14/16,
|
|
|
|
height = 7/16,
|
|
|
|
entity_fields = {
|
2017-08-26 14:12:38 +02:00
|
|
|
right = -3/32,
|
2016-12-25 20:14:56 +01:00
|
|
|
size = { x = 12/16, y = 6/16 },
|
2016-12-24 21:45:27 +01:00
|
|
|
resolution = { x = 112, y = 64 },
|
|
|
|
maxlines = 2,
|
2017-08-26 14:12:38 +02:00
|
|
|
color = "#fff",
|
2016-12-24 21:45:27 +01:00
|
|
|
},
|
|
|
|
node_fields = {
|
2017-08-26 14:12:38 +02:00
|
|
|
description = S("Green direction sign"),
|
|
|
|
tiles = { "signs_road_green_direction.png" },
|
|
|
|
inventory_image = "signs_road_green_dir_inventory.png",
|
|
|
|
signs_other_dir = "signs_road:green_left_sign",
|
|
|
|
on_place = signs.on_place_direction,
|
2016-12-24 21:45:27 +01:00
|
|
|
on_rightclick = signs.on_right_click_direction,
|
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "signs_dir_right.obj",
|
2017-08-26 14:12:38 +02:00
|
|
|
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 } },
|
2016-12-24 21:45:27 +01:00
|
|
|
},
|
|
|
|
},
|
2017-08-26 14:12:38 +02:00
|
|
|
green_left_sign = {
|
2016-12-24 21:45:27 +01:00
|
|
|
depth = 1/16,
|
|
|
|
width = 14/16,
|
|
|
|
height = 7/16,
|
|
|
|
entity_fields = {
|
2017-08-26 14:12:38 +02:00
|
|
|
right = 3/32,
|
2016-12-25 20:14:56 +01:00
|
|
|
size = { x = 12/16, y = 6/16 },
|
2016-12-24 21:45:27 +01:00
|
|
|
resolution = { x = 112, y = 64 },
|
|
|
|
maxlines = 2,
|
|
|
|
color="#fff",
|
|
|
|
},
|
|
|
|
node_fields = {
|
2017-08-26 14:12:38 +02:00
|
|
|
description = S("Green direction sign"),
|
|
|
|
tiles = { "signs_road_green_direction.png" },
|
|
|
|
inventory_image = "signs_road_green_dir_inventory.png",
|
|
|
|
signs_other_dir = "signs_road:green_right_sign",
|
|
|
|
on_place = signs.on_place_direction,
|
|
|
|
on_rightclick = signs.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:green_right_sign",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
yellow_right_sign = {
|
|
|
|
depth = 1/16,
|
|
|
|
width = 14/16,
|
|
|
|
height = 7/16,
|
|
|
|
entity_fields = {
|
|
|
|
right = -3/32,
|
|
|
|
size = { x = 12/16, y = 6/16 },
|
|
|
|
resolution = { x = 112, y = 64 },
|
|
|
|
maxlines = 2,
|
|
|
|
color = "#000",
|
|
|
|
},
|
|
|
|
node_fields = {
|
|
|
|
description = S("Yellow direction sign"),
|
|
|
|
tiles = { "signs_road_yellow_direction.png" },
|
|
|
|
inventory_image = "signs_road_yellow_dir_inventory.png",
|
|
|
|
signs_other_dir = "signs_road:yellow_left_sign",
|
|
|
|
on_place = signs.on_place_direction,
|
|
|
|
on_rightclick = signs.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 } },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
yellow_left_sign = {
|
|
|
|
depth = 1/16,
|
|
|
|
width = 14/16,
|
|
|
|
height = 7/16,
|
|
|
|
entity_fields = {
|
|
|
|
right = 3/32,
|
|
|
|
size = { x = 12/16, y = 6/16 },
|
|
|
|
resolution = { x = 112, y = 64 },
|
|
|
|
maxlines = 2,
|
|
|
|
color = "#000",
|
|
|
|
},
|
|
|
|
node_fields = {
|
|
|
|
description = S("Yellow direction sign"),
|
|
|
|
tiles = { "signs_road_yellow_direction.png" },
|
|
|
|
inventory_image = "signs_road_yellow_dir_inventory.png",
|
|
|
|
signs_other_dir = "signs_road:yellow_right_sign",
|
|
|
|
on_place = signs.on_place_direction,
|
|
|
|
on_rightclick = signs.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:yellow_left_sign",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
white_right_sign = {
|
|
|
|
depth = 1/16,
|
|
|
|
width = 14/16,
|
|
|
|
height = 7/16,
|
|
|
|
entity_fields = {
|
|
|
|
right = -3/32,
|
|
|
|
size = { x = 12/16, y = 6/16 },
|
|
|
|
resolution = { x = 112, y = 64 },
|
|
|
|
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.on_place_direction,
|
|
|
|
on_rightclick = signs.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 },
|
|
|
|
resolution = { x = 112, y = 64 },
|
|
|
|
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",
|
2016-12-24 21:45:27 +01:00
|
|
|
on_place=signs.on_place_direction,
|
|
|
|
on_rightclick = signs.on_right_click_direction,
|
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "signs_dir_left.obj",
|
2017-08-26 14:12:38 +02:00
|
|
|
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",
|
2016-12-24 21:45:27 +01:00
|
|
|
},
|
|
|
|
},
|
2015-11-28 20:44:41 +01:00
|
|
|
}
|
|
|
|
|
2017-08-26 14:12:38 +02:00
|
|
|
-- Node registration
|
2015-11-28 20:44:41 +01:00
|
|
|
for name, model in pairs(models)
|
|
|
|
do
|
|
|
|
signs.register_sign("signs_road", name, model)
|
|
|
|
end
|
2016-12-24 21:45:27 +01:00
|
|
|
|
2017-08-26 14:12:38 +02:00
|
|
|
|