Redo markings

This commit is contained in:
Carter Kolwey 2016-05-25 14:47:00 -05:00
parent 9038bccc92
commit d162cd2743
7 changed files with 396 additions and 487 deletions

30
api.lua
View File

@ -5,6 +5,21 @@
Category: Init
]]
local function copytable(orig)
local orig_type = type(orig)
local copy
if orig_type == 'table' then
copy = {}
for orig_key, orig_value in next, orig, nil do
copy[copytable(orig_key)] = copytable(orig_value)
end
setmetatable(copy, copytable(getmetatable(orig)))
else
copy = orig
end
return copy
end
function streets.load_submod(dirname)
-- Check whether submod's init file exists
local f = io.open(streets.conf.modpath .. "/" .. dirname .. "/init.lua")
@ -17,10 +32,17 @@ function streets.load_submod(dirname)
end
end
function streets.register_road_surface(nodename, nodedef)
streets.api.register_road_surfaces[nodename] = nodedef
function streets.register_road_surface(data)
streets.surfaces.surfacetypes["streets:"..data.name] = data
end
function streets.register_road_marking(markingdef)
streets.api.register_road_markings[markingdef.suffix] = markingdef
function streets.register_road_marking(data)
table.insert(streets.labels.labeltypes,data)
if data.flip_required then
local data2 = copytable(data)
data2.tex = data2.tex.."^[transformFX"
data2.name = data2.name.."_rotated"
data2.friendlyname = data2.friendlyname.." (rotated)"
table.insert(streets.labels.labeltypes,data2)
end
end

View File

@ -5,162 +5,114 @@
Category: Init
]]
minetest.after(0, function()
local surface_list = streets.api.register_road_surfaces
local marking_list = streets.api.register_road_markings
-- Loop thorugh the list of surfaces
for surface_name, surface_definition in pairs(surface_list) do
-- Register the surface itself (e.g. plain asphalt)
minetest.register_node(surface_name, surface_definition)
stairs.register_slab(surface_name:sub(2, -1):split(":")[2], surface_name:sub(2, -1), surface_definition.groups, surface_definition.tiles, surface_definition.description .. " Slab", surface_definition.sounds)
stairs.register_stair(surface_name:sub(2, -1):split(":")[2], surface_name:sub(2, -1), surface_definition.groups, surface_definition.tiles, surface_definition.description .. " Stair", surface_definition.sounds)
-- Register for surface alias if given
if type(surface_definition.aka) == "table" then
for _, old_name in ipairs(surface_definition.aka) do
minetest.register_alias(old_name, surface_name)
end
end
-- Register the craft for this surface
if type(surface_definition.craft) == "table" then
minetest.register_craft(surface_definition.craft)
else
minetest.log("warning", surface_name .. "registered, but no craft recipe specified.")
end
-- Loop through the list of markings
for marking_suffix, marking_data in pairs(marking_list) do
-- Collect required data for node defintion
local nn = surface_name .. "_" .. marking_suffix
local description = surface_definition.description .. " " .. marking_data.friendly_suffix
local tiles
local tiles2
if marking_data.continous == true then
tiles = {surface_definition.tiles[1] .. "^" .. marking_data.overlay, surface_definition.tiles[1], surface_definition.tiles[1], surface_definition.tiles[1], surface_definition.tiles[1] .. "^" .. marking_data.overlay .. "^[transformFX", surface_definition.tiles[1] .. "^" .. marking_data.overlay}
tiles2 = {surface_definition.tiles[1] .. "^" .. marking_data.overlay:split(".")[1] .. "_yellow.png", surface_definition.tiles[1], surface_definition.tiles[1], surface_definition.tiles[1], surface_definition.tiles[1] .. "^" .. marking_data.overlay:split(".")[1] .. "_yellow.png^[transformFX", surface_definition.tiles[1] .. "^" .. marking_data.overlay:split(".")[1] .. "_yellow.png"}
else
tiles = {surface_definition.tiles[1] .. "^" .. marking_data.overlay, surface_definition.tiles[1]}
tiles2 = {surface_definition.tiles[1] .. "^" .. marking_data.overlay:split(".")[1] .. "_yellow.png", surface_definition.tiles[1]}
end
local groups = surface_definition.groups
local sounds = surface_definition.sounds
-- Replace placeholders in craft recipe
local craft = table.copy(marking_data.craft)
local replacement = surface_name:sub(2, -1)
for i = 1, 3 do
for j = 1, 3 do
if craft[i][j] == "?" then craft[i][j] = replacement end
end
end
-- Register the combination of surface and marking
minetest.register_node(nn, {
description = description,
tiles = tiles,
groups = groups,
sounds = sounds,
paramtype = "light",
paramtype2 = "facedir"
})
-- Register stair or slab if allowed in definition
if marking_data.register_stair == true then
stairs.register_stair(nn:sub(2, -1):split(":")[2], nn:sub(2, -1), groups, {tiles[1], tiles[2], tiles[2], tiles[2], tiles[2], tiles[1]}, description, sounds)
if marking_data.flip_required == true then
stairs.register_stair(nn:sub(2, -1):split(":")[2] .. "_transformFY", nn:sub(2, -1), groups, {tiles[1] .. "^[transformR180", tiles[2], tiles[2], tiles[2], tiles[2], tiles[1] .. "^[transformR180"}, description, sounds)
end
end
if marking_data.register_slab == true and marking_data.continous == true then
stairs.register_slab(nn:sub(2, -1):split(":")[2], nn:sub(2, -1), groups, {tiles[1], tiles[2], tiles[2], tiles[2], tiles[1] .. "^[transformFX", tiles[1]}, description, sounds)
end
if marking_data.register_slab == true and marking_data.continous == false then
stairs.register_slab(nn:sub(2, -1):split(":")[2], nn:sub(2, -1), groups, {tiles[1], tiles[2]}, description, sounds)
end
-- Register the craft for this node
local craft_output = nn:sub(2, -1)
minetest.register_craft({
output = craft_output,
recipe = craft
})
-- Register alias for the marking if given
if type(marking_data.aka) == "table" then
for _, old_name in ipairs(marking_data.aka) do
minetest.register_alias(old_name, craft_output)
end
end
-- Register the yellow version, too
nn = nn .. "_yellow"
minetest.register_node(nn, {
description = description,
tiles = tiles2,
groups = groups,
sounds = sounds,
paramtype = "light",
paramtype2 = "facedir"
})
-- Get a fresh copy of the craft template
craft = table.copy(marking_data.craft)
replacement = surface_name:sub(2, -1)
-- Replace placeholders and replace white dye by yellow dye
for i = 1, 3 do
for j = 1, 3 do
if craft[i][j] == "?" then craft[i][j] = replacement end
if craft[i][j] == "dye:white" then craft[i][j] = "dye:yellow" end
end
end
-- Register the craft
craft_output = nn:sub(2, -1)
minetest.register_craft({
output = craft_output,
recipe = craft
})
-- Register the aliass
if type(marking_data.aka) == "table" then
for _, old_name in ipairs(marking_data.aka) do
minetest.register_alias(old_name, craft_output)
end
end
end
end
-- Register roadwork markings
for marking_suffix, marking_data in pairs(marking_list) do
if marking_data.register_rw == true then
minetest.register_node(":streets:rw_" .. marking_data.suffix .. "_yellow",{
description = "Roadworks: " .. marking_data.friendly_suffix:gsub("^%l", string.upper),
tiles = {marking_data.overlay:split(".")[1] .. "_yellow.png", "streets_transparent.png"},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy = 3,attached_node = 1,oddly_breakable_by_hand = 1},
sunlight_propagates = true,
walkable = false,
inventory_image = marking_data.overlay:split(".")[1] .. "_yellow.png",
wield_image = marking_data.overlay:split(".")[1] .. "_yellow.png",
node_box = {
type = "fixed",
fixed = {{-0.5, -0.5, -0.5, 0.5, -0.499, 0.5}}
},
selection_box = {
type = "fixed",
fixed = {{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}}
}
})
minetest.register_node(":streets:rw_" .. marking_data.suffix .. "_white",{
description = "Roadworks: " .. marking_data.friendly_suffix:gsub("^%l", string.upper),
tiles = {marking_data.overlay, "streets_transparent.png"},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy = 3,attached_node = 1,oddly_breakable_by_hand = 1},
sunlight_propagates = true,
walkable = false,
inventory_image = marking_data.overlay,
wield_image = marking_data.overlay,
node_box = {
type = "fixed",
fixed = {{-0.5, -0.5, -0.5, 0.5, -0.499, 0.5}}
},
selection_box = {
type = "fixed",
fixed = {{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}}
}
})
end
end
end)
local function copytable(orig)
local orig_type = type(orig)
local copy
if orig_type == 'table' then
copy = {}
for orig_key, orig_value in next, orig, nil do
copy[copytable(orig_key)] = copytable(orig_value)
end
setmetatable(copy, copytable(getmetatable(orig)))
else
copy = orig
end
return copy
end
local register_surface_nodes = function(friendlyname,name,tiles,groups,sounds,craft)
minetest.register_node(":streets:"..name,{
description = friendlyname,
tiles = tiles,
groups = groups,
sounds = sounds
})
minetest.register_craft(craft)
if minetest.get_modpath("moreblocks") then
stairsplus:register_all("streets",name,"streets:"..name,{
description = friendlyname,
tiles = tiles,
groups = groups,
sounds = sounds
})
end
end
local register_marking_nodes = function(surface_friendlyname,surface_name,surface_tiles,surface_groups,surface_sounds,friendlyname,name,tex)
minetest.register_node(":streets:mark_"..name,{
description = "Marking Overlay: "..friendlyname,
tiles = {tex,"streets_transparent.png"},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy = 3,attached_node = 1,oddly_breakable_by_hand = 1},
sunlight_propagates = true,
walkable = false,
inventory_image = tex,
wield_image = tex,
after_place_node = function(pos)
local node = minetest.get_node(pos)
local lower_pos = {x = pos.x, y = pos.y-1, z = pos.z}
local lower_node = minetest.get_node(lower_pos)
local lower_node_is_asphalt = minetest.registered_nodes[lower_node.name].groups.asphalt
if lower_node_is_asphalt then
local lower_node_basename = streets.surfaces.surfacetypes[lower_node.name].name
lower_node.name = "streets:mark_"..(node.name:sub(14)).."_on_"..lower_node_basename
lower_node.param2 = node.param2
minetest.set_node(lower_pos,lower_node)
minetest.remove_node(pos)
end
end,
node_box = {
type = "fixed",
fixed = {-0.5,-0.5,-0.5,0.5,-0.499,0.5}
},
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2}
}
})
local tiles = {}
tiles[1] = surface_tiles[1]
tiles[2] = surface_tiles[2] or surface_tiles[1] --If less than 6 textures are used, this'll "expand" them to 6
tiles[3] = surface_tiles[3] or surface_tiles[1]
tiles[4] = surface_tiles[4] or surface_tiles[1]
tiles[5] = surface_tiles[5] or surface_tiles[1]
tiles[6] = surface_tiles[6] or surface_tiles[1]
tiles[1] = tiles[1].."^"..tex
tiles[5] = tiles[5].."^"..tex.."^[transformR180"
tiles[6] = tiles[6].."^"..tex
local groups = copytable(surface_groups)
groups.not_in_creative_inventory = 1
minetest.register_node(":streets:mark_"..name.."_on_"..surface_name,{
description = surface_friendlyname.." With Marking: "..friendlyname,
groups = groups,
sounds = surface_sounds,
tiles = tiles,
paramtype2 = "facedir"
})
minetest.register_craft({
output = "streets:mark_"..name.."_on_"..surface_name,
type = "shapeless",
recipe = {"streets:"..surface_name,"streets:mark_"..name}
})
if minetest.get_modpath("moreblocks") or minetest.get_modpath("stairsplus") then
stairsplus:register_all("streets", name.."_on_"..surface_name, "streets:mark_"..name.."_on_"..surface_name, {
description = surface_friendlyname.." with Marking: "..friendlyname,
tiles = tiles,
groups = surface_groups,
sounds = surface_sounds
})
end
end
if streets.surfaces.surfacetypes then
for _,v in pairs(streets.surfaces.surfacetypes) do
register_surface_nodes(v.friendlyname,v.name,v.tiles,v.groups,v.sounds,v.craft)
if streets.labels.labeltypes then
for _,w in pairs(streets.labels.labeltypes) do
register_marking_nodes(v.friendlyname,v.name,v.tiles,v.groups,v.sounds,w.friendlyname,w.name,w.tex)
end
end
end
end

View File

@ -1,3 +1,5 @@
default
stairs
walls
stairsplus?
moreblocks?

View File

@ -18,10 +18,8 @@ streets.conf = {
}
-- The API collects some data here
streets.api = {
register_road_surfaces = {},
register_road_markings = {}
}
streets.surfaces = {surfacetypes = {}}
streets.labels = {labeltypes = {}}
-- Load the API file
dofile(streets.conf.modpath .. "/api.lua")

View File

@ -4,7 +4,7 @@
Optional: true
]]
for surface_name, surface_data in pairs(streets.api.register_road_surfaces) do
for surface_name, surface_data in pairs(streets.surfaces.surfacetypes) do
minetest.register_node(":streets:" .. surface_name:sub(2, -1):split(":")[2] .. "_manhole", {
description = "Manhole",
tiles = {surface_data["tiles"][1] .. "^streets_manhole.png", surface_data.tiles[1]},

View File

@ -6,375 +6,309 @@
]]
streets.register_road_marking({
suffix = "line_dashed",
friendly_suffix = "dashed line",
overlay = "streets_line_dashed.png",
aka = {},
register_stair = true,
register_slab = true,
name = "dashed_white_center_line",
friendlyname = "Dashed White Center Line",
tex = "streets_line_dashed.png",
flip_required = false,
continous = true,
register_rw = false,
craft = {
{"?", "dye:white", "?"},
{"?", "?", "?"},
{"?", "dye:white", "?"}
}
})
streets.register_road_marking({
suffix = "line_solid",
friendly_suffix = "solid line",
overlay = "streets_line_solid.png",
aka = {},
register_stair = true,
register_slab = true,
name = "solid_white_center_line",
friendlyname = "Solid White Center Line",
tex = "streets_line_solid.png",
flip_required = false,
continous = true,
register_rw = false,
craft = {
{"?", "dye:white", "?"},
{"?", "dye:white", "?"},
{"?", "dye:white", "?"}
}
})
streets.register_road_marking({
suffix = "side_slim",
friendly_suffix = "slim line",
overlay = "streets_line_side_slim.png",
aka = {},
register_stair = true,
register_slab = true,
name = "solid_white_side_line",
friendlyname = "Solid White Side Line",
tex = "streets_line_side_slim.png",
flip_required = true,
continous = true,
register_rw = true,
craft = {
{"dye:white", "?", "?"},
{"dye:white", "?", "?"},
{"dye:white", "?", "?"}
}
})
streets.register_road_marking({
suffix = "side_thick",
friendly_suffix = "thick line",
overlay = "streets_line_side_thick.png",
aka = {},
register_stair = true,
register_slab = true,
name = "solid_white_side_line_wide",
friendlyname = "Solid White Side Line (Wide)",
tex = "streets_line_side_thick.png",
flip_required = true,
continous = true,
register_rw = true,
craft = {
{"dye:white", "dye:white", "?"},
{"dye:white", "dye:white", "?"},
{"dye:white", "dye:white", "?"}
}
})
streets.register_road_marking({
suffix = "side_dashed_slim",
friendly_suffix = "slim dashed line",
overlay = "streets_line_side_dashed_slim.png",
aka = {},
register_stair = true,
register_slab = true,
name = "dashed_white_side_line",
friendlyname = "Dashed White Side Line",
tex = "streets_line_side_dashed_slim.png",
flip_required = true,
continous = true,
register_rw = true,
craft = {
{"dye:white", "?", "?"},
{"?", "?", "?"},
{"dye:white", "?", "?"}
}
})
streets.register_road_marking({
suffix = "side_dashed_thick",
friendly_suffix = "thick dashed line",
overlay = "streets_line_side_dashed_thick.png",
aka = {},
register_stair = true,
register_slab = true,
name = "dashed_white_side_line_wide",
friendlyname = "Dashed White Side Line (Wide)",
tex = "streets_line_side_dashed_thick.png",
flip_required = true,
continous = true,
register_rw = true,
craft = {
{"dye:white", "dye:white", "?"},
{"?", "?", "?"},
{"dye:white", "dye:white", "?"}
}
})
streets.register_road_marking({
suffix = "edge_slim",
friendly_suffix = "slim edge line",
overlay = "streets_line_edge_slim.png",
aka = {},
register_stair = false,
register_slab = true,
flip_required = false,
continous = true,
register_rw = true,
craft = {
{"dye:white", "dye:white", "dye:white"},
{"dye:white", "?", "?"},
{"dye:white", "?", "?"}
}
})
streets.register_road_marking({
suffix = "edge_thick",
friendly_suffix = "thick edge line",
overlay = "streets_line_edge_thick.png",
aka = {},
register_stair = false,
register_slab = true,
flip_required = false,
continous = true,
register_rw = true,
craft = {
{"dye:white", "dye:white", "dye:white"},
{"dye:white", "dye:white", "dye:white"},
{"dye:white", "dye:white", "?"}
}
})
streets.register_road_marking({
suffix = "line_solid_double",
friendly_suffix = "double solid line",
overlay = "streets_line_solid_double.png",
aka = {},
register_stair = true,
register_slab = true,
flip_required = false,
continous = true,
register_rw = true,
craft = {
{"dye:white", "?", "dye:white"},
{"dye:white", "?", "dye:white"},
{"dye:white", "?", "dye:white"}
}
})
streets.register_road_marking({
suffix = "line_dashed_double",
friendly_suffix = "double dashed line",
overlay = "streets_line_dashed_double.png",
aka = {},
register_stair = true,
register_slab = true,
flip_required = false,
continous = true,
register_rw = true,
craft = {
{"dye:white", "?", "dye:white"},
{"?", "?", "?"},
{"dye:white", "?", "dye:white"}
}
})
streets.register_road_marking({
suffix = "line_mixed_double",
friendly_suffix = "double mixed line",
overlay = "streets_line_mixed_double.png",
aka = {},
register_stair = true,
register_slab = true,
name = "solid_white_side_line_corner",
friendlyname = "Solid White Side Line Corner",
tex = "streets_line_edge_slim.png",
flip_required = true,
continous = true,
register_rw = true,
craft = {
{"dye:white", "?", "dye:white"},
{"dye:white", "?", "?"},
{"dye:white", "?", "dye:white"}
}
})
streets.register_road_marking({
suffix = "crosswalk",
friendly_suffix = "crosswalk",
overlay = "streets_crosswalk.png",
aka = {},
register_stair = false,
register_slab = false,
flip_required = false,
continous = false,
register_rw = true,
craft = {
{"?", "?", "?"},
{"dye:white", "dye:white", "dye:white"},
{"?", "?", "?"}
}
name = "solid_white_side_line_wide_corner",
friendlyname = "Solid White Side Line (Wide) Corner",
tex = "streets_line_edge_thick.png",
flip_required = true,
})
streets.register_road_marking({
suffix = "arrow_straight",
friendly_suffix = "arrow straight on",
overlay = "streets_arrow_straight.png",
aka = {},
register_stair = false,
register_slab = true,
name = "double_solid_white_center_line",
friendlyname = "Double Solid White Center Line",
tex = "streets_line_solid_double.png",
flip_required = false,
continous = false,
register_rw = true,
craft = {
{"?", "?", "?"},
{"?", "dye:white", "?"},
{"?", "dye:white", "?"}
}
})
streets.register_road_marking({
suffix = "arrow_left",
friendly_suffix = "arrow left",
overlay = "streets_arrow_left.png",
aka = {},
register_stair = false,
register_slab = true,
name = "double_dashed_white_center_line",
friendlyname = "Double Dashed White Center Line",
tex = "streets_line_dashed_double.png",
flip_required = false,
continous = false,
register_rw = true,
craft = {
{"?", "?", "?"},
{"dye:white", "dye:white", "?"},
{"?", "dye:white", "?"}
}
})
streets.register_road_marking({
suffix = "arrow_right",
friendly_suffix = "arrow right",
overlay = "streets_arrow_right.png",
aka = {},
register_stair = false,
register_slab = true,
flip_required = false,
continous = false,
register_rw = true,
craft = {
{"?", "?", "?"},
{"?", "dye:white", "dye:white"},
{"?", "dye:white", "?"}
}
name = "mixed_white_center_line",
friendlyname = "Solid/Dashed White Center Line",
tex = "streets_line_mixed_double.png",
flip_required = true,
})
streets.register_road_marking({
suffix = "arrow_straightleft",
friendly_suffix = "arrow straigth on + left",
overlay = "streets_arrow_straightleft.png",
aka = {},
register_stair = false,
register_slab = true,
name = "solid_white_stripe",
friendlyname = "Solid White Stripe",
tex = "streets_crosswalk.png",
flip_required = false,
continous = false,
register_rw = true,
craft = {
{"?", "dye.white", "?"},
{"dye:white", "dye:white", "?"},
{"?", "dye:white", "?"}
}
})
streets.register_road_marking({
suffix = "arrow_straightright",
friendly_suffix = "arrow straigth on + right",
overlay = "streets_arrow_straightright.png",
aka = {},
register_stair = false,
register_slab = true,
name = "white_arrow_straight",
friendlyname = "White Arrow (straight)",
tex = "streets_arrow_straight.png",
flip_required = false,
continous = false,
register_rw = true,
craft = {
{"?", "dye.white", "?"},
{"?", "dye:white", "dye:white"},
{"?", "dye:white", "?"}
}
})
streets.register_road_marking({
suffix = "arrow_straightleftright",
friendly_suffix = "arrow straigth on + left + right",
overlay = "streets_arrow_straightleftright.png",
aka = {},
register_stair = false,
register_slab = true,
name = "white_arrow_left",
friendlyname = "White Arrow (left)",
tex = "streets_arrow_left.png",
flip_required = false,
continous = false,
register_rw = true,
craft = {
{"?", "dye.white", "?"},
{"dye:white", "dye:white", "dye:white"},
{"?", "dye:white", "?"}
}
})
streets.register_road_marking({
suffix = "arrow_leftright",
friendly_suffix = "arrow left + right",
overlay = "streets_arrow_leftright.png",
aka = {},
register_stair = false,
register_slab = true,
name = "white_arrow_right",
friendlyname = "White Arrow (right)",
tex = "streets_arrow_right.png",
flip_required = false,
continous = false,
register_rw = true,
craft = {
{"?", "?", "?"},
{"dye:white", "dye:white", "dye:white"},
{"?", "dye:white", "?"}
}
})
streets.register_road_marking({
suffix = "parking",
friendly_suffix = "parking",
overlay = "streets_parking.png",
aka = {},
register_stair = false,
register_slab = true,
name = "white_arrow_left_straight",
friendlyname = "White Arrow (left+straight)",
tex = "streets_arrow_straightleft.png",
flip_required = false,
continous = false,
register_rw = true,
craft = {
{"dye:white", "dye:white", "?"},
{"dye:white", "dye:white", "?"},
{"dye:white", "?", "?"}
}
})
streets.register_road_marking({
suffix = "zigzag",
friendly_suffix = "zigzag",
overlay = "streets_zigzag.png",
aka = {},
register_stair = false,
register_slab = false,
name = "white_arrow_straight_right",
friendlyname = "White Arrow (straight+right)",
tex = "streets_arrow_straightright.png",
flip_required = false,
continous = true,
register_rw = true,
craft = {
{"dye:white", "?", "?"},
{"?", "dye:white", "?"},
{"?", "?", "dye:white"}
}
})
streets.register_road_marking({
suffix = "forbidden",
friendly_suffix = "forbidden area",
overlay = "streets_forbidden.png",
aka = {},
register_stair = false,
register_slab = false,
name = "white_arrow_left_straight_right",
friendlyname = "White Arrow (left+straight+right)",
tex = "streets_arrow_straightleftright.png",
flip_required = false,
continous = true,
register_rw = true,
craft = {
{"dye:white", "?", "dye:white"},
{"?", "dye:white", "?"},
{"dye:white", "?", "dye:white"}
}
})
streets.register_road_marking({
name = "white_arrow_left_right",
friendlyname = "White Arrow (left+right)",
tex = "streets_arrow_leftright.png",
flip_required = false,
})
streets.register_road_marking({
name = "white_parking",
friendlyname = "White Parking",
tex = "streets_parking.png",
flip_required = false,
})
streets.register_road_marking({
name = "solid_white_diagonal_line",
friendlyname = "Solid White Diagonal Line",
tex = "streets_zigzag.png",
flip_required = true,
})
streets.register_road_marking({
name = "solid_white_diagonal_line",
friendlyname = "Double Solid White Diagonal Line",
tex = "streets_forbidden.png",
flip_required = true,
})
streets.register_road_marking({
name = "dashed_yellow_center_line",
friendlyname = "Dashed Yellow Center Line",
tex = "streets_line_dashed_yellow.png",
flip_required = false,
})
streets.register_road_marking({
name = "solid_yellow_center_line",
friendlyname = "Solid Yellow Center Line",
tex = "streets_line_solid_yellow.png",
flip_required = false,
})
streets.register_road_marking({
name = "solid_yellow_side_line",
friendlyname = "Solid Yellow Side Line",
tex = "streets_line_side_slim_yellow.png",
flip_required = true,
})
streets.register_road_marking({
name = "solid_yellow_side_line_wide",
friendlyname = "Solid Yellow Side Line (Wide)",
tex = "streets_line_side_thick_yellow.png",
flip_required = true,
})
streets.register_road_marking({
name = "dashed_yellow_side_line",
friendlyname = "Dashed Yellow Side Line",
tex = "streets_line_side_dashed_slim_yellow.png",
flip_required = true,
})
streets.register_road_marking({
name = "dashed_yellow_side_line_wide",
friendlyname = "Dashed Yellow Side Line (Wide)",
tex = "streets_line_side_dashed_thick_yellow.png",
flip_required = true,
})
streets.register_road_marking({
name = "solid_yellow_side_line_corner",
friendlyname = "Solid Yellow Side Line Corner",
tex = "streets_line_edge_slim_yellow.png",
flip_required = true,
})
streets.register_road_marking({
name = "solid_yellow_side_line_wide_corner",
friendlyname = "Solid Yellow Side Line (Wide) Corner",
tex = "streets_line_edge_thick_yellow.png",
flip_required = true,
})
streets.register_road_marking({
name = "double_solid_yellow_center_line",
friendlyname = "Double Solid Yellow Center Line",
tex = "streets_line_solid_double_yellow.png",
flip_required = false,
})
streets.register_road_marking({
name = "double_dashed_yellow_center_line",
friendlyname = "Double Dashed Yellow Center Line",
tex = "streets_line_dashed_double_yellow.png",
flip_required = false,
})
streets.register_road_marking({
name = "mixed_yellow_center_line",
friendlyname = "Solid/Dashed Yellow Center Line",
tex = "streets_line_mixed_double_yellow.png",
flip_required = true,
})
streets.register_road_marking({
name = "solid_yellow_stripe",
friendlyname = "Solid Yellow Stripe",
tex = "streets_crosswalk_yellow.png",
flip_required = false,
})
streets.register_road_marking({
name = "yellow_arrow_straight",
friendlyname = "Yellow Arrow (straight)",
tex = "streets_arrow_straight_yellow.png",
flip_required = false,
})
streets.register_road_marking({
name = "yellow_arrow_left",
friendlyname = "Yellow Arrow (left)",
tex = "streets_arrow_left_yellow.png",
flip_required = false,
})
streets.register_road_marking({
name = "yellow_arrow_right",
friendlyname = "Yellow Arrow (right)",
tex = "streets_arrow_right_yellow.png",
flip_required = false,
})
streets.register_road_marking({
name = "yellow_arrow_left_straight",
friendlyname = "Yellow Arrow (left+straight)",
tex = "streets_arrow_straightleft_yellow.png",
flip_required = false,
})
streets.register_road_marking({
name = "yellow_arrow_straight_right",
friendlyname = "Yellow Arrow (straight+right)",
tex = "streets_arrow_straightright_yellow.png",
flip_required = false,
})
streets.register_road_marking({
name = "yellow_arrow_left_straight_right",
friendlyname = "Yellow Arrow (left+straight+right)",
tex = "streets_arrow_straightleftright_yellow.png",
flip_required = false,
})
streets.register_road_marking({
name = "yellow_arrow_left_right",
friendlyname = "Yellow Arrow (left+right)",
tex = "streets_arrow_leftright_yellow.png",
flip_required = false,
})
streets.register_road_marking({
name = "yellow_parking",
friendlyname = "Yellow Parking",
tex = "streets_parking_yellow.png",
flip_required = false,
})
streets.register_road_marking({
name = "solid_yellow_diagonal_line",
friendlyname = "Solid Yellow Diagonal Line",
tex = "streets_zigzag_yellow.png",
flip_required = true,
})
streets.register_road_marking({
name = "solid_yellow_diagonal_line",
friendlyname = "Double Solid Yellow Diagonal Line",
tex = "streets_forbidden_yellow.png",
flip_required = true,
})

View File

@ -5,12 +5,12 @@
Category: Roads
]]
streets.register_road_surface(":streets:asphalt", {
description = "Asphalt",
streets.register_road_surface({
name="asphalt",
friendlyname = "Asphalt",
tiles = {"streets_asphalt.png"},
groups = {cracky = 3},
groups = {cracky = 3,asphalt = 1},
sounds = default.node_sound_stone_defaults(),
aka = {},
craft = {
output = "streets:asphalt 1",
type = "cooking",
@ -19,12 +19,12 @@ streets.register_road_surface(":streets:asphalt", {
}
})
streets.register_road_surface(":streets:asphalt_red", {
description = "Colored Asphalt",
streets.register_road_surface({
name = "asphalt_red",
friendlyname = "Red Asphalt",
tiles = {"streets_asphalt_red.png"},
groups = {cracky = 3},
groups = {cracky = 3,asphalt = 1},
sounds = default.node_sound_stone_defaults(),
aka = {},
craft = {
output = "streets:asphalt_red 1",
type = "shapeless",
@ -32,12 +32,12 @@ streets.register_road_surface(":streets:asphalt_red", {
}
})
streets.register_road_surface(":streets:asphalt_yellow", {
description = "Colored Asphalt",
streets.register_road_surface({
name = "asphalt_yellow",
friendlyname = "Yellow Asphalt",
tiles = {"streets_asphalt_yellow.png"},
groups = {cracky = 3},
groups = {cracky = 3,asphalt = 1},
sounds = default.node_sound_stone_defaults(),
aka = {},
craft = {
output = "streets:asphalt_yellow 1",
type = "shapeless",
@ -45,10 +45,11 @@ streets.register_road_surface(":streets:asphalt_yellow", {
}
})
streets.register_road_surface(":streets:asphalt_blue", {
description = "Colored Asphalt",
streets.register_road_surface({
name = "asphalt_blue",
friendlyname = "Blue Asphalt",
tiles = {"streets_asphalt_blue.png"},
groups = {cracky = 3},
groups = {cracky = 3,asphalt = 1},
sounds = default.node_sound_stone_defaults(),
craft = {
output = "streets:asphalt_blue 1",