update signs_lib, basic_signs, and street_signs
This commit is contained in:
parent
9ba0eebc72
commit
797e049635
@ -17,12 +17,11 @@ function basic_signs.check_for_floor(pointed_thing)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function basic_signs.determine_sign_type(pos, placer, itemstack, pointed_thing, widefont)
|
function basic_signs.determine_sign_type(pos, placer, itemstack, pointed_thing)
|
||||||
|
|
||||||
local playername = placer:get_player_name()
|
local playername = placer:get_player_name()
|
||||||
local pt_name = minetest.get_node(pointed_thing.under).name
|
local pt_name = minetest.get_node(pointed_thing.under).name
|
||||||
local node = minetest.get_node(pos) -- since we're in after-place, this will be the wall sign itself
|
local node = minetest.get_node(pos) -- since we're in after-place, this will be the wall sign itself
|
||||||
local widefont = widefont or ""
|
|
||||||
|
|
||||||
if minetest.is_protected(pointed_thing.under, playername) then
|
if minetest.is_protected(pointed_thing.under, playername) then
|
||||||
minetest.record_protection_violation(pointed_thing.under, playername)
|
minetest.record_protection_violation(pointed_thing.under, playername)
|
||||||
@ -36,11 +35,11 @@ function basic_signs.determine_sign_type(pos, placer, itemstack, pointed_thing,
|
|||||||
not placer:get_player_control().sneak then
|
not placer:get_player_control().sneak then
|
||||||
return minetest.registered_nodes[pt_name].on_rightclick(pos, node, placer, itemstack, pointed_thing)
|
return minetest.registered_nodes[pt_name].on_rightclick(pos, node, placer, itemstack, pointed_thing)
|
||||||
elseif signs_lib.check_for_pole(pos, pointed_thing) then
|
elseif signs_lib.check_for_pole(pos, pointed_thing) then
|
||||||
minetest.swap_node(pos, {name = "default:sign_wall_wood"..widefont.."_onpole", param2 = node.param2})
|
minetest.swap_node(pos, {name = "default:sign_wall_wood_onpole", param2 = node.param2})
|
||||||
elseif signs_lib.check_for_ceiling(pointed_thing) then
|
elseif signs_lib.check_for_ceiling(pointed_thing) then
|
||||||
minetest.swap_node(pos, {name = "default:sign_wall_wood"..widefont.."_hanging", param2 = newparam2})
|
minetest.swap_node(pos, {name = "default:sign_wall_wood_hanging", param2 = newparam2})
|
||||||
elseif basic_signs.check_for_floor(pointed_thing) then
|
elseif basic_signs.check_for_floor(pointed_thing) then
|
||||||
minetest.swap_node(pos, {name = "basic_signs:yard_sign"..widefont, param2 = newparam2})
|
minetest.swap_node(pos, {name = "basic_signs:yard_sign", param2 = newparam2})
|
||||||
end
|
end
|
||||||
signs_lib.update_sign(pos)
|
signs_lib.update_sign(pos)
|
||||||
|
|
||||||
@ -52,27 +51,16 @@ end
|
|||||||
|
|
||||||
local def
|
local def
|
||||||
|
|
||||||
|
local wgroups = table.copy(signs_lib.standard_wood_groups)
|
||||||
|
wgroups.not_in_creative_inventory = 1
|
||||||
|
|
||||||
|
local sgroups = table.copy(signs_lib.standard_steel_groups)
|
||||||
|
sgroups.not_in_creative_inventory = 1
|
||||||
|
|
||||||
minetest.override_item("default:sign_wall_wood", {
|
minetest.override_item("default:sign_wall_wood", {
|
||||||
after_place_node = basic_signs.determine_sign_type
|
after_place_node = basic_signs.determine_sign_type
|
||||||
})
|
})
|
||||||
|
|
||||||
def = table.copy(minetest.registered_items["default:sign_wall_wood"])
|
|
||||||
def.description = "Wooden wall sign (wide font)"
|
|
||||||
def.inventory_image = def.inventory_image.."^signs_lib_wide_font_overlay_inv.png"
|
|
||||||
def.wield_image = def.wield_image.."^signs_lib_wide_font_overlay_inv.png"
|
|
||||||
def.horiz_scaling = signs_lib.standard_hscale / 2
|
|
||||||
def.after_place_node = function(pos, placer, itemstack, pointed_thing)
|
|
||||||
basic_signs.determine_sign_type(pos, placer, itemstack, pointed_thing, "_widefont")
|
|
||||||
end
|
|
||||||
signs_lib.register_sign("default:sign_wall_wood_widefont", def)
|
|
||||||
|
|
||||||
def = table.copy(minetest.registered_items["default:sign_wall_steel"])
|
|
||||||
def.description = "Steel wall sign (wide font)"
|
|
||||||
def.inventory_image = def.inventory_image.."^signs_lib_wide_font_overlay_inv.png"
|
|
||||||
def.wield_image = def.wield_image.."^signs_lib_wide_font_overlay_inv.png"
|
|
||||||
def.horiz_scaling = signs_lib.standard_hscale / 2
|
|
||||||
signs_lib.register_sign("default:sign_wall_steel_widefont", def)
|
|
||||||
|
|
||||||
signs_lib.register_sign("basic_signs:sign_wall_locked", {
|
signs_lib.register_sign("basic_signs:sign_wall_locked", {
|
||||||
description = S("Locked Sign"),
|
description = S("Locked Sign"),
|
||||||
tiles = {
|
tiles = {
|
||||||
@ -82,17 +70,12 @@ signs_lib.register_sign("basic_signs:sign_wall_locked", {
|
|||||||
inventory_image = "basic_signs_sign_wall_locked_inv.png",
|
inventory_image = "basic_signs_sign_wall_locked_inv.png",
|
||||||
locked = true,
|
locked = true,
|
||||||
entity_info = "standard",
|
entity_info = "standard",
|
||||||
allow_hanging = true
|
allow_hanging = true,
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_alias("locked_sign:sign_wall_locked", "basic_signs:sign_wall_locked")
|
minetest.register_alias("locked_sign:sign_wall_locked", "basic_signs:sign_wall_locked")
|
||||||
|
|
||||||
def = table.copy(minetest.registered_items["basic_signs:sign_wall_locked"])
|
|
||||||
def.description = S("Locked Sign (wide font)")
|
|
||||||
def.inventory_image = def.inventory_image.."^signs_lib_wide_font_overlay_inv.png"
|
|
||||||
def.wield_image = def.wield_image.."^signs_lib_wide_font_overlay_inv.png"
|
|
||||||
def.horiz_scaling = signs_lib.standard_hscale / 2
|
|
||||||
signs_lib.register_sign("basic_signs:sign_wall_locked_widefont", def)
|
|
||||||
|
|
||||||
-- array : color, translated color, default text color
|
-- array : color, translated color, default text color
|
||||||
|
|
||||||
@ -127,23 +110,14 @@ for i, color in ipairs(sign_colors) do
|
|||||||
mesh = "signs_lib_standard_wall_sign_entity.obj",
|
mesh = "signs_lib_standard_wall_sign_entity.obj",
|
||||||
yaw = signs_lib.standard_yaw
|
yaw = signs_lib.standard_yaw
|
||||||
},
|
},
|
||||||
allow_hanging = true
|
allow_hanging = true,
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
def = table.copy(minetest.registered_items["basic_signs:sign_wall_steel_"..color[1]])
|
|
||||||
def.description = S("Sign (@1, steel, wide font)", color[2])
|
|
||||||
def.horiz_scaling = signs_lib.standard_hscale / 2
|
|
||||||
def.inventory_image = def.inventory_image.."^signs_lib_wide_font_overlay_inv.png"
|
|
||||||
def.wield_image = def.wield_image.."^signs_lib_wide_font_overlay_inv.png"
|
|
||||||
signs_lib.register_sign("basic_signs:sign_wall_steel_widefont_"..color[1], def)
|
|
||||||
|
|
||||||
table.insert(signs_lib.lbm_restore_nodes, "signs:sign_wall_"..color[1])
|
table.insert(signs_lib.lbm_restore_nodes, "signs:sign_wall_"..color[1])
|
||||||
minetest.register_alias("signs:sign_wall_"..color[1], "basic_signs:sign_wall_steel_"..color[1])
|
minetest.register_alias("signs:sign_wall_"..color[1], "basic_signs:sign_wall_steel_"..color[1])
|
||||||
end
|
end
|
||||||
|
|
||||||
local wgroups = table.copy(signs_lib.standard_wood_groups)
|
|
||||||
wgroups.not_in_creative_inventory = 1
|
|
||||||
|
|
||||||
signs_lib.register_sign("basic_signs:yard_sign", {
|
signs_lib.register_sign("basic_signs:yard_sign", {
|
||||||
description = "Wooden yard sign",
|
description = "Wooden yard sign",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
@ -161,17 +135,9 @@ signs_lib.register_sign("basic_signs:yard_sign", {
|
|||||||
},
|
},
|
||||||
groups = wgroups,
|
groups = wgroups,
|
||||||
drop = "default:sign_wall_wood",
|
drop = "default:sign_wall_wood",
|
||||||
allow_onpole = false
|
allow_onpole = false,
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
def = table.copy(minetest.registered_items["basic_signs:yard_sign"])
|
|
||||||
def.description = "Wooden yard sign (wide font)"
|
|
||||||
def.inventory_image = def.inventory_image.."^signs_lib_wide_font_overlay_inv.png"
|
|
||||||
def.wield_image = def.wield_image.."^signs_lib_wide_font_overlay_inv.png"
|
|
||||||
def.wield_image = def.wield_image.."^signs_lib_wide_font_overlay_inv.png"
|
|
||||||
def.horiz_scaling = signs_lib.standard_hscale / 2
|
|
||||||
def.groups = wgroups
|
|
||||||
minetest.register_node("basic_signs:yard_sign_widefont", def)
|
|
||||||
|
|
||||||
table.insert(signs_lib.lbm_restore_nodes, "signs:sign_yard")
|
table.insert(signs_lib.lbm_restore_nodes, "signs:sign_yard")
|
||||||
minetest.register_alias("signs:sign_yard", "basic_signs:yard_sign")
|
minetest.register_alias("signs:sign_yard", "basic_signs:yard_sign")
|
||||||
|
@ -434,14 +434,38 @@ local function set_obj_text(obj, text, x, pos)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
signs_lib.construct_sign = function(pos)
|
local function make_widefont_nodename(name)
|
||||||
local meta = minetest.get_meta(pos)
|
if string.find(name, "_widefont") then return name end
|
||||||
meta:set_string(
|
if string.find(name, "_onpole") then
|
||||||
"formspec",
|
return string.gsub(name, "_onpole", "_widefont_onpole")
|
||||||
"size[6,4]"..
|
elseif string.find(name, "_hanging") then
|
||||||
|
return string.gsub(name, "_hanging", "_widefont_hanging")
|
||||||
|
else
|
||||||
|
return name.."_widefont"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function signs_lib.construct_sign(pos)
|
||||||
|
local form = "size[6,4]"..
|
||||||
"textarea[0,-0.3;6.5,3;text;;${text}]"..
|
"textarea[0,-0.3;6.5,3;text;;${text}]"..
|
||||||
"button_exit[2,3.4;2,1;ok;"..S("Write").."]"..
|
"background[-0.5,-0.5;7,5;signs_lib_sign_bg.jpg]"
|
||||||
"background[-0.5,-0.5;7,5;signs_lib_sign_bg.jpg]")
|
local node = minetest.get_node(pos)
|
||||||
|
local wname = make_widefont_nodename(node.name)
|
||||||
|
|
||||||
|
if minetest.registered_items[wname] then
|
||||||
|
local state = "off"
|
||||||
|
if string.find(node.name, "widefont") then state = "on" end
|
||||||
|
form = form.."label[1,3.4;Use wide font]"..
|
||||||
|
"image_button[1.1,3.7;1,0.6;signs_lib_switch_"..
|
||||||
|
state..".png;"..
|
||||||
|
state..";;;false;signs_lib_switch_interm.png]"..
|
||||||
|
"button_exit[3,3.4;2,1;ok;"..S("Write").."]"
|
||||||
|
else
|
||||||
|
form = form.."button_exit[2,3.4;2,1;ok;"..S("Write").."]"
|
||||||
|
end
|
||||||
|
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
meta:set_string("formspec", form)
|
||||||
local i = meta:get_string("infotext")
|
local i = meta:get_string("infotext")
|
||||||
if i == "" then -- it wasn't even set, so set it.
|
if i == "" then -- it wasn't even set, so set it.
|
||||||
meta:set_string("infotext", "")
|
meta:set_string("infotext", "")
|
||||||
@ -512,13 +536,36 @@ function signs_lib.update_sign(pos, fields)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function signs_lib.receive_fields(pos, formname, fields, sender)
|
function signs_lib.receive_fields(pos, formname, fields, sender)
|
||||||
if fields and fields.text and fields.ok and signs_lib.can_modify(pos, sender) then
|
|
||||||
|
if not fields or not signs_lib.can_modify(pos, sender) then return end
|
||||||
|
|
||||||
|
if fields.text and fields.ok then
|
||||||
minetest.log("action", S("@1 wrote \"@2\" to sign at @3",
|
minetest.log("action", S("@1 wrote \"@2\" to sign at @3",
|
||||||
(sender:get_player_name() or ""),
|
(sender:get_player_name() or ""),
|
||||||
fields.text:gsub('\\', '\\\\'):gsub("\n", "\\n"),
|
fields.text:gsub('\\', '\\\\'):gsub("\n", "\\n"),
|
||||||
minetest.pos_to_string(pos)
|
minetest.pos_to_string(pos)
|
||||||
))
|
))
|
||||||
signs_lib.update_sign(pos, fields)
|
signs_lib.update_sign(pos, fields)
|
||||||
|
elseif fields.on or fields.off then
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
local newname
|
||||||
|
|
||||||
|
if fields.on and string.find(node.name, "widefont") then
|
||||||
|
newname = string.gsub(node.name, "_widefont", "")
|
||||||
|
elseif fields.off and not string.find(node.name, "widefont") then
|
||||||
|
newname = make_widefont_nodename(node.name)
|
||||||
|
end
|
||||||
|
if newname then
|
||||||
|
minetest.log("action", S("@1 flipped the wide-font switch to \"@2\" at @3",
|
||||||
|
(sender:get_player_name() or ""),
|
||||||
|
(fields.on and "off" or "on"),
|
||||||
|
minetest.pos_to_string(pos)
|
||||||
|
))
|
||||||
|
|
||||||
|
minetest.swap_node(pos, {name = newname, param2 = node.param2})
|
||||||
|
signs_lib.construct_sign(pos)
|
||||||
|
signs_lib.update_sign(pos, fields)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -646,47 +693,7 @@ function signs_lib.register_fence_with_sign()
|
|||||||
minetest.log("warning", "[signs_lib] ".."Attempt to call no longer used function signs_lib.register_fence_with_sign()")
|
minetest.log("warning", "[signs_lib] ".."Attempt to call no longer used function signs_lib.register_fence_with_sign()")
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[
|
local function register_sign(name, rdef)
|
||||||
The main sign registration function
|
|
||||||
===================================
|
|
||||||
|
|
||||||
Example minimal recommended def for writable signs:
|
|
||||||
|
|
||||||
signs_lib.register_sign("foo:my_cool_sign", {
|
|
||||||
description = "Wooden cool sign",
|
|
||||||
inventory_image = "signs_lib_sign_cool_inv.png",
|
|
||||||
tiles = {
|
|
||||||
"signs_lib_sign_cool.png",
|
|
||||||
"signs_lib_sign_cool_edges.png"
|
|
||||||
},
|
|
||||||
number_of_lines = 2,
|
|
||||||
horiz_scaling = 0.8,
|
|
||||||
vert_scaling = 1,
|
|
||||||
line_spacing = 9,
|
|
||||||
font_size = 31,
|
|
||||||
x_offset = 7,
|
|
||||||
y_offset = 4,
|
|
||||||
chars_per_line = 40,
|
|
||||||
entity_info = "standard"
|
|
||||||
})
|
|
||||||
|
|
||||||
* default def assumes a wallmounted sign with on-pole being allowed.
|
|
||||||
|
|
||||||
*For signs that can't support onpole, include in the def:
|
|
||||||
allow_onpole = false,
|
|
||||||
|
|
||||||
* "standard" entity info implies the standard wood/steel sign model, in
|
|
||||||
wallmounted mode. For facedir signs using the standard model, use:
|
|
||||||
|
|
||||||
entity_info = {
|
|
||||||
mesh = "signs_lib_standard_wall_sign_entity.obj",
|
|
||||||
yaw = signs_lib.standard_yaw
|
|
||||||
},
|
|
||||||
|
|
||||||
]]--
|
|
||||||
|
|
||||||
function signs_lib.register_sign(name, rdef)
|
|
||||||
|
|
||||||
local def = table.copy(rdef)
|
local def = table.copy(rdef)
|
||||||
|
|
||||||
if rdef.entity_info == "standard" then
|
if rdef.entity_info == "standard" then
|
||||||
@ -819,7 +826,58 @@ function signs_lib.register_sign(name, rdef)
|
|||||||
minetest.register_node(":"..name.."_hanging", hdef)
|
minetest.register_node(":"..name.."_hanging", hdef)
|
||||||
table.insert(signs_lib.lbm_restore_nodes, name.."_hanging")
|
table.insert(signs_lib.lbm_restore_nodes, name.."_hanging")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--[[
|
||||||
|
The main sign registration function
|
||||||
|
===================================
|
||||||
|
|
||||||
|
Example minimal recommended def for writable signs:
|
||||||
|
|
||||||
|
signs_lib.register_sign("foo:my_cool_sign", {
|
||||||
|
description = "Wooden cool sign",
|
||||||
|
inventory_image = "signs_lib_sign_cool_inv.png",
|
||||||
|
tiles = {
|
||||||
|
"signs_lib_sign_cool.png",
|
||||||
|
"signs_lib_sign_cool_edges.png"
|
||||||
|
},
|
||||||
|
number_of_lines = 2,
|
||||||
|
horiz_scaling = 0.8,
|
||||||
|
vert_scaling = 1,
|
||||||
|
line_spacing = 9,
|
||||||
|
font_size = 31,
|
||||||
|
x_offset = 7,
|
||||||
|
y_offset = 4,
|
||||||
|
chars_per_line = 40,
|
||||||
|
entity_info = "standard"
|
||||||
|
})
|
||||||
|
|
||||||
|
* default def assumes a wallmounted sign with on-pole being allowed.
|
||||||
|
|
||||||
|
*For signs that can't support onpole, include in the def:
|
||||||
|
allow_onpole = false,
|
||||||
|
|
||||||
|
* "standard" entity info implies the standard wood/steel sign model, in
|
||||||
|
wallmounted mode. For facedir signs using the standard model, use:
|
||||||
|
|
||||||
|
entity_info = {
|
||||||
|
mesh = "signs_lib_standard_wall_sign_entity.obj",
|
||||||
|
yaw = signs_lib.standard_yaw
|
||||||
|
},
|
||||||
|
|
||||||
|
]]--
|
||||||
|
|
||||||
|
function signs_lib.register_sign(name, rdef)
|
||||||
|
register_sign(name, rdef)
|
||||||
|
|
||||||
|
if rdef.allow_widefont then
|
||||||
|
|
||||||
|
wdef = table.copy(minetest.registered_items[name])
|
||||||
|
wdef.groups.not_in_creative_inventory = 1
|
||||||
|
wdef.horiz_scaling = wdef.horiz_scaling / 2
|
||||||
|
|
||||||
|
register_sign(name.."_widefont", wdef)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- restore signs' text after /clearobjects and the like, the next time
|
-- restore signs' text after /clearobjects and the like, the next time
|
||||||
|
@ -9,6 +9,7 @@ signs_lib.register_sign("default:sign_wall_wood", {
|
|||||||
},
|
},
|
||||||
entity_info = "standard",
|
entity_info = "standard",
|
||||||
allow_hanging = true,
|
allow_hanging = true,
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
signs_lib.register_sign("default:sign_wall_steel", {
|
signs_lib.register_sign("default:sign_wall_steel", {
|
||||||
@ -23,6 +24,7 @@ signs_lib.register_sign("default:sign_wall_steel", {
|
|||||||
locked = true,
|
locked = true,
|
||||||
entity_info = "standard",
|
entity_info = "standard",
|
||||||
allow_hanging = true,
|
allow_hanging = true,
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_alias("signs:sign_hanging", "default:sign_wall_wood_hanging")
|
minetest.register_alias("signs:sign_hanging", "default:sign_wall_wood_hanging")
|
||||||
|
BIN
signs_lib/textures/signs_lib_switch_interm.png
Normal file
BIN
signs_lib/textures/signs_lib_switch_interm.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.5 KiB |
BIN
signs_lib/textures/signs_lib_switch_off.png
Normal file
BIN
signs_lib/textures/signs_lib_switch_off.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
BIN
signs_lib/textures/signs_lib_switch_on.png
Normal file
BIN
signs_lib/textures/signs_lib_switch_on.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.0 KiB |
@ -2,6 +2,9 @@
|
|||||||
local S = signs_lib.gettext
|
local S = signs_lib.gettext
|
||||||
local groups = table.copy(signs_lib.standard_steel_groups)
|
local groups = table.copy(signs_lib.standard_steel_groups)
|
||||||
|
|
||||||
|
local sgroups = table.copy(signs_lib.standard_steel_groups)
|
||||||
|
sgroups.not_in_creative_inventory = 1
|
||||||
|
|
||||||
local cbox = {
|
local cbox = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
@ -34,7 +37,8 @@ signs_lib.register_sign("street_signs:sign_basic", {
|
|||||||
mesh = "street_signs_basic_entity.obj",
|
mesh = "street_signs_basic_entity.obj",
|
||||||
yaw = signs_lib.standard_yaw
|
yaw = signs_lib.standard_yaw
|
||||||
},
|
},
|
||||||
allow_onpole = false
|
allow_onpole = false,
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
cbox = {
|
cbox = {
|
||||||
@ -69,7 +73,8 @@ signs_lib.register_sign("street_signs:sign_basic_top_only", {
|
|||||||
mesh = "street_signs_basic_top_only_entity.obj",
|
mesh = "street_signs_basic_top_only_entity.obj",
|
||||||
yaw = signs_lib.standard_yaw
|
yaw = signs_lib.standard_yaw
|
||||||
},
|
},
|
||||||
allow_onpole = false
|
allow_onpole = false,
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
cbox = signs_lib.make_selection_boxes(24, 24)
|
cbox = signs_lib.make_selection_boxes(24, 24)
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
local S = signs_lib.gettext
|
local S = signs_lib.gettext
|
||||||
local cbox = signs_lib.make_selection_boxes(36, 36)
|
local cbox = signs_lib.make_selection_boxes(36, 36)
|
||||||
|
|
||||||
|
local sgroups = table.copy(signs_lib.standard_steel_groups)
|
||||||
|
sgroups.not_in_creative_inventory = 1
|
||||||
|
|
||||||
signs_lib.register_sign("street_signs:sign_us_route", {
|
signs_lib.register_sign("street_signs:sign_us_route", {
|
||||||
description = "M1-4: Generic \"US Route\" sign",
|
description = "M1-4: Generic \"US Route\" sign",
|
||||||
selection_box = cbox,
|
selection_box = cbox,
|
||||||
@ -25,6 +28,7 @@ signs_lib.register_sign("street_signs:sign_us_route", {
|
|||||||
mesh = "street_signs_generic_sign_36x36_entity.obj",
|
mesh = "street_signs_generic_sign_36x36_entity.obj",
|
||||||
yaw = signs_lib.wallmounted_yaw
|
yaw = signs_lib.wallmounted_yaw
|
||||||
},
|
},
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
signs_lib.register_sign("street_signs:sign_us_interstate", {
|
signs_lib.register_sign("street_signs:sign_us_interstate", {
|
||||||
@ -51,6 +55,7 @@ signs_lib.register_sign("street_signs:sign_us_interstate", {
|
|||||||
mesh = "street_signs_interstate_shield_entity.obj",
|
mesh = "street_signs_interstate_shield_entity.obj",
|
||||||
yaw = signs_lib.wallmounted_yaw
|
yaw = signs_lib.wallmounted_yaw
|
||||||
},
|
},
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
cbox = signs_lib.make_selection_boxes(48, 18)
|
cbox = signs_lib.make_selection_boxes(48, 18)
|
||||||
|
@ -73,6 +73,7 @@ signs_lib.register_sign("street_signs:sign_speed_limit", {
|
|||||||
mesh = "street_signs_generic_sign_30x36_entity.obj",
|
mesh = "street_signs_generic_sign_30x36_entity.obj",
|
||||||
yaw = signs_lib.wallmounted_yaw
|
yaw = signs_lib.wallmounted_yaw
|
||||||
},
|
},
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
cbox = signs_lib.make_selection_boxes(36, 36)
|
cbox = signs_lib.make_selection_boxes(36, 36)
|
||||||
@ -505,6 +506,7 @@ signs_lib.register_sign("street_signs:sign_ped_push_button_to_cross_r10_3i", {
|
|||||||
yaw = signs_lib.wallmounted_yaw
|
yaw = signs_lib.wallmounted_yaw
|
||||||
},
|
},
|
||||||
uses_slim_pole_mount = true,
|
uses_slim_pole_mount = true,
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
signs_lib.register_sign("street_signs:sign_ped_push_button_to_cross_r10_3i_left", {
|
signs_lib.register_sign("street_signs:sign_ped_push_button_to_cross_r10_3i_left", {
|
||||||
@ -531,9 +533,9 @@ signs_lib.register_sign("street_signs:sign_ped_push_button_to_cross_r10_3i_left"
|
|||||||
yaw = signs_lib.wallmounted_yaw
|
yaw = signs_lib.wallmounted_yaw
|
||||||
},
|
},
|
||||||
uses_slim_pole_mount = true,
|
uses_slim_pole_mount = true,
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
cbox = signs_lib.make_selection_boxes(30, 36)
|
cbox = signs_lib.make_selection_boxes(30, 36)
|
||||||
|
|
||||||
signs_lib.register_sign("street_signs:sign_left_on_green_arrow_only", {
|
signs_lib.register_sign("street_signs:sign_left_on_green_arrow_only", {
|
||||||
|
@ -469,6 +469,7 @@ signs_lib.register_sign("street_signs:sign_distance_2_lines", {
|
|||||||
mesh = "street_signs_generic_sign_24x18_top_entity.obj",
|
mesh = "street_signs_generic_sign_24x18_top_entity.obj",
|
||||||
yaw = signs_lib.wallmounted_yaw
|
yaw = signs_lib.wallmounted_yaw
|
||||||
},
|
},
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
signs_lib.register_sign("street_signs:sign_distance_2_lines_orange", {
|
signs_lib.register_sign("street_signs:sign_distance_2_lines_orange", {
|
||||||
@ -494,6 +495,7 @@ signs_lib.register_sign("street_signs:sign_distance_2_lines_orange", {
|
|||||||
mesh = "street_signs_generic_sign_24x18_top_entity.obj",
|
mesh = "street_signs_generic_sign_24x18_top_entity.obj",
|
||||||
yaw = signs_lib.wallmounted_yaw
|
yaw = signs_lib.wallmounted_yaw
|
||||||
},
|
},
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
cbox = signs_lib.make_selection_boxes(30, 30, onpole)
|
cbox = signs_lib.make_selection_boxes(30, 30, onpole)
|
||||||
|
|
||||||
@ -561,6 +563,7 @@ signs_lib.register_sign("street_signs:sign_low_clearance", {
|
|||||||
mesh = "street_signs_warning_36x36_entity.obj",
|
mesh = "street_signs_warning_36x36_entity.obj",
|
||||||
yaw = signs_lib.wallmounted_yaw
|
yaw = signs_lib.wallmounted_yaw
|
||||||
},
|
},
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
cbox = signs_lib.make_selection_boxes(18, 18, onpole, 0, 10, 0)
|
cbox = signs_lib.make_selection_boxes(18, 18, onpole, 0, 10, 0)
|
||||||
|
|
||||||
@ -587,6 +590,7 @@ signs_lib.register_sign("street_signs:sign_advisory_speed_mph", {
|
|||||||
mesh = "street_signs_generic_sign_18x18_top_entity.obj",
|
mesh = "street_signs_generic_sign_18x18_top_entity.obj",
|
||||||
yaw = signs_lib.wallmounted_yaw
|
yaw = signs_lib.wallmounted_yaw
|
||||||
},
|
},
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
signs_lib.register_sign("street_signs:sign_advisory_speed_kmh", {
|
signs_lib.register_sign("street_signs:sign_advisory_speed_kmh", {
|
||||||
@ -612,6 +616,7 @@ signs_lib.register_sign("street_signs:sign_advisory_speed_kmh", {
|
|||||||
mesh = "street_signs_generic_sign_18x18_top_entity.obj",
|
mesh = "street_signs_generic_sign_18x18_top_entity.obj",
|
||||||
yaw = signs_lib.wallmounted_yaw
|
yaw = signs_lib.wallmounted_yaw
|
||||||
},
|
},
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
signs_lib.register_sign("street_signs:sign_advisory_speed_ms", {
|
signs_lib.register_sign("street_signs:sign_advisory_speed_ms", {
|
||||||
@ -637,4 +642,5 @@ signs_lib.register_sign("street_signs:sign_advisory_speed_ms", {
|
|||||||
mesh = "street_signs_generic_sign_18x18_top_entity.obj",
|
mesh = "street_signs_generic_sign_18x18_top_entity.obj",
|
||||||
yaw = signs_lib.wallmounted_yaw
|
yaw = signs_lib.wallmounted_yaw
|
||||||
},
|
},
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
local S = signs_lib.gettext
|
local S = signs_lib.gettext
|
||||||
local cbox = signs_lib.make_selection_boxes(36, 36)
|
local cbox = signs_lib.make_selection_boxes(36, 36)
|
||||||
|
|
||||||
|
local sgroups = table.copy(signs_lib.standard_steel_groups)
|
||||||
|
sgroups.not_in_creative_inventory = 1
|
||||||
|
|
||||||
signs_lib.register_sign("street_signs:sign_warning_3_line", {
|
signs_lib.register_sign("street_signs:sign_warning_3_line", {
|
||||||
description = "W3-4: Generic US diamond \"warning\" sign (3-line, yellow)",
|
description = "W3-4: Generic US diamond \"warning\" sign (3-line, yellow)",
|
||||||
selection_box = cbox,
|
selection_box = cbox,
|
||||||
@ -25,9 +28,11 @@ signs_lib.register_sign("street_signs:sign_warning_3_line", {
|
|||||||
mesh = "street_signs_warning_36x36_entity.obj",
|
mesh = "street_signs_warning_36x36_entity.obj",
|
||||||
yaw = signs_lib.wallmounted_yaw
|
yaw = signs_lib.wallmounted_yaw
|
||||||
},
|
},
|
||||||
drop = "street_signs:sign_warning_3_line"
|
drop = "street_signs:sign_warning_3_line",
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
signs_lib.register_sign("street_signs:sign_warning_4_line", {
|
signs_lib.register_sign("street_signs:sign_warning_4_line", {
|
||||||
description = "W23-2: Generic US diamond \"warning\" sign (4-line, yellow)",
|
description = "W23-2: Generic US diamond \"warning\" sign (4-line, yellow)",
|
||||||
selection_box = cbox,
|
selection_box = cbox,
|
||||||
@ -51,7 +56,8 @@ signs_lib.register_sign("street_signs:sign_warning_4_line", {
|
|||||||
mesh = "street_signs_warning_36x36_entity.obj",
|
mesh = "street_signs_warning_36x36_entity.obj",
|
||||||
yaw = signs_lib.wallmounted_yaw
|
yaw = signs_lib.wallmounted_yaw
|
||||||
},
|
},
|
||||||
drop = "street_signs:sign_warning_4_line"
|
drop = "street_signs:sign_warning_4_line",
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
signs_lib.register_sign("street_signs:sign_warning_orange_3_line", {
|
signs_lib.register_sign("street_signs:sign_warning_orange_3_line", {
|
||||||
@ -77,7 +83,8 @@ signs_lib.register_sign("street_signs:sign_warning_orange_3_line", {
|
|||||||
mesh = "street_signs_warning_36x36_entity.obj",
|
mesh = "street_signs_warning_36x36_entity.obj",
|
||||||
yaw = signs_lib.wallmounted_yaw
|
yaw = signs_lib.wallmounted_yaw
|
||||||
},
|
},
|
||||||
drop = "street_signs:sign_warning_orange_3_line"
|
drop = "street_signs:sign_warning_orange_3_line",
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
signs_lib.register_sign("street_signs:sign_warning_orange_4_line", {
|
signs_lib.register_sign("street_signs:sign_warning_orange_4_line", {
|
||||||
@ -103,8 +110,10 @@ signs_lib.register_sign("street_signs:sign_warning_orange_4_line", {
|
|||||||
mesh = "street_signs_warning_36x36_entity.obj",
|
mesh = "street_signs_warning_36x36_entity.obj",
|
||||||
yaw = signs_lib.wallmounted_yaw
|
yaw = signs_lib.wallmounted_yaw
|
||||||
},
|
},
|
||||||
drop = "street_signs:sign_warning_orange_4_line"
|
drop = "street_signs:sign_warning_orange_4_line",
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
|
|
||||||
for _, s in ipairs(street_signs.big_sign_sizes) do
|
for _, s in ipairs(street_signs.big_sign_sizes) do
|
||||||
local size = s[1]
|
local size = s[1]
|
||||||
local nlines = s[2]
|
local nlines = s[2]
|
||||||
@ -148,35 +157,11 @@ for _, s in ipairs(street_signs.big_sign_sizes) do
|
|||||||
mesh = "street_signs_generic_highway_"..size.."_entity.obj",
|
mesh = "street_signs_generic_highway_"..size.."_entity.obj",
|
||||||
yaw = signs_lib.wallmounted_yaw
|
yaw = signs_lib.wallmounted_yaw
|
||||||
},
|
},
|
||||||
allow_onpole = false
|
allow_onpole = false,
|
||||||
})
|
allow_widefont = true
|
||||||
|
|
||||||
signs_lib.register_sign("street_signs:sign_highway_widefont_"..size.."_"..color, {
|
|
||||||
description = "Generic highway sign (Wide font, "..nlines.."-line, "..size..", "..color..")",
|
|
||||||
inventory_image = "street_signs_generic_highway_"..size.."_"..color.."_inv.png",
|
|
||||||
selection_box = cbox,
|
|
||||||
mesh = "street_signs_generic_highway_"..size..".obj",
|
|
||||||
tiles = {
|
|
||||||
"street_signs_generic_highway_front_"..size.."_"..color..".png",
|
|
||||||
"street_signs_generic_highway_back_"..size..".png",
|
|
||||||
"street_signs_generic_highway_edges.png"
|
|
||||||
},
|
|
||||||
default_color = defc,
|
|
||||||
groups = signs_lib.standard_steel_groups,
|
|
||||||
sounds = signs_lib.standard_steel_sign_sounds,
|
|
||||||
number_of_lines = nlines,
|
|
||||||
chars_per_line = math.ceil(nchars/1.4),
|
|
||||||
horiz_scaling = hscale/1.4,
|
|
||||||
vert_scaling = vscale,
|
|
||||||
line_spacing = 2,
|
|
||||||
font_size = 31,
|
|
||||||
x_offset = xoffs,
|
|
||||||
y_offset = yoffs,
|
|
||||||
entity_info = {
|
|
||||||
mesh = "street_signs_generic_highway_"..size.."_entity.obj",
|
|
||||||
yaw = signs_lib.wallmounted_yaw
|
|
||||||
},
|
|
||||||
allow_onpole = false
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_alias("street_signs:sign_highway_widefont_"..size.."_"..color,
|
||||||
|
"street_signs:sign_highway_"..size.."_"..color.."_widefont")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user