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 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) function streets.load_submod(dirname)
-- Check whether submod's init file exists -- Check whether submod's init file exists
local f = io.open(streets.conf.modpath .. "/" .. dirname .. "/init.lua") local f = io.open(streets.conf.modpath .. "/" .. dirname .. "/init.lua")
@ -17,10 +32,17 @@ function streets.load_submod(dirname)
end end
end end
function streets.register_road_surface(nodename, nodedef) function streets.register_road_surface(data)
streets.api.register_road_surfaces[nodename] = nodedef streets.surfaces.surfacetypes["streets:"..data.name] = data
end end
function streets.register_road_marking(markingdef) function streets.register_road_marking(data)
streets.api.register_road_markings[markingdef.suffix] = markingdef 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 end

View File

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

View File

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

View File

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

View File

@ -4,7 +4,7 @@
Optional: true 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", { minetest.register_node(":streets:" .. surface_name:sub(2, -1):split(":")[2] .. "_manhole", {
description = "Manhole", description = "Manhole",
tiles = {surface_data["tiles"][1] .. "^streets_manhole.png", surface_data.tiles[1]}, tiles = {surface_data["tiles"][1] .. "^streets_manhole.png", surface_data.tiles[1]},

View File

@ -6,375 +6,309 @@
]] ]]
streets.register_road_marking({ streets.register_road_marking({
suffix = "line_dashed", name = "dashed_white_center_line",
friendly_suffix = "dashed line", friendlyname = "Dashed White Center Line",
overlay = "streets_line_dashed.png", tex = "streets_line_dashed.png",
aka = {},
register_stair = true,
register_slab = true,
flip_required = false, flip_required = false,
continous = true,
register_rw = false,
craft = {
{"?", "dye:white", "?"},
{"?", "?", "?"},
{"?", "dye:white", "?"}
}
}) })
streets.register_road_marking({ streets.register_road_marking({
suffix = "line_solid", name = "solid_white_center_line",
friendly_suffix = "solid line", friendlyname = "Solid White Center Line",
overlay = "streets_line_solid.png", tex = "streets_line_solid.png",
aka = {},
register_stair = true,
register_slab = true,
flip_required = false, flip_required = false,
continous = true,
register_rw = false,
craft = {
{"?", "dye:white", "?"},
{"?", "dye:white", "?"},
{"?", "dye:white", "?"}
}
}) })
streets.register_road_marking({ streets.register_road_marking({
suffix = "side_slim", name = "solid_white_side_line",
friendly_suffix = "slim line", friendlyname = "Solid White Side Line",
overlay = "streets_line_side_slim.png", tex = "streets_line_side_slim.png",
aka = {},
register_stair = true,
register_slab = true,
flip_required = true, flip_required = true,
continous = true,
register_rw = true,
craft = {
{"dye:white", "?", "?"},
{"dye:white", "?", "?"},
{"dye:white", "?", "?"}
}
}) })
streets.register_road_marking({ streets.register_road_marking({
suffix = "side_thick", name = "solid_white_side_line_wide",
friendly_suffix = "thick line", friendlyname = "Solid White Side Line (Wide)",
overlay = "streets_line_side_thick.png", tex = "streets_line_side_thick.png",
aka = {},
register_stair = true,
register_slab = true,
flip_required = true, 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({ streets.register_road_marking({
suffix = "side_dashed_slim", name = "dashed_white_side_line",
friendly_suffix = "slim dashed line", friendlyname = "Dashed White Side Line",
overlay = "streets_line_side_dashed_slim.png", tex = "streets_line_side_dashed_slim.png",
aka = {},
register_stair = true,
register_slab = true,
flip_required = true, flip_required = true,
continous = true,
register_rw = true,
craft = {
{"dye:white", "?", "?"},
{"?", "?", "?"},
{"dye:white", "?", "?"}
}
}) })
streets.register_road_marking({ streets.register_road_marking({
suffix = "side_dashed_thick", name = "dashed_white_side_line_wide",
friendly_suffix = "thick dashed line", friendlyname = "Dashed White Side Line (Wide)",
overlay = "streets_line_side_dashed_thick.png", tex = "streets_line_side_dashed_thick.png",
aka = {},
register_stair = true,
register_slab = true,
flip_required = true, flip_required = true,
continous = true,
register_rw = true,
craft = {
{"dye:white", "dye:white", "?"},
{"?", "?", "?"},
{"dye:white", "dye:white", "?"}
}
}) })
streets.register_road_marking({ streets.register_road_marking({
suffix = "edge_slim", name = "solid_white_side_line_corner",
friendly_suffix = "slim edge line", friendlyname = "Solid White Side Line Corner",
overlay = "streets_line_edge_slim.png", tex = "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,
flip_required = true, flip_required = true,
continous = true,
register_rw = true,
craft = {
{"dye:white", "?", "dye:white"},
{"dye:white", "?", "?"},
{"dye:white", "?", "dye:white"}
}
}) })
streets.register_road_marking({ streets.register_road_marking({
suffix = "crosswalk", name = "solid_white_side_line_wide_corner",
friendly_suffix = "crosswalk", friendlyname = "Solid White Side Line (Wide) Corner",
overlay = "streets_crosswalk.png", tex = "streets_line_edge_thick.png",
aka = {}, flip_required = true,
register_stair = false,
register_slab = false,
flip_required = false,
continous = false,
register_rw = true,
craft = {
{"?", "?", "?"},
{"dye:white", "dye:white", "dye:white"},
{"?", "?", "?"}
}
}) })
streets.register_road_marking({ streets.register_road_marking({
suffix = "arrow_straight", name = "double_solid_white_center_line",
friendly_suffix = "arrow straight on", friendlyname = "Double Solid White Center Line",
overlay = "streets_arrow_straight.png", tex = "streets_line_solid_double.png",
aka = {},
register_stair = false,
register_slab = true,
flip_required = false, flip_required = false,
continous = false,
register_rw = true,
craft = {
{"?", "?", "?"},
{"?", "dye:white", "?"},
{"?", "dye:white", "?"}
}
}) })
streets.register_road_marking({ streets.register_road_marking({
suffix = "arrow_left", name = "double_dashed_white_center_line",
friendly_suffix = "arrow left", friendlyname = "Double Dashed White Center Line",
overlay = "streets_arrow_left.png", tex = "streets_line_dashed_double.png",
aka = {},
register_stair = false,
register_slab = true,
flip_required = false, flip_required = false,
continous = false,
register_rw = true,
craft = {
{"?", "?", "?"},
{"dye:white", "dye:white", "?"},
{"?", "dye:white", "?"}
}
}) })
streets.register_road_marking({ streets.register_road_marking({
suffix = "arrow_right", name = "mixed_white_center_line",
friendly_suffix = "arrow right", friendlyname = "Solid/Dashed White Center Line",
overlay = "streets_arrow_right.png", tex = "streets_line_mixed_double.png",
aka = {}, flip_required = true,
register_stair = false,
register_slab = true,
flip_required = false,
continous = false,
register_rw = true,
craft = {
{"?", "?", "?"},
{"?", "dye:white", "dye:white"},
{"?", "dye:white", "?"}
}
}) })
streets.register_road_marking({ streets.register_road_marking({
suffix = "arrow_straightleft", name = "solid_white_stripe",
friendly_suffix = "arrow straigth on + left", friendlyname = "Solid White Stripe",
overlay = "streets_arrow_straightleft.png", tex = "streets_crosswalk.png",
aka = {},
register_stair = false,
register_slab = true,
flip_required = false, flip_required = false,
continous = false,
register_rw = true,
craft = {
{"?", "dye.white", "?"},
{"dye:white", "dye:white", "?"},
{"?", "dye:white", "?"}
}
}) })
streets.register_road_marking({ streets.register_road_marking({
suffix = "arrow_straightright", name = "white_arrow_straight",
friendly_suffix = "arrow straigth on + right", friendlyname = "White Arrow (straight)",
overlay = "streets_arrow_straightright.png", tex = "streets_arrow_straight.png",
aka = {},
register_stair = false,
register_slab = true,
flip_required = false, flip_required = false,
continous = false,
register_rw = true,
craft = {
{"?", "dye.white", "?"},
{"?", "dye:white", "dye:white"},
{"?", "dye:white", "?"}
}
}) })
streets.register_road_marking({ streets.register_road_marking({
suffix = "arrow_straightleftright", name = "white_arrow_left",
friendly_suffix = "arrow straigth on + left + right", friendlyname = "White Arrow (left)",
overlay = "streets_arrow_straightleftright.png", tex = "streets_arrow_left.png",
aka = {},
register_stair = false,
register_slab = true,
flip_required = false, flip_required = false,
continous = false,
register_rw = true,
craft = {
{"?", "dye.white", "?"},
{"dye:white", "dye:white", "dye:white"},
{"?", "dye:white", "?"}
}
}) })
streets.register_road_marking({ streets.register_road_marking({
suffix = "arrow_leftright", name = "white_arrow_right",
friendly_suffix = "arrow left + right", friendlyname = "White Arrow (right)",
overlay = "streets_arrow_leftright.png", tex = "streets_arrow_right.png",
aka = {},
register_stair = false,
register_slab = true,
flip_required = false, flip_required = false,
continous = false,
register_rw = true,
craft = {
{"?", "?", "?"},
{"dye:white", "dye:white", "dye:white"},
{"?", "dye:white", "?"}
}
}) })
streets.register_road_marking({ streets.register_road_marking({
suffix = "parking", name = "white_arrow_left_straight",
friendly_suffix = "parking", friendlyname = "White Arrow (left+straight)",
overlay = "streets_parking.png", tex = "streets_arrow_straightleft.png",
aka = {},
register_stair = false,
register_slab = true,
flip_required = false, flip_required = false,
continous = false,
register_rw = true,
craft = {
{"dye:white", "dye:white", "?"},
{"dye:white", "dye:white", "?"},
{"dye:white", "?", "?"}
}
}) })
streets.register_road_marking({ streets.register_road_marking({
suffix = "zigzag", name = "white_arrow_straight_right",
friendly_suffix = "zigzag", friendlyname = "White Arrow (straight+right)",
overlay = "streets_zigzag.png", tex = "streets_arrow_straightright.png",
aka = {},
register_stair = false,
register_slab = false,
flip_required = false, flip_required = false,
continous = true,
register_rw = true,
craft = {
{"dye:white", "?", "?"},
{"?", "dye:white", "?"},
{"?", "?", "dye:white"}
}
}) })
streets.register_road_marking({ streets.register_road_marking({
suffix = "forbidden", name = "white_arrow_left_straight_right",
friendly_suffix = "forbidden area", friendlyname = "White Arrow (left+straight+right)",
overlay = "streets_forbidden.png", tex = "streets_arrow_straightleftright.png",
aka = {},
register_stair = false,
register_slab = false,
flip_required = false, flip_required = false,
continous = true, })
register_rw = true,
craft = { streets.register_road_marking({
{"dye:white", "?", "dye:white"}, name = "white_arrow_left_right",
{"?", "dye:white", "?"}, friendlyname = "White Arrow (left+right)",
{"dye:white", "?", "dye:white"} 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 Category: Roads
]] ]]
streets.register_road_surface(":streets:asphalt", { streets.register_road_surface({
description = "Asphalt", name="asphalt",
friendlyname = "Asphalt",
tiles = {"streets_asphalt.png"}, tiles = {"streets_asphalt.png"},
groups = {cracky = 3}, groups = {cracky = 3,asphalt = 1},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
aka = {},
craft = { craft = {
output = "streets:asphalt 1", output = "streets:asphalt 1",
type = "cooking", type = "cooking",
@ -19,12 +19,12 @@ streets.register_road_surface(":streets:asphalt", {
} }
}) })
streets.register_road_surface(":streets:asphalt_red", { streets.register_road_surface({
description = "Colored Asphalt", name = "asphalt_red",
friendlyname = "Red Asphalt",
tiles = {"streets_asphalt_red.png"}, tiles = {"streets_asphalt_red.png"},
groups = {cracky = 3}, groups = {cracky = 3,asphalt = 1},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
aka = {},
craft = { craft = {
output = "streets:asphalt_red 1", output = "streets:asphalt_red 1",
type = "shapeless", type = "shapeless",
@ -32,12 +32,12 @@ streets.register_road_surface(":streets:asphalt_red", {
} }
}) })
streets.register_road_surface(":streets:asphalt_yellow", { streets.register_road_surface({
description = "Colored Asphalt", name = "asphalt_yellow",
friendlyname = "Yellow Asphalt",
tiles = {"streets_asphalt_yellow.png"}, tiles = {"streets_asphalt_yellow.png"},
groups = {cracky = 3}, groups = {cracky = 3,asphalt = 1},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
aka = {},
craft = { craft = {
output = "streets:asphalt_yellow 1", output = "streets:asphalt_yellow 1",
type = "shapeless", type = "shapeless",
@ -45,10 +45,11 @@ streets.register_road_surface(":streets:asphalt_yellow", {
} }
}) })
streets.register_road_surface(":streets:asphalt_blue", { streets.register_road_surface({
description = "Colored Asphalt", name = "asphalt_blue",
friendlyname = "Blue Asphalt",
tiles = {"streets_asphalt_blue.png"}, tiles = {"streets_asphalt_blue.png"},
groups = {cracky = 3}, groups = {cracky = 3,asphalt = 1},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
craft = { craft = {
output = "streets:asphalt_blue 1", output = "streets:asphalt_blue 1",