1
0
mirror of https://github.com/mt-mods/signs_lib.git synced 2025-04-29 22:30:25 +02:00

Compare commits

..

No commits in common. "master" and "2021-03-04" have entirely different histories.

1128 changed files with 857 additions and 7791 deletions

1
.gitattributes vendored
View File

@ -1 +0,0 @@
util/blender export-ignore

View File

@ -1,13 +0,0 @@
name: luacheck
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: apt
run: sudo apt-get install -y luarocks
- name: luacheck install
run: luarocks install --local luacheck
- name: luacheck run
run: $HOME/.luarocks/bin/luacheck ./

View File

@ -1,16 +0,0 @@
unused_args = false
max_line_length = 180
globals = {
"minetest",
"signs_lib",
}
read_globals = {
-- Builtin
table = {fields = {"copy"}},
"ItemStack", "vector", "default",
-- Mod deps
"screwdriver",
}

10
API.md
View File

@ -149,11 +149,9 @@ In this text, common terms such as `pos`, `node`, or `placer`/`digger` will not
* `font_size = int` * `font_size = int`
Selects which font to use, either 16 or 32 (pixel height). This setting directly affects the sign's vertical resolution. Selects which font to use, either 15 or 31 (pixel height). This setting directly affects the sign's vertical resolution.
Default: 16 Default: 15
Note: Valid values were formerly 15 and 31, these are now aliases of 16 and 32 respectively.
* `x_offset = int` * `x_offset = int`
* `y_offset = int` * `y_offset = int`
@ -236,7 +234,7 @@ signs_lib.register_sign("basic_signs:sign_wall_glass", {
allow_onpole = true, allow_onpole = true,
allow_onpole_horizontal = true, allow_onpole_horizontal = true,
allow_yard = true, allow_yard = true,
use_texture_alpha = "blend", use_texture_alpha = true,
}) })
``` ```
@ -250,7 +248,7 @@ signs_lib.register_sign("basic_signs:sign_wall_glass", {
* `signs_lib.rightclick_sign(pos, node, player, itemstack, pointed_thing)` * `signs_lib.rightclick_sign(pos, node, player, itemstack, pointed_thing)`
Open the default sign formspec, if the player has the `signslib_edit` privilege. (privilege can be set by `signs_lib.edit_priv` setting) Open the default sign formspec, if the player has the `signslib_edit` privilege.
* `signs_lib.destruct_sign(pos)` * `signs_lib.destruct_sign(pos)`

View File

@ -10,7 +10,7 @@ Without any other add-ons, this mod upgrades only the default wooden and steel s
## Text formatting ## Text formatting
In general, text is rendered exactly as-written, left-to-right, top to bottom, without any translations or modifications to a maximum of 400 chars. The standard fonts support 7-bit ASCII as well as Cyrllic. In general, text is rendered exactly as-written, left-to-right, top to bottom, without any translations or modifications. The standard fonts support 7-bit ASCII as well as Cyrllic.
That said, there are some basic text formatting options: That said, there are some basic text formatting options:
@ -22,16 +22,10 @@ That said, there are some basic text formatting options:
Writing "^" followed by a letter "a" through "h" will produce double-wide versions of these arrows, in the same order. These wide arrows occupy 0x89 to 0x91 in the character set. Writing "^" followed by a letter "a" through "h" will produce double-wide versions of these arrows, in the same order. These wide arrows occupy 0x89 to 0x91 in the character set.
To write a "^" on a sign, wirte "#^"
* A color may be specified in the sign text by using "#" followed by a single hexadcimal digit (0-9 or a-f). These colors come from the standard Linux/IRC/CGA color set, and are shown in the sign's formspec. Any color change will remain in effect until changed again, or until the next line break. Any number of color changes in any arbitrary arrangement is allowed. * A color may be specified in the sign text by using "#" followed by a single hexadcimal digit (0-9 or a-f). These colors come from the standard Linux/IRC/CGA color set, and are shown in the sign's formspec. Any color change will remain in effect until changed again, or until the next line break. Any number of color changes in any arbitrary arrangement is allowed.
To write "#" on a sign, write "##".
* Most writable signs can display double-wide text by flipping a switch in the sign's formspec. * Most writable signs can display double-wide text by flipping a switch in the sign's formspec.
* Support full Unicode Plane 0 charset (63000+ characters). The "Unicode font" switch on each sign can be turned on for a more consistent letter style in multilingual text.
## Sign placement and rotation notes ## Sign placement and rotation notes
* Pointing at a wall while placing will, of course, place the sign on the wall. * Pointing at a wall while placing will, of course, place the sign on the wall.
@ -67,4 +61,3 @@ The list of loaded, sign-bearing blocks is created/populated by an LBM (and trim
* `signslib_edit` * `signslib_edit`
Allows to rotate signs and to open (and consequently edit) any default sign formspec. Allows to rotate signs and to open (and consequently edit) any default sign formspec.
(privilege can be set by `signs_lib.edit_priv` setting)

471
api.lua
View File

@ -1,17 +1,9 @@
-- signs_lib api, backported from street_signs -- signs_lib api, backported from street_signs
local S = signs_lib.S local S = signs_lib.gettext
local FS = function(...) return minetest.formspec_escape(S(...)) end
local has_default_mod = minetest.get_modpath("default")
local function log(level, messagefmt, ...)
minetest.log(level, "[signs_lib] " .. messagefmt:format(...))
end
local function get_sign_formspec() end local function get_sign_formspec() end
signs_lib.glow_item = "basic_materials:energy_crystal_simple"
signs_lib.lbm_restore_nodes = {} signs_lib.lbm_restore_nodes = {}
signs_lib.old_fenceposts = {} signs_lib.old_fenceposts = {}
signs_lib.old_fenceposts_replacement_signs = {} signs_lib.old_fenceposts_replacement_signs = {}
@ -22,19 +14,21 @@ signs_lib.standard_lines = 6
signs_lib.standard_hscale = 1 signs_lib.standard_hscale = 1
signs_lib.standard_vscale = 1 signs_lib.standard_vscale = 1
signs_lib.standard_lspace = 1 signs_lib.standard_lspace = 1
signs_lib.standard_fsize = 16 signs_lib.standard_fsize = 15
signs_lib.standard_xoffs = 4 signs_lib.standard_xoffs = 4
signs_lib.standard_yoffs = 0 signs_lib.standard_yoffs = 0
signs_lib.standard_cpl = 35 signs_lib.standard_cpl = 35
signs_lib.standard_wood_groups = table.copy(has_default_mod and minetest.registered_items["default:sign_wall_wood"].groups or {}) signs_lib.standard_wood_groups = table.copy(minetest.registered_items["default:sign_wall_wood"].groups)
signs_lib.standard_wood_groups.sign = 1
signs_lib.standard_wood_groups.attached_node = nil signs_lib.standard_wood_groups.attached_node = nil
signs_lib.standard_steel_groups = table.copy(has_default_mod and minetest.registered_items["default:sign_wall_steel"].groups or {}) signs_lib.standard_steel_groups = table.copy(minetest.registered_items["default:sign_wall_steel"].groups)
signs_lib.standard_steel_groups.sign = 1
signs_lib.standard_steel_groups.attached_node = nil signs_lib.standard_steel_groups.attached_node = nil
signs_lib.standard_wood_sign_sounds = table.copy(has_default_mod and minetest.registered_items["default:sign_wall_wood"].sounds or {}) signs_lib.standard_wood_sign_sounds = table.copy(minetest.registered_items["default:sign_wall_wood"].sounds)
signs_lib.standard_steel_sign_sounds = table.copy(has_default_mod and minetest.registered_items["default:sign_wall_steel"].sounds or {}) signs_lib.standard_steel_sign_sounds = table.copy(minetest.registered_items["default:sign_wall_steel"].sounds)
signs_lib.default_text_scale = {x=10, y=10} signs_lib.default_text_scale = {x=10, y=10}
@ -166,23 +160,12 @@ local ctexcache_wide = {}
-- entity handling -- entity handling
minetest.register_entity("signs_lib:text", { minetest.register_entity("signs_lib:text", {
initial_properties = { collisionbox = { 0, 0, 0, 0, 0, 0 },
collisionbox = { 0, 0, 0, 0, 0, 0 }, visual = "mesh",
visual = "mesh", mesh = "signs_lib_standard_sign_entity_wall.obj",
mesh = "signs_lib_standard_sign_entity_wall.obj", textures = {},
textures = {}, static_save = true,
static_save = true, backface_culling = false
backface_culling = false,
},
on_activate = function(self)
local node = minetest.get_node(self.object:get_pos())
if minetest.get_item_group(node.name, "sign") == 0 then
self.object:remove()
end
end,
on_blast = function(self, damage)
return false, false, {}
end,
}) })
function signs_lib.delete_objects(pos) function signs_lib.delete_objects(pos)
@ -197,7 +180,7 @@ function signs_lib.delete_objects(pos)
end end
end end
function signs_lib.spawn_entity(pos, texture, glow) function signs_lib.spawn_entity(pos, texture)
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
local def = minetest.registered_items[node.name] local def = minetest.registered_items[node.name]
if not def or not def.entity_info then return end if not def or not def.entity_info then return end
@ -246,10 +229,6 @@ function signs_lib.spawn_entity(pos, texture, glow)
end end
end end
if glow ~= "" then
obj:set_properties( {glow = tonumber(glow * 5)} )
end
if yaw then if yaw then
obj:set_rotation({x = pitch, y = yaw, z=0}) obj:set_rotation({x = pitch, y = yaw, z=0})
@ -268,14 +247,14 @@ function signs_lib.spawn_entity(pos, texture, glow)
end end
end end
function signs_lib.set_obj_text(pos, text, glow) function signs_lib.set_obj_text(pos, text)
local split = signs_lib.split_lines_and_words local split = signs_lib.split_lines_and_words
local text_ansi = signs_lib.Utf8ToAnsi(text) local text_ansi = Utf8ToAnsi(text)
local n = minetest.registered_nodes[minetest.get_node(pos).name]
signs_lib.delete_objects(pos) signs_lib.delete_objects(pos)
-- only create sign entity for actual text -- only create sign entity for actual text
if text_ansi and text_ansi ~= "" then if text_ansi and text_ansi ~= "" then
signs_lib.spawn_entity(pos, signs_lib.spawn_entity(pos, signs_lib.make_sign_texture(split(text_ansi), pos) )
signs_lib.make_sign_texture(split(text_ansi), pos), glow)
end end
end end
@ -356,7 +335,6 @@ local TP = signs_lib.path .. "/textures"
-- Font file formatter -- Font file formatter
local CHAR_FILE = "%s_%02x.png" local CHAR_FILE = "%s_%02x.png"
local CHAR_FILE_WIDE = "%s_%s.png" local CHAR_FILE_WIDE = "%s_%s.png"
local UNIFONT_TEX = "signs_lib_uni%02x.png\\^[sheet\\:16x16\\:%d,%d"
-- Fonts path -- Fonts path
local CHAR_PATH = TP .. "/" .. CHAR_FILE local CHAR_PATH = TP .. "/" .. CHAR_FILE
local CHAR_PATH_WIDE = TP .. "/" .. CHAR_FILE_WIDE local CHAR_PATH_WIDE = TP .. "/" .. CHAR_FILE_WIDE
@ -450,18 +428,20 @@ local function build_char_db(font_size)
return cw, cbw, cbh, (total_width / char_count), cw_wide return cw, cbw, cbh, (total_width / char_count), cw_wide
end end
signs_lib.charwidth16, signs_lib.charwidth15,
signs_lib.colorbgw16, signs_lib.colorbgw15,
signs_lib.lineheight16, signs_lib.lineheight15,
signs_lib.avgwidth16, signs_lib.avgwidth15,
signs_lib.charwidth_wide16 = build_char_db(16) signs_lib.charwidth_wide15 = build_char_db(15)
signs_lib.charwidth32, signs_lib.charwidth31,
signs_lib.colorbgw32, signs_lib.colorbgw31,
signs_lib.lineheight32, signs_lib.lineheight31,
signs_lib.avgwidth32, signs_lib.avgwidth31,
signs_lib.charwidth_wide32 = build_char_db(32) signs_lib.charwidth_wide31 = build_char_db(31)
local sign_groups = {choppy=2, dig_immediate=2}
local fences_with_sign = { }
-- some local helper functions -- some local helper functions
@ -470,8 +450,8 @@ local math_max = math.max
local function fill_line(x, y, w, c, font_size, colorbgw) local function fill_line(x, y, w, c, font_size, colorbgw)
c = c or "0" c = c or "0"
local tex = { } local tex = { }
for xx = x, w, colorbgw do for xx = 0, math.max(0, w), colorbgw do
table.insert(tex, (":%d,%d=signs_lib_color_"..font_size.."px_%s.png"):format(xx, y, c)) table.insert(tex, (":%d,%d=signs_lib_color_"..font_size.."px_%s.png"):format(x + xx, y, c))
end end
return table.concat(tex) return table.concat(tex)
end end
@ -483,8 +463,7 @@ local function char_tex(font_name, ch)
return ctexcache[font_name..ch], true return ctexcache[font_name..ch], true
else else
local c = ch:byte() local c = ch:byte()
local exists = file_exists(CHAR_PATH:format(font_name, c)) local exists, tex = file_exists(CHAR_PATH:format(font_name, c))
local tex
if exists and c ~= 14 then if exists and c ~= 14 then
tex = CHAR_FILE:format(font_name, c) tex = CHAR_FILE:format(font_name, c)
else else
@ -499,8 +478,7 @@ local function char_tex_wide(font_name, ch)
if ctexcache_wide[font_name..ch] then if ctexcache_wide[font_name..ch] then
return ctexcache_wide[font_name..ch], true return ctexcache_wide[font_name..ch], true
else else
local exists = file_exists(CHAR_PATH_WIDE:format(font_name, ch)) local exists, tex = file_exists(CHAR_PATH_WIDE:format(font_name, ch))
local tex
if exists then if exists then
tex = CHAR_FILE_WIDE:format(font_name, ch) tex = CHAR_FILE_WIDE:format(font_name, ch)
else else
@ -511,7 +489,7 @@ local function char_tex_wide(font_name, ch)
end end
end end
local function make_line_texture(line, lineno, pos, line_width, line_height, cwidth_tab, font_size, colorbgw, cwidth_tab_wide, force_unicode_font) local function make_line_texture(line, lineno, pos, line_width, line_height, cwidth_tab, font_size, colorbgw, cwidth_tab_wide)
local width = 0 local width = 0
local maxw = 0 local maxw = 0
local font_name = "signs_lib_font_"..font_size.."px" local font_name = "signs_lib_font_"..font_size.."px"
@ -527,97 +505,79 @@ local function make_line_texture(line, lineno, pos, line_width, line_height, cwi
for word_i, word in ipairs(line) do for word_i, word in ipairs(line) do
local chars = { } local chars = { }
local ch_offs = 0 local ch_offs = 0
word = string.gsub(word, "%^[12345678abcdefgh]", {
["^1"] = string.char(0x81),
["^2"] = string.char(0x82),
["^3"] = string.char(0x83),
["^4"] = string.char(0x84),
["^5"] = string.char(0x85),
["^6"] = string.char(0x86),
["^7"] = string.char(0x87),
["^8"] = string.char(0x88),
["^a"] = string.char(0x8a),
["^b"] = string.char(0x8b),
["^c"] = string.char(0x8c),
["^d"] = string.char(0x8d),
["^e"] = string.char(0x8e),
["^f"] = string.char(0x8f),
["^g"] = string.char(0x90),
["^h"] = string.char(0x91)
})
local word_l = #word local word_l = #word
local i = 1 local i = 1
local escape = 0
while i <= word_l do while i <= word_l do
local wide_type, wide_c = string.match(word:sub(i), "^&#([xu])(%x+);") local wide_c
local c = word:sub(i, i) if "&#x" == word:sub(i, i + 2) then
local c2 = word:sub(i+1, i+1) local j = i + 3
local collected = ""
if escape > 0 then escape = escape - 1 end while j <= word_l do
if c == "^" and escape == 0 and c2:find("[1-8a-h]") then local c = word:sub(j, j)
c = string.char(tonumber(c2,18)+0x80) if c == ";" then
i = i + 1 wide_c = collected
end break
elseif c < "0" then
local wide_skip = 0 break
if force_unicode_font then elseif "f" < c then
if wide_c then break
wide_skip = #wide_c + 3 elseif ("9" < c) and (c < "a") then
wide_type = "u" break
elseif c:byte() < 0x80 or c:byte() >= 0xa0 then
wide_type = "u"
local uchar = signs_lib.AnsiToUtf8(c)
local code
if #uchar == 1 then
code = uchar:byte()
else else
code = uchar:byte() % (2 ^ (7 - #uchar)) collected = collected .. c
for j = 1, #uchar do j = j + 1
code = code * (2 ^ 6) + uchar:byte(j) - 0x80
end
end end
wide_c = string.format("%04x", code)
end end
elseif wide_c then
wide_skip = #wide_c + 3
end end
local c = word:sub(i, i)
if c == "#" and escape == 0 and c2:find("[0-9A-Fa-f#^]") then if c == "#" then
if c2 == "#" or c2 == "^" then local cc = tonumber(word:sub(i+1, i+1), 16)
escape = 2 if cc then
else
i = i + 1 i = i + 1
cur_color = tonumber(c2, 16) cur_color = cc
end end
elseif wide_c then elseif wide_c then
local w, code local w = cwidth_tab_wide[wide_c]
if wide_type == "x" then
w = cwidth_tab_wide[wide_c]
elseif wide_type == "u" and #wide_c <= 4 then
w = font_size
code = tonumber(wide_c, 16)
if signs_lib.unifont_halfwidth[code] then
w = math.floor(w / 2)
end
end
if w then if w then
width = width + w width = width + w + 1
if width > line_width then if width >= (line_width - cwidth_tab[" "]) then
width = 0 width = 0
else else
maxw = math_max(width, maxw) maxw = math_max(width, maxw)
end end
if #chars < MAX_INPUT_CHARS then if #chars < MAX_INPUT_CHARS then
local tex
if wide_type == "u" then
local page = math.floor(code / 256)
local idx = code % 256
local x = idx % 16
local y = math.floor(idx / 16)
tex = UNIFONT_TEX:format(page, x, y)
if font_size == 32 then
tex = tex .. "\\^[resize\\:32x32"
end
else
tex = char_tex_wide(font_name, wide_c)
end
table.insert(chars, { table.insert(chars, {
off = ch_offs, off = ch_offs,
tex = tex, tex = char_tex_wide(font_name, wide_c),
col = ("%X"):format(cur_color), col = ("%X"):format(cur_color),
w = w,
}) })
end end
ch_offs = ch_offs + w ch_offs = ch_offs + w
end end
i = i + wide_skip i = i + #wide_c + 3
else else
local w = cwidth_tab[c] local w = cwidth_tab[c]
if w then if w then
width = width + w width = width + w + 1
if width > line_width then if width >= (line_width - cwidth_tab[" "]) then
width = 0 width = 0
else else
maxw = math_max(width, maxw) maxw = math_max(width, maxw)
@ -627,7 +587,6 @@ local function make_line_texture(line, lineno, pos, line_width, line_height, cwi
off = ch_offs, off = ch_offs,
tex = char_tex(font_name, c), tex = char_tex(font_name, c),
col = ("%X"):format(cur_color), col = ("%X"):format(cur_color),
w = w,
}) })
end end
ch_offs = ch_offs + w ch_offs = ch_offs + w
@ -635,7 +594,7 @@ local function make_line_texture(line, lineno, pos, line_width, line_height, cwi
end end
i = i + 1 i = i + 1
end end
width = width + cwidth_tab[" "] width = width + cwidth_tab[" "] + 1
maxw = math_max(width, maxw) maxw = math_max(width, maxw)
table.insert(words, { chars=chars, w=ch_offs }) table.insert(words, { chars=chars, w=ch_offs })
end end
@ -644,8 +603,7 @@ local function make_line_texture(line, lineno, pos, line_width, line_height, cwi
local texture = { } local texture = { }
local start_xpos = math.max(0, math.floor((line_width - maxw) / 2)) + def.x_offset local start_xpos = math.floor((line_width - maxw) / 2) + def.x_offset
local end_xpos = math.min(start_xpos + maxw, line_width)
local xpos = start_xpos local xpos = start_xpos
local ypos = (line_height + def.line_spacing)* lineno + def.y_offset local ypos = (line_height + def.line_spacing)* lineno + def.y_offset
@ -654,33 +612,31 @@ local function make_line_texture(line, lineno, pos, line_width, line_height, cwi
for word_i, word in ipairs(words) do for word_i, word in ipairs(words) do
local xoffs = (xpos - start_xpos) local xoffs = (xpos - start_xpos)
if (xoffs > 0) and ((xoffs + word.w) > end_xpos) then if (xoffs > 0) and ((xoffs + word.w) > maxw) then
table.insert(texture, fill_line(xpos, ypos, end_xpos, "n", font_size, colorbgw)) table.insert(texture, fill_line(xpos, ypos, maxw, "n", font_size, colorbgw))
xpos = start_xpos xpos = start_xpos
ypos = ypos + line_height + def.line_spacing ypos = ypos + line_height + def.line_spacing
lineno = lineno + 1 lineno = lineno + 1
if lineno >= def.number_of_lines then break end if lineno >= def.number_of_lines then break end
table.insert(texture, fill_line(xpos, ypos, end_xpos, cur_color, font_size, colorbgw)) table.insert(texture, fill_line(xpos, ypos, maxw, cur_color, font_size, colorbgw))
end end
for ch_i, ch in ipairs(word.chars) do for ch_i, ch in ipairs(word.chars) do
if xpos + ch.off + ch.w > end_xpos then
table.insert(texture, fill_line(xpos + ch.off, ypos, end_xpos, "n", font_size, colorbgw))
break
end
if ch.col ~= cur_color then if ch.col ~= cur_color then
cur_color = ch.col cur_color = ch.col
table.insert(texture, fill_line(xpos + ch.off, ypos, end_xpos, cur_color, font_size, colorbgw)) table.insert(texture, fill_line(xpos + ch.off, ypos, maxw, cur_color, font_size, colorbgw))
end end
table.insert(texture, (":%d,%d=%s"):format(xpos + ch.off, ypos, ch.tex)) table.insert(texture, (":%d,%d=%s"):format(xpos + ch.off, ypos, ch.tex))
end end
xpos = xpos + word.w table.insert(
if xpos < end_xpos then texture,
table.insert(texture, (":%d,%d="):format(xpos, ypos) .. char_tex(font_name, " ")) (":%d,%d="):format(xpos + word.w, ypos) .. char_tex(font_name, " ")
xpos = xpos + cwidth_tab[" "] )
end xpos = xpos + word.w + cwidth_tab[" "]
if xpos >= (line_width + cwidth_tab[" "]) then break end
end end
table.insert(texture, fill_line(xpos, ypos, end_xpos, "n", font_size, colorbgw)) table.insert(texture, fill_line(xpos, ypos, maxw, "n", font_size, colorbgw))
table.insert(texture, fill_line(start_xpos, ypos + line_height, maxw, "n", font_size, colorbgw))
return table.concat(texture), lineno return table.concat(texture), lineno
end end
@ -698,23 +654,26 @@ function signs_lib.make_sign_texture(lines, pos)
local char_width local char_width
local char_width_wide local char_width_wide
local colorbgw local colorbgw
local widemult = meta:get_int("widefont") == 1 and 0.5 or 1 local widemult = 1
local force_unicode_font = meta:get_int("unifont") == 1
if def.font_size and (def.font_size == 32 or def.font_size == 31) then if meta:get_int("widefont") == 1 then
font_size = 32 widemult = 0.5
line_width = math.floor(signs_lib.avgwidth32 * def.chars_per_line) * (def.horiz_scaling * widemult) end
line_height = signs_lib.lineheight32
char_width = signs_lib.charwidth32 if def.font_size and def.font_size == 31 then
char_width_wide = signs_lib.charwidth_wide32 font_size = 31
colorbgw = signs_lib.colorbgw32 line_width = math.floor(signs_lib.avgwidth31 * def.chars_per_line) * (def.horiz_scaling * widemult)
line_height = signs_lib.lineheight31
char_width = signs_lib.charwidth31
char_width_wide = signs_lib.charwidth_wide31
colorbgw = signs_lib.colorbgw31
else else
font_size = 16 font_size = 15
line_width = math.floor(signs_lib.avgwidth16 * def.chars_per_line) * (def.horiz_scaling * widemult) line_width = math.floor(signs_lib.avgwidth15 * def.chars_per_line) * (def.horiz_scaling * widemult)
line_height = signs_lib.lineheight16 line_height = signs_lib.lineheight15
char_width = signs_lib.charwidth16 char_width = signs_lib.charwidth15
char_width_wide = signs_lib.charwidth_wide16 char_width_wide = signs_lib.charwidth_wide15
colorbgw = signs_lib.colorbgw16 colorbgw = signs_lib.colorbgw15
end end
local texture = { ("[combine:%dx%d"):format(line_width, (line_height + def.line_spacing) * def.number_of_lines * def.vert_scaling) } local texture = { ("[combine:%dx%d"):format(line_width, (line_height + def.line_spacing) * def.number_of_lines * def.vert_scaling) }
@ -722,7 +681,7 @@ function signs_lib.make_sign_texture(lines, pos)
local lineno = 0 local lineno = 0
for i = 1, #lines do for i = 1, #lines do
if lineno >= def.number_of_lines then break end if lineno >= def.number_of_lines then break end
local linetex, ln = make_line_texture(lines[i], lineno, pos, line_width, line_height, char_width, font_size, colorbgw, char_width_wide, force_unicode_font) local linetex, ln = make_line_texture(lines[i], lineno, pos, line_width, line_height, char_width, font_size, colorbgw, char_width_wide)
table.insert(texture, linetex) table.insert(texture, linetex)
lineno = ln + 1 lineno = ln + 1
end end
@ -741,68 +700,26 @@ end
function signs_lib.rightclick_sign(pos, node, player, itemstack, pointed_thing) function signs_lib.rightclick_sign(pos, node, player, itemstack, pointed_thing)
if not player or not signs_lib.can_modify(pos, player) then return end if not signs_lib.can_modify(pos, player) then return end
if not player.get_meta then return end
player:get_meta():set_string("signslib:pos", minetest.pos_to_string(pos)) player:get_meta():set_string("signslib:pos", minetest.pos_to_string(pos))
minetest.show_formspec(player:get_player_name(), "signs_lib:sign", get_sign_formspec(pos, node.name)) minetest.show_formspec(player:get_player_name(), "signs_lib:sign", get_sign_formspec(pos, node.name))
end end
function signs_lib.destruct_sign(pos) function signs_lib.destruct_sign(pos)
local meta = minetest.get_meta(pos)
local glow = meta:get_string("glow")
if glow ~= "" and not minetest.is_creative_enabled("") then
local num = tonumber(glow)
minetest.add_item(pos, ItemStack(signs_lib.glow_item .. " " .. num))
end
signs_lib.delete_objects(pos) signs_lib.delete_objects(pos)
end end
function signs_lib.blast_sign(pos, intensity)
if signs_lib.can_modify(pos, "") then
local node = minetest.get_node(pos)
local drops = minetest.get_node_drops(node, "tnt:blast")
minetest.remove_node(pos)
return drops
end
end
local function make_infotext(text) local function make_infotext(text)
text = trim_input(text) text = trim_input(text)
local lines = signs_lib.split_lines_and_words(text) or {} local lines = signs_lib.split_lines_and_words(text) or {}
local lines2 = { } local lines2 = { }
for _, line in ipairs(lines) do for _, line in ipairs(lines) do
table.insert(lines2, (table.concat(line, " "):gsub("#[0-9a-fA-F#^]", function (s) table.insert(lines2, (table.concat(line, " "):gsub("#[0-9a-fA-F]", ""):gsub("##", "#")))
return s:sub(2):find("[#^]") and s:sub(2) or ""
end)))
end end
return table.concat(lines2, "\n") return table.concat(lines2, "\n")
end end
function signs_lib.glow(pos, node, puncher)
local name = puncher:get_player_name()
if minetest.is_protected(pos, name) then
return
end
local tool = puncher:get_wielded_item()
if tool:get_name() == signs_lib.glow_item then
local meta = minetest.get_meta(pos)
local glow = tonumber(meta:get_string("glow"))
if not glow then
glow = 1
elseif glow < 3 then
glow = glow + 1
else
return -- already at brightest level
end
if not minetest.is_creative_enabled(name) then
tool:take_item()
puncher:set_wielded_item(tool)
end
meta:set_string("glow", glow)
end
end
function signs_lib.update_sign(pos, fields) function signs_lib.update_sign(pos, fields)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
@ -818,29 +735,15 @@ function signs_lib.update_sign(pos, fields)
local ownstr = "" local ownstr = ""
if owner ~= "" then ownstr = S("Locked sign, owned by @1\n", owner) end if owner ~= "" then ownstr = S("Locked sign, owned by @1\n", owner) end
-- Fix pasting from Windows: CR instead of LF
text = string.gsub(text, "\r\n?", "\n")
meta:set_string("text", text) meta:set_string("text", text)
meta:set_string("infotext", ownstr..make_infotext(text).." ") meta:set_string("infotext", ownstr..make_infotext(text).." ")
signs_lib.set_obj_text(pos, text)
local glow = meta:get_string("glow")
signs_lib.set_obj_text(pos, text, glow)
end end
function signs_lib.can_modify(pos, player) function signs_lib.can_modify(pos, player)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local owner = meta:get_string("owner") local owner = meta:get_string("owner")
local playername local playername = player:get_player_name()
if type(player) == "userdata" then
playername = player:get_player_name()
elseif type(player) == "string" then
playername = player
else
playername = ""
end
if minetest.is_protected(pos, playername) then if minetest.is_protected(pos, playername) then
minetest.record_protection_violation(pos, playername) minetest.record_protection_violation(pos, playername)
@ -849,7 +752,7 @@ function signs_lib.can_modify(pos, player)
if owner == "" if owner == ""
or playername == owner or playername == owner
or minetest.get_player_privs(playername)[signs_lib.edit_priv] or (minetest.check_player_privs(playername, {signslib_edit=true}))
or (playername == minetest.settings:get("name")) then or (playername == minetest.settings:get("name")) then
return true return true
end end
@ -946,16 +849,14 @@ function signs_lib.after_place_node(pos, placer, itemstack, pointed_thing, locke
local controls = placer:get_player_control() local controls = placer:get_player_control()
local signname = itemstack:get_name() local signname = itemstack:get_name()
-- in case player has sign nodes they shouldn't, remove extensions for normal sign
local no_wall_name = string.gsub(signname, "_wall", "") local no_wall_name = string.gsub(signname, "_wall", "")
no_wall_name = string.gsub(no_wall_name, "_yard", "")
no_wall_name = string.gsub(no_wall_name, "_hanging", "")
no_wall_name = string.gsub(no_wall_name, "_onpole_horiz", "")
no_wall_name = string.gsub(no_wall_name, "_onpole", "")
local def = minetest.registered_items[signname] local def = minetest.registered_items[signname]
local ppos = minetest.get_pointed_thing_position(pointed_thing)
local pnode = minetest.get_node(ppos)
local pdef = minetest.registered_items[pnode.name]
if def.allow_onpole and signs_lib.check_for_pole(pos, pointed_thing) and not controls.sneak then if def.allow_onpole and signs_lib.check_for_pole(pos, pointed_thing) and not controls.sneak then
local newparam2 local newparam2
local lookdir = minetest.yaw_to_dir(placer:get_look_horizontal()) local lookdir = minetest.yaw_to_dir(placer:get_look_horizontal())
@ -964,6 +865,7 @@ function signs_lib.after_place_node(pos, placer, itemstack, pointed_thing, locke
else else
newparam2 = minetest.dir_to_facedir(lookdir) newparam2 = minetest.dir_to_facedir(lookdir)
end end
local node = minetest.get_node(pos)
minetest.swap_node(pos, {name = no_wall_name.."_onpole", param2 = newparam2}) minetest.swap_node(pos, {name = no_wall_name.."_onpole", param2 = newparam2})
elseif def.allow_onpole_horizontal and signs_lib.check_for_horizontal_pole(pos, pointed_thing) and not controls.sneak then elseif def.allow_onpole_horizontal and signs_lib.check_for_horizontal_pole(pos, pointed_thing) and not controls.sneak then
local newparam2 local newparam2
@ -973,12 +875,15 @@ function signs_lib.after_place_node(pos, placer, itemstack, pointed_thing, locke
else else
newparam2 = minetest.dir_to_facedir(lookdir) newparam2 = minetest.dir_to_facedir(lookdir)
end end
local node = minetest.get_node(pos)
minetest.swap_node(pos, {name = no_wall_name.."_onpole_horiz", param2 = newparam2}) minetest.swap_node(pos, {name = no_wall_name.."_onpole_horiz", param2 = newparam2})
elseif def.allow_hanging and signs_lib.check_for_ceiling(pointed_thing) and not controls.sneak then elseif def.allow_hanging and signs_lib.check_for_ceiling(pointed_thing) and not controls.sneak then
local newparam2 = minetest.dir_to_facedir(placer:get_look_dir()) local newparam2 = minetest.dir_to_facedir(placer:get_look_dir())
local node = minetest.get_node(pos)
minetest.swap_node(pos, {name = no_wall_name.."_hanging", param2 = newparam2}) minetest.swap_node(pos, {name = no_wall_name.."_hanging", param2 = newparam2})
elseif def.allow_yard and signs_lib.check_for_floor(pointed_thing) and not controls.sneak then elseif def.allow_yard and signs_lib.check_for_floor(pointed_thing) and not controls.sneak then
local newparam2 = minetest.dir_to_facedir(placer:get_look_dir()) local newparam2 = minetest.dir_to_facedir(placer:get_look_dir())
local node = minetest.get_node(pos)
minetest.swap_node(pos, {name = no_wall_name.."_yard", param2 = newparam2}) minetest.swap_node(pos, {name = no_wall_name.."_yard", param2 = newparam2})
elseif def.paramtype2 == "facedir" and signs_lib.check_for_ceiling(pointed_thing) then elseif def.paramtype2 == "facedir" and signs_lib.check_for_ceiling(pointed_thing) then
minetest.swap_node(pos, {name = signname, param2 = 6}) minetest.swap_node(pos, {name = signname, param2 = 6})
@ -994,29 +899,11 @@ function signs_lib.after_place_node(pos, placer, itemstack, pointed_thing, locke
end end
function signs_lib.register_fence_with_sign() function signs_lib.register_fence_with_sign()
log("warning", "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
local use_glow = function(pos, node, puncher, pointed_thing)
if puncher then -- if e.g. a machine tries to punch; only a real person should change the lighting
signs_lib.glow(pos, node, puncher)
end
return signs_lib.update_sign(pos)
end
local glow_drops = function(pos, oldnode, oldmetadata, digger)
if digger and minetest.is_creative_enabled(digger:get_player_name()) then
return
end
local glow = oldmetadata and oldmetadata.fields and oldmetadata.fields.glow
if glow then
minetest.add_item(pos, ItemStack(signs_lib.glow_item .. " " .. glow))
end
end end
function signs_lib.register_sign(name, raw_def) function signs_lib.register_sign(name, raw_def)
local def = table.copy(raw_def) local def = table.copy(raw_def)
def.is_ground_content = false
if raw_def.entity_info == "standard" then if raw_def.entity_info == "standard" then
def.entity_info = { def.entity_info = {
@ -1028,19 +915,11 @@ function signs_lib.register_sign(name, raw_def)
end end
def.after_place_node = raw_def.after_place_node or signs_lib.after_place_node def.after_place_node = raw_def.after_place_node or signs_lib.after_place_node
def.on_blast = raw_def.on_blast or signs_lib.blast_sign
if raw_def.entity_info then if raw_def.entity_info then
if def.allow_glow ~= false then
def.on_punch = raw_def.on_punch or use_glow
def.after_dig_node = raw_def.after_dig_node or glow_drops
else
def.on_punch = raw_def.on_punch or signs_lib.update_sign
end
def.on_rightclick = raw_def.on_rightclick or signs_lib.rightclick_sign def.on_rightclick = raw_def.on_rightclick or signs_lib.rightclick_sign
def.on_destruct = raw_def.on_destruct or signs_lib.destruct_sign def.on_destruct = raw_def.on_destruct or signs_lib.destruct_sign
def.on_punch = raw_def.on_punch or signs_lib.update_sign
def.number_of_lines = raw_def.number_of_lines or signs_lib.standard_lines def.number_of_lines = raw_def.number_of_lines or signs_lib.standard_lines
def.horiz_scaling = raw_def.horiz_scaling or signs_lib.standard_hscale def.horiz_scaling = raw_def.horiz_scaling or signs_lib.standard_hscale
def.vert_scaling = raw_def.vert_scaling or signs_lib.standard_vscale def.vert_scaling = raw_def.vert_scaling or signs_lib.standard_vscale
@ -1072,9 +951,6 @@ function signs_lib.register_sign(name, raw_def)
def.groups = signs_lib.standard_wood_groups def.groups = signs_lib.standard_wood_groups
end end
-- force all signs into the sign group
def.groups.sign = def.groups.sign or 1
local cbox = signs_lib.make_selection_boxes(35, 25) local cbox = signs_lib.make_selection_boxes(35, 25)
def.selection_box = raw_def.selection_box or cbox def.selection_box = raw_def.selection_box or cbox
@ -1285,7 +1161,7 @@ minetest.register_lbm({
run_at_every_load = true, run_at_every_load = true,
action = function(pos, node) action = function(pos, node)
-- yeah, yeah... I know I'm hashing a block pos, but it's still just a set of coords -- yeah, yeah... I know I'm hashing a block pos, but it's still just a set of coords
local hash = minetest.hash_node_position(vector.floor(vector.divide(pos, minetest.MAP_BLOCKSIZE))) local hash = minetest.hash_node_position(vector.floor(vector.divide(pos, core.MAP_BLOCKSIZE)))
if not signs_lib.block_list[hash] then if not signs_lib.block_list[hash] then
signs_lib.block_list[hash] = true signs_lib.block_list[hash] = true
signs_lib.totalblocks = signs_lib.totalblocks + 1 signs_lib.totalblocks = signs_lib.totalblocks + 1
@ -1296,15 +1172,15 @@ minetest.register_lbm({
minetest.register_chatcommand("regen_signs", { minetest.register_chatcommand("regen_signs", {
params = "", params = "",
privs = {server = true}, privs = {server = true},
description = S("Skims through all currently-loaded sign-bearing mapblocks, clears away any entities within each sign's node space, and regenerates their text entities, if any."), description = "Skims through all currently-loaded sign-bearing mapblocks, clears away any entities within each sign's node space, and regenerates their text entities, if any.",
func = function(player_name, params) func = function(player_name, params)
local allsigns = {} local allsigns = {}
local totalsigns = 0 local totalsigns = 0
for b in pairs(signs_lib.block_list) do for b in pairs(signs_lib.block_list) do
local blockpos = minetest.get_position_from_hash(b) local blockpos = minetest.get_position_from_hash(b)
local pos1 = vector.multiply(blockpos, minetest.MAP_BLOCKSIZE) local pos1 = vector.multiply(blockpos, core.MAP_BLOCKSIZE)
local pos2 = vector.add(pos1, minetest.MAP_BLOCKSIZE - 1) local pos2 = vector.add(pos1, core.MAP_BLOCKSIZE - 1)
if minetest.get_node_or_nil(vector.add(pos1, minetest.MAP_BLOCKSIZE/2)) then if minetest.get_node_or_nil(vector.add(pos1, core.MAP_BLOCKSIZE/2)) then
local signs_in_block = minetest.find_nodes_in_area(pos1, pos2, {"group:sign"}) local signs_in_block = minetest.find_nodes_in_area(pos1, pos2, {"group:sign"})
allsigns[#allsigns + 1] = signs_in_block allsigns[#allsigns + 1] = signs_in_block
totalsigns = totalsigns + #signs_in_block totalsigns = totalsigns + #signs_in_block
@ -1315,13 +1191,13 @@ minetest.register_chatcommand("regen_signs", {
end end
if signs_lib.totalblocks < 0 then signs_lib.totalblocks = 0 end if signs_lib.totalblocks < 0 then signs_lib.totalblocks = 0 end
if totalsigns == 0 then if totalsigns == 0 then
minetest.chat_send_player(player_name, S("There are no signs in the currently-loaded terrain.")) minetest.chat_send_player(player_name, "There are no signs in the currently-loaded terrain.")
signs_lib.block_list = {} signs_lib.block_list = {}
return return
end end
minetest.chat_send_player(player_name, S("Found a total of @1 sign nodes across @2 blocks.", totalsigns, signs_lib.totalblocks)) minetest.chat_send_player(player_name, "Found a total of "..totalsigns.." sign nodes across "..signs_lib.totalblocks.." blocks.")
minetest.chat_send_player(player_name, S("Regenerating sign entities ...")) minetest.chat_send_player(player_name, "Regenerating sign entities...")
for _, b in pairs(allsigns) do for _, b in pairs(allsigns) do
for _, pos in ipairs(b) do for _, pos in ipairs(b) do
@ -1333,15 +1209,11 @@ minetest.register_chatcommand("regen_signs", {
end end
end end
end end
minetest.chat_send_player(player_name, S("Finished.")) minetest.chat_send_player(player_name, "Finished.")
end end
}) })
minetest.register_on_mods_loaded(function() minetest.register_privilege("signslib_edit", {})
if not minetest.registered_privileges[signs_lib.edit_priv] then
minetest.register_privilege("signslib_edit", {})
end
end)
@ -1353,23 +1225,19 @@ function get_sign_formspec(pos, nodename)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local txt = meta:get_string("text") local txt = meta:get_string("text")
local state = meta:get_int("unifont") == 1 and "on" or "off"
local formspec = { local formspec = {
"size[6,4]", "size[6,4]",
"background[-0.5,-0.5;7,5;signs_lib_sign_bg.png]", "textarea[0,-0.3;6.5,3;text;;" .. minetest.formspec_escape(txt) .. "]",
"image[0.1,2.4;7,1;signs_lib_sign_color_palette.png]", "background[-0.5,-0.5;7,5;signs_lib_sign_bg.jpg]",
"textarea[0.15,-0.2;6.3,2.8;text;;" .. minetest.formspec_escape(txt) .. "]", "button_exit[2,3.4;2,1;ok;" .. S("Write") .. "]"
"button_exit[3.7,3.4;2,1;ok;" .. S("Write") .. "]",
"label[0.3,3.4;"..FS("Unicode font").."]",
"image_button[0.6,3.7;1,0.6;signs_lib_switch_" .. state .. ".png;uni_"
.. state .. ";;;false;signs_lib_switch_interm.png]",
} }
if minetest.registered_nodes[nodename].allow_widefont then if minetest.registered_nodes[nodename].allow_widefont then
state = meta:get_int("widefont") == 1 and "on" or "off" local state = "off"
formspec[#formspec+1] = "label[2.1,3.4;"..FS("Wide font").."]" if meta:get_int("widefont") == 1 then state = "on" end
formspec[#formspec+1] = "image_button[2.3,3.7;1,0.6;signs_lib_switch_" .. state .. ".png;wide_" formspec[5] = "label[0.5,3.4;Use wide font]"
formspec[6] = "image_button[0.6,3.7;1,0.6;signs_lib_switch_" .. state .. ".png;"
.. state .. ";;;false;signs_lib_switch_interm.png]" .. state .. ";;;false;signs_lib_switch_interm.png]"
end end
@ -1386,48 +1254,31 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
local playername = player:get_player_name() local playername = player:get_player_name()
if fields.text and fields.ok then if fields.text and fields.ok then
log("action", "%s wrote %q to sign at %s", minetest.log("action", S("@1 wrote \"@2\" to sign at @3",
(playername or ""), (playername or ""),
fields.text:gsub("\n", "\\n"), fields.text:gsub('\\', '\\\\'):gsub("\n", "\\n"),
pos_string pos_string
) ))
signs_lib.update_sign(pos, fields) signs_lib.update_sign(pos, fields)
elseif fields.wide_on or fields.wide_off or fields.uni_on or fields.uni_off then elseif fields.on or fields.off then
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local change_wide local change
local change_uni
if fields.wide_on and meta:get_int("widefont") == 1 then if fields.on and meta:get_int("widefont") == 1 then
meta:set_int("widefont", 0) meta:set_int("widefont", 0)
change_wide = true change = true
elseif fields.wide_off and meta:get_int("widefont") == 0 then elseif fields.off and meta:get_int("widefont") == 0 then
meta:set_int("widefont", 1) meta:set_int("widefont", 1)
change_wide = true change = true
end
if fields.uni_on and meta:get_int("unifont") == 1 then
meta:set_int("unifont", 0)
change_uni = true
elseif fields.uni_off and meta:get_int("unifont") == 0 then
meta:set_int("unifont", 1)
change_uni = true
end end
if change_wide then if change then
log("action", "%s flipped the wide-font switch to %q at %s", minetest.log("action", S("@1 flipped the wide-font switch to \"@2\" at @3",
(playername or ""), (playername or ""),
(fields.wide_on and "off" or "on"), (fields.on and "off" or "on"),
minetest.pos_to_string(pos) minetest.pos_to_string(pos)
) ))
signs_lib.update_sign(pos, fields)
minetest.show_formspec(playername, "signs_lib:sign", get_sign_formspec(pos, node.name))
end
if change_uni then
log("action", "%s flipped the unicode-font switch to %q at %s",
(playername or ""),
(fields.uni_on and "off" or "on"),
minetest.pos_to_string(pos)
)
signs_lib.update_sign(pos, fields) signs_lib.update_sign(pos, fields)
minetest.show_formspec(playername, "signs_lib:sign", get_sign_formspec(pos, node.name)) minetest.show_formspec(playername, "signs_lib:sign", get_sign_formspec(pos, node.name))
end end

View File

@ -1,17 +1,16 @@
if minetest.get_modpath("default") then
local default_fences = {
"default:fence_wood",
"default:fence_acacia_wood",
"default:fence_aspen_wood",
"default:fence_junglewood",
"default:fence_pine_wood"
}
for _, n in ipairs(default_fences) do local default_fences = {
minetest.override_item(n, { "default:fence_wood",
check_for_pole = true "default:fence_acacia_wood",
}) "default:fence_aspen_wood",
end "default:fence_junglewood",
"default:fence_pine_wood"
}
for _, n in ipairs(default_fences) do
minetest.override_item(n, {
check_for_pole = true
})
end end
if minetest.get_modpath("cottages") then if minetest.get_modpath("cottages") then

View File

@ -1,8 +1,5 @@
-- encoding borrowed from signs_lib fork at https://github.com/lord-server/lord -- encoding borrowed from signs_lib fork at https://github.com/lord-server/lord
-- The "ANSI" encoding here actually refers to "windows-1251", which shows up as
-- "ANSI" on Russian version of MS Windows
local ansi_decode = { local ansi_decode = {
[128] = "\208\130", [128] = "\208\130",
[129] = "\208\131", [129] = "\208\131",
@ -231,14 +228,13 @@ signs_lib.unicode_install({38,"26"})
dofile(signs_lib.path.."/nonascii-de.lua") dofile(signs_lib.path.."/nonascii-de.lua")
dofile(signs_lib.path.."/nonascii-fr.lua") dofile(signs_lib.path.."/nonascii-fr.lua")
dofile(signs_lib.path.."/nonascii-pl.lua") dofile(signs_lib.path.."/nonascii-pl.lua")
dofile(signs_lib.path.."/nonascii-ua.lua")
local nmdc = { local nmdc = {
[36] = "$", [36] = "$",
[124] = "|" [124] = "|"
} }
function signs_lib.AnsiToUtf8(s) function AnsiToUtf8(s)
local r, b = "" local r, b = ""
for i = 1, s and s:len() or 0 do for i = 1, s and s:len() or 0 do
b = s:byte(i) b = s:byte(i)
@ -259,14 +255,10 @@ function signs_lib.AnsiToUtf8(s)
return r return r
end end
function signs_lib.Utf8ToAnsi(s) function Utf8ToAnsi(s)
local r, b = "" local a, j, r, b, scope = 0, 0, ""
local scope
local j, l, u
for i = 1, s and s:len() or 0 do for i = 1, s and s:len() or 0 do
b = s:byte(i) b = s:byte(i)
-- legacy parser
if b == 0x26 then if b == 0x26 then
r = r .. "&#x26;" r = r .. "&#x26;"
elseif b < 128 then elseif b < 128 then
@ -279,57 +271,18 @@ function signs_lib.Utf8ToAnsi(s)
if scope[b] then if scope[b] then
scope = scope[b] scope = scope[b]
if "string" == type(scope) then if "string" == type(scope) then
r, scope = r .. scope, nil r, scope = r .. scope
j = -1 -- supress general UTF-8 parser
end end
else else
scope = nil r, scope = r .. "_"
end end
elseif utf8_decode[b] then elseif utf8_decode[b] then
scope = utf8_decode[b] scope = utf8_decode[b]
end
-- general UTF-8 parser
if j == -1 then -- supressed by legacy parser
j = nil
elseif b < 0x80 then
if j then
r = r .. "&#ufffd;"
j = nil
end
-- ASCII handled by legacy parser
elseif b >= 0xc0 then
if j then
r = r .. "&#ufffd;"
end
j = i
if b >= 0xf8 then
r = r .. "&#ufffd;"
j = nil
elseif b >= 0xf0 then
l, u = 4, b % (2 ^ 3)
elseif b >= 0xe0 then
l, u = 3, b % (2 ^ 4)
else
l, u = 2, b % (2 ^ 5)
end
else else
if j then r = r .. "_"
u = u * (2 ^ 6) + b % (2 ^ 6)
if i == j + l - 1 then
r = r .. string.format("&#u%x;", u)
j = nil
end
else
r = r .. "&#ufffd;"
end
end end
end end
if j then
r = r .. "&#ufffd;"
end
return r return r
end end
signs_lib.wide_character_codes = wide_character_codes signs_lib.wide_character_codes = wide_character_codes
signs_lib.unifont_halfwidth = dofile(signs_lib.path.."/unifont-halfwidth.lua")

View File

@ -7,9 +7,8 @@ signs_lib = {}
signs_lib.path = minetest.get_modpath(minetest.get_current_modname()) signs_lib.path = minetest.get_modpath(minetest.get_current_modname())
signs_lib.S = minetest.get_translator(minetest.get_current_modname()) local S, NS = dofile(signs_lib.path .. "/intllib.lua")
signs_lib.gettext = S
signs_lib.edit_priv = minetest.settings:get("signs_lib.edit_priv") or "signslib_edit"
dofile(signs_lib.path.."/encoding.lua") dofile(signs_lib.path.."/encoding.lua")
dofile(signs_lib.path.."/api.lua") dofile(signs_lib.path.."/api.lua")

45
intllib.lua Normal file
View File

@ -0,0 +1,45 @@
-- Fallback functions for when `intllib` is not installed.
-- Code released under Unlicense <http://unlicense.org>.
-- Get the latest version of this file at:
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
local function format(str, ...)
local args = { ... }
local function repl(escape, open, num, close)
if escape == "" then
local replacement = tostring(args[tonumber(num)])
if open == "" then
replacement = replacement..close
end
return replacement
else
return "@"..open..num..close
end
end
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
end
local gettext, ngettext
if minetest.get_modpath("intllib") then
if intllib.make_gettext_pair then
-- New method using gettext.
gettext, ngettext = intllib.make_gettext_pair()
else
-- Old method using text files.
gettext = intllib.Getter()
end
end
-- Fill in missing functions.
gettext = gettext or function(msgid, ...)
return format(msgid, ...)
end
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
return format(n==1 and msgid or msgid_plural, ...)
end
return gettext, ngettext

97
locale/de.po Normal file
View File

@ -0,0 +1,97 @@
# German Translation for the signs_lib mod.
# Copyright (C) 2018 Vanessa Ezekowitz
# This file is distributed under the same license as the signs_lib package.
# Xanthin, 2017.
# CodeXP <codexp@gmx.net>, 2018.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-31 18:31+0200\n"
"PO-Revision-Date: 2018-03-24 22:00+0100\n"
"Last-Translator: CodeXP <codexp@gmx.net>\n"
"Language-Team: \n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.12\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: init.lua
msgid "Write"
msgstr "schreiben"
#: init.lua
msgid "Locked sign, owned by @1\n"
msgstr "gesperrter Schild, gehört @1\n"
#: init.lua
msgid "locked "
msgstr "gesperrt "
#: init.lua
#, fuzzy
msgid "@1 wrote \"@2\" to @3sign at @4"
msgstr "@1 schrieb \"@2\" auf das @3Schild bei @4"
#: init.lua
msgid "Sign"
msgstr "Schild"
#: init.lua
msgid "Can edit all locked signs"
msgstr "Kann alle gesperrte Schilder bearbeiten"
#: init.lua
msgid "Locked Sign"
msgstr "gesperrter Schild"
#: init.lua
msgid "green"
msgstr "grün"
#: init.lua
msgid "yellow"
msgstr "gelb"
#: init.lua
msgid "red"
msgstr "rot"
#: init.lua
msgid "white_red"
msgstr "weißrot"
#: init.lua
msgid "white_black"
msgstr "schwarzweiß"
#: init.lua
msgid "orange"
msgstr "orange"
#: init.lua
msgid "blue"
msgstr "blau"
#: init.lua
msgid "brown"
msgstr "braun"
#: init.lua
msgid "Sign (@1, metal)"
msgstr "Schild (@1, Metall)"
#: init.lua
msgid "Attempt to register unknown node as fence"
msgstr "Versuch ein unbekanntes Element als Zaun zu registrieren"
#: init.lua
msgid "Registered @1 and @2"
msgstr "Registrierte @1 und @2"
#: init.lua
msgid "[MOD] signs loaded"
msgstr "[MOD] Schilder-Mod geladen"

95
locale/es.po Normal file
View File

@ -0,0 +1,95 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-31 18:22+0200\n"
"PO-Revision-Date: 2017-07-31 18:30+0200\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.12\n"
"Last-Translator: Carlos Barraza\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: es\n"
#: init.lua
msgid "Locked sign, owned by @1\n"
msgstr ""
#: init.lua
msgid "locked "
msgstr "bloqueada "
#: init.lua
msgid "@1 wrote \"@2\" to @3sign at @4"
msgstr "@1 escribio \"@2\" en el cartel @3en @4"
#: init.lua
msgid "Sign"
msgstr "Letrero"
#: init.lua
msgid "Can edit all locked signs"
msgstr ""
#: init.lua
#, fuzzy
msgid "Locked Sign"
msgstr "Letrero bloqueada"
#: init.lua
msgid "green"
msgstr "verde"
#: init.lua
msgid "yellow"
msgstr "amarillo"
#: init.lua
msgid "red"
msgstr "rojo"
#: init.lua
#, fuzzy
msgid "white_red"
msgstr "rojo y blanco"
#: init.lua
#, fuzzy
msgid "white_black"
msgstr "negro y blanco"
#: init.lua
msgid "orange"
msgstr "naranja"
#: init.lua
msgid "blue"
msgstr "azul"
#: init.lua
msgid "brown"
msgstr "marrón"
#: init.lua
#, fuzzy
msgid "Sign (@1, metal)"
msgstr "Letrero (@1, metal)"
#: init.lua
msgid "Attempt to register unknown node as fence"
msgstr ""
#: init.lua
msgid "Registered @1 and @2"
msgstr "Registrado @1 y @2"
#: init.lua
msgid "[MOD] signs loaded"
msgstr "[MOD] signs cargados"

91
locale/fr.po Normal file
View File

@ -0,0 +1,91 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-31 18:13+0200\n"
"PO-Revision-Date: 2017-07-31 18:22+0200\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.12\n"
"Last-Translator: fat115 <fat115@framasoft.org>\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"Language: fr\n"
#: init.lua
msgid "Locked sign, owned by @1\n"
msgstr "Panneau verrouillé, appartient à @1\n"
#: init.lua
msgid "locked "
msgstr "verrouillé "
#: init.lua
msgid "@1 wrote \"@2\" to @3sign at @4"
msgstr "@1 a écrit \"@2\" sur le panneau @3en @4"
#: init.lua
msgid "Sign"
msgstr "Panneau"
#: init.lua
msgid "Can edit all locked signs"
msgstr "Peut modifier les panneaux verrouillés"
#: init.lua
msgid "Locked Sign"
msgstr "Panneau (verrouillé)"
#: init.lua
msgid "green"
msgstr "vert"
#: init.lua
msgid "yellow"
msgstr "jaune"
#: init.lua
msgid "red"
msgstr "rouge"
#: init.lua
msgid "white_red"
msgstr "rouge et blanc"
#: init.lua
msgid "white_black"
msgstr "noir et blanc"
#: init.lua
msgid "orange"
msgstr "orange"
#: init.lua
msgid "blue"
msgstr "bleu"
#: init.lua
msgid "brown"
msgstr "marron"
#: init.lua
msgid "Sign (@1, metal)"
msgstr "Panneau (@1, métal)"
#: init.lua
msgid "Attempt to register unknown node as fence"
msgstr "Tentative d'enregistrer un nœud inconnu comme barrière"
#: init.lua
msgid "Registered @1 and @2"
msgstr "Enregistrement de @1 et @"
#: init.lua
msgid "[MOD] signs loaded"
msgstr "[MOD] signs chargé"

91
locale/ms.po Normal file
View File

@ -0,0 +1,91 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-31 18:00+0200\n"
"PO-Revision-Date: 2017-11-17 02:38+0800\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.4\n"
"Last-Translator: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"Language: ms\n"
#: init.lua
msgid "Locked sign, owned by @1\n"
msgstr "Papan tanda berkunci, milik @1\n"
#: init.lua
msgid "locked "
msgstr "berkunci "
#: init.lua
msgid "@1 wrote \"@2\" to @3sign at @4"
msgstr "@1 menulis \"@2\" atas papan tanda @3dekat @4"
#: init.lua
msgid "Sign"
msgstr "Papan Tanda"
#: init.lua
msgid "Can edit all locked signs"
msgstr "Boleh sunting semua papan tanda berkunci"
#: init.lua
msgid "Locked Sign"
msgstr "Papan Tanda Berkunci"
#: init.lua
msgid "green"
msgstr "hijau"
#: init.lua
msgid "yellow"
msgstr "kuning"
#: init.lua
msgid "red"
msgstr "merah"
#: init.lua
msgid "white_red"
msgstr "putih_merah"
#: init.lua
msgid "white_black"
msgstr "putih_hitam"
#: init.lua
msgid "orange"
msgstr "jingga"
#: init.lua
msgid "blue"
msgstr "biru"
#: init.lua
msgid "brown"
msgstr "perang"
#: init.lua
msgid "Sign (@1, metal)"
msgstr "Papan Tanda (@1, logam)"
#: init.lua
msgid "Attempt to register unknown node as fence"
msgstr "Cuba untuk mendaftar nod tidak diketahui sebagai pagar"
#: init.lua
msgid "Registered @1 and @2"
msgstr "Telah daftar @1 dan @2"
#: init.lua
msgid "[MOD] signs loaded"
msgstr "[MODS] signs telah dimuatkan"

94
locale/ru.po Normal file
View File

@ -0,0 +1,94 @@
# Russian Translation for the signs_lib mod.
# Copyright (C) 2018 Vanessa Ezekowitz
# This file is distributed under the same license as the signs_lib package.
# CodeXP <codexp@gmx.net>, 2018.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: signs_lib\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-24 22:23+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: CodeXP <codexp@gmx.net>\n"
"Language-Team: \n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: init.lua
msgid "Write"
msgstr "записать"
#: init.lua
msgid "Locked sign, owned by @1\n"
msgstr "защищенная табличка, пренадлежит @1\n"
#: init.lua
msgid "locked "
msgstr "защищенный "
#: init.lua
msgid "@1 wrote \"@2\" to @3sign at @4"
msgstr "@1 записал \"@2\" в @3sign на @4"
#: init.lua
msgid "Sign"
msgstr "табличка"
#: init.lua
msgid "Can edit all locked signs"
msgstr "Может редактировать все защищенные таблички"
#: init.lua
msgid "Locked Sign"
msgstr "защищенная табличка"
#: init.lua
msgid "green"
msgstr "зеленая"
#: init.lua
msgid "yellow"
msgstr "желтая"
#: init.lua
msgid "red"
msgstr "красная"
#: init.lua
msgid "white_red"
msgstr "краснобелая"
#: init.lua
msgid "white_black"
msgstr "чернобелая"
#: init.lua
msgid "orange"
msgstr "оранжевая"
#: init.lua
msgid "blue"
msgstr "синея"
#: init.lua
msgid "brown"
msgstr "коричневая"
#: init.lua
msgid "Sign (@1, metal)"
msgstr "Табличка (@1, металл)"
#: init.lua
msgid "Attempt to register unknown node as fence"
msgstr "Попытка зарегистрировать неизвестный узел как забор"
#: init.lua
msgid "Registered @1 and @2"
msgstr "Зарегистрировано @1 для @2"
#: init.lua
msgid "[MOD] signs loaded"
msgstr "[MOD] мод табличек загружен"

View File

@ -1,12 +0,0 @@
# textdomain: signs_lib
Locked sign, owned by @1@n=Abgeschlossenes Schild, gehört @1@n
Skims through all currently-loaded sign-bearing mapblocks, clears away any entities within each sign's node space, and regenerates their text entities, if any.=Iteriert durch alle derzeit geladenen Kartenblöcke, die Schilder enthalten, löscht alle Entities innerhalb des Node-Raums eines jeden Schildes und erzeugt ihre Text-Entities, falls vorhanden, neu.
There are no signs in the currently-loaded terrain.=Im derzeit geladenen Gelände befinden sich keine Schilder.
Found a total of @1 sign nodes across @2 blocks.=Insgesamt wurden @1 Schild-Nodes über @2 Kartenblöcke gefunden.
Regenerating sign entities ...=Schild-Entities werden neu erzeugt ...
Finished.=Fertig.
Write=Schreiben
Unicode font=Unicode-Schrift
Wide font=Weite Schrift
Wooden Wall Sign=Holzwandschild
Steel Wall Sign=Stahlwandschild

View File

@ -1,12 +0,0 @@
# textdomain: signs_lib
Locked sign, owned by @1@n=Cartel bloqueado, propiedad de @1
Skims through all currently-loaded sign-bearing mapblocks, clears away any entities within each sign's node space, and regenerates their text entities, if any.=Examina todos los bloques de mapas que contienen letreros cargados actualmente, elimina cualquier entidad dentro del espacio de nodo de cada cartel y regenera sus entidades de texto, si las hay.
There are no signs in the currently-loaded terrain.=No hay carteles en el terreno actual cargado.
Found a total of @1 sign nodes across @2 blocks.=Se han encontrado un total de @1 cartel(es) a traves de @2 bloque(s).
Regenerating sign entities ...=Regenerando entidades de los carteles...
Finished.=Terminado
Write=Escribir
Unicode font=Fuente unicode
Wide font=Fuente ancha
Wooden Wall Sign=Cartel de Madera
Steel Wall Sign=Cartel de Acero

View File

@ -1,12 +0,0 @@
# textdomain: signs_lib
Locked sign, owned by @1@n=Panneau verrouillé, appartient à @1@n
Skims through all currently-loaded sign-bearing mapblocks, clears away any entities within each sign's node space, and regenerates their text entities, if any.=
There are no signs in the currently-loaded terrain.=
Found a total of @1 sign nodes across @2 blocks.=
Regenerating sign entities ...=
Finished.=
Write=
Unicode font=
Wide font=
Wooden Wall Sign=
Steel Wall Sign=

View File

@ -1,12 +0,0 @@
# textdomain: signs_lib
Locked sign, owned by @1@n=Papan tanda berkunci, milik @1@n
Skims through all currently-loaded sign-bearing mapblocks, clears away any entities within each sign's node space, and regenerates their text entities, if any.=
There are no signs in the currently-loaded terrain.=
Found a total of @1 sign nodes across @2 blocks.=
Regenerating sign entities ...=
Finished.=
Write=
Unicode font=
Wide font=
Wooden Wall Sign=
Steel Wall Sign=

View File

@ -1,12 +0,0 @@
# textdomain: signs_lib
Locked sign, owned by @1@n=защищенная табличка, пренадлежит @1@n
Skims through all currently-loaded sign-bearing mapblocks, clears away any entities within each sign's node space, and regenerates their text entities, if any.=
There are no signs in the currently-loaded terrain.=
Found a total of @1 sign nodes across @2 blocks.=
Regenerating sign entities ...=
Finished.=
Write=записать
Unicode font=
Wide font=
Wooden Wall Sign=
Steel Wall Sign=

View File

@ -1,14 +0,0 @@
# textdomain: signs_lib
Signs Lib=Таблички Lib
Adds signs with readable text.=Додає таблички з читабельним текстом.
Locked sign, owned by @1@n=Захищена табличка (власник @1@n)
Skims through all currently-loaded sign-bearing mapblocks, clears away any entities within each sign's node space, and regenerates their text entities, if any.=Перевіряє всі завантажені блоки з табличками, очищає їхній простір від об'єктів і відновлює текст, якщо потрібно.
There are no signs in the currently-loaded terrain.=Не знайдено табличок на поточній провантаженій території.
Found a total of @1 sign nodes across @2 blocks.=Загалом знайдено @1 табличок в @2 блоках.
Regenerating sign entities ...=Регенерація сутностей табличок...
Finished.=Завершено.
Write=Записати
Unicode font=Юнікод
Wide font=Широкий
Wooden Wall Sign=Дерев'яна табличка
Steel Wall Sign=Сталева табличка

94
locale/template.pot Normal file
View File

@ -0,0 +1,94 @@
# LANGUAGE Translation for the signs_lib mod.
# Copyright (C) 2018 Vanessa Ezekowitz
# This file is distributed under the same license as the signs_lib package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: signs_lib\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-24 22:23+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: init.lua
msgid "Write"
msgstr ""
#: init.lua
msgid "Locked sign, owned by @1\n"
msgstr ""
#: init.lua
msgid "locked "
msgstr ""
#: init.lua
msgid "@1 wrote \"@2\" to @3sign at @4"
msgstr ""
#: init.lua
msgid "Sign"
msgstr ""
#: init.lua
msgid "Can edit all locked signs"
msgstr ""
#: init.lua
msgid "Locked Sign"
msgstr ""
#: init.lua
msgid "green"
msgstr ""
#: init.lua
msgid "yellow"
msgstr ""
#: init.lua
msgid "red"
msgstr ""
#: init.lua
msgid "white_red"
msgstr ""
#: init.lua
msgid "white_black"
msgstr ""
#: init.lua
msgid "orange"
msgstr ""
#: init.lua
msgid "blue"
msgstr ""
#: init.lua
msgid "brown"
msgstr ""
#: init.lua
msgid "Sign (@1, metal)"
msgstr ""
#: init.lua
msgid "Attempt to register unknown node as fence"
msgstr ""
#: init.lua
msgid "Registered @1 and @2"
msgstr ""
#: init.lua
msgid "[MOD] signs loaded"
msgstr ""

View File

@ -1,12 +0,0 @@
# textdomain: signs_lib
Locked sign, owned by @1@n=
Skims through all currently-loaded sign-bearing mapblocks, clears away any entities within each sign's node space, and regenerates their text entities, if any.=
There are no signs in the currently-loaded terrain.=
Found a total of @1 sign nodes across @2 blocks.=
Regenerating sign entities ...=
Finished.=
Write=
Unicode font=
Wide font=
Wooden Wall Sign=
Steel Wall Sign=

View File

@ -1,5 +1,6 @@
name = signs_lib name = signs_lib
author = VanessaE author = VanessaE
optional_depends = screwdriver, streetspoles, streetlamps, cottages, prefab_redo, default depends = default
optional_depends = intllib, screwdriver, streetspoles, streetlamps, cottages, prefab_redo
description = Adds signs with readable text. description = Adds signs with readable text.
min_minetest_version = 5.4.0 min_minetest_version = 5.4.0

View File

@ -1,8 +0,0 @@
signs_lib.unicode_install({208,132,"0404"})
signs_lib.unicode_install({208,134,"0406"})
signs_lib.unicode_install({208,135,"0407"})
signs_lib.unicode_install({209,148,"0454"})
signs_lib.unicode_install({209,150,"0456"})
signs_lib.unicode_install({209,151,"0457"})
signs_lib.unicode_install({210,144,"0490"})
signs_lib.unicode_install({210,145,"0491"})

View File

@ -1 +0,0 @@
signs_lib.edit_priv (Allows to rotate signs and to open (and consequently edit) any default sign formspec) string signslib_edit

View File

@ -1,63 +1,60 @@
-- Definitions for standard minetest_game wooden and steel wall signs -- Definitions for standard minetest_game wooden and steel wall signs
local S = signs_lib.S signs_lib.register_sign("default:sign_wall_wood", {
description = "Wooden wall sign",
inventory_image = "signs_lib_sign_wall_wooden_inv.png",
tiles = {
"signs_lib_sign_wall_wooden.png",
"signs_lib_sign_wall_wooden_edges.png",
-- items 3 - 5 are not set, so signs_lib will use its standard pole
-- mount, hanging, and yard sign stick textures.
},
entity_info = "standard",
allow_hanging = true,
allow_widefont = true,
allow_onpole = true,
allow_onpole_horizontal = true,
allow_yard = true,
use_texture_alpha = "clip",
})
if minetest.get_modpath("default") then signs_lib.register_sign("default:sign_wall_steel", {
signs_lib.register_sign("default:sign_wall_wood", { description = "Steel wall sign",
description = S("Wooden Wall Sign"), inventory_image = "signs_lib_sign_wall_steel_inv.png",
inventory_image = "signs_lib_sign_wall_wooden_inv.png", tiles = {
tiles = { "signs_lib_sign_wall_steel.png",
"signs_lib_sign_wall_wooden.png", "signs_lib_sign_wall_steel_edges.png",
"signs_lib_sign_wall_wooden_edges.png", nil, -- not set, so it'll use the standard pole mount texture
-- items 3 - 5 are not set, so signs_lib will use its standard pole nil, -- not set, so it'll use the standard hanging chains texture
-- mount, hanging, and yard sign stick textures. "default_steel_block.png" -- for the yard sign's stick
}, },
entity_info = "standard", groups = signs_lib.standard_steel_groups,
allow_hanging = true, sounds = signs_lib.standard_steel_sign_sounds,
allow_widefont = true, locked = true,
allow_onpole = true, entity_info = "standard",
allow_onpole_horizontal = true, allow_hanging = true,
allow_yard = true, allow_widefont = true,
use_texture_alpha = "clip", allow_onpole = true,
}) allow_onpole_horizontal = true,
allow_yard = true,
use_texture_alpha = "clip",
})
signs_lib.register_sign("default:sign_wall_steel", { minetest.register_alias("signs:sign_hanging", "default:sign_wood_hanging")
description = S("Steel Wall Sign"), minetest.register_alias("basic_signs:hanging_sign", "default:sign_wood_hanging")
inventory_image = "signs_lib_sign_wall_steel_inv.png", minetest.register_alias("signs:sign_yard", "default:sign_wood_yard")
tiles = { minetest.register_alias("basic_signs:yard_sign", "default:sign_wood_yard")
"signs_lib_sign_wall_steel.png",
"signs_lib_sign_wall_steel_edges.png",
nil, -- not set, so it'll use the standard pole mount texture
nil, -- not set, so it'll use the standard hanging chains texture
"default_steel_block.png" -- for the yard sign's stick
},
groups = signs_lib.standard_steel_groups,
sounds = signs_lib.standard_steel_sign_sounds,
locked = true,
entity_info = "standard",
allow_hanging = true,
allow_widefont = true,
allow_onpole = true,
allow_onpole_horizontal = true,
allow_yard = true,
use_texture_alpha = "clip",
})
minetest.register_alias("signs:sign_hanging", "default:sign_wood_hanging") minetest.register_alias("default:sign_wall_wood_onpole", "default:sign_wood_onpole")
minetest.register_alias("basic_signs:hanging_sign", "default:sign_wood_hanging") minetest.register_alias("default:sign_wall_wood_onpole_horiz", "default:sign_wood_onpole_horiz")
minetest.register_alias("signs:sign_yard", "default:sign_wood_yard") minetest.register_alias("default:sign_wall_wood_hanging", "default:sign_wood_hanging")
minetest.register_alias("basic_signs:yard_sign", "default:sign_wood_yard") minetest.register_alias("default:sign_wall_wood_yard", "default:sign_wood_yard")
minetest.register_alias("default:sign_wall_wood_onpole", "default:sign_wood_onpole") minetest.register_alias("default:sign_wall_steel_onpole", "default:sign_steel_onpole")
minetest.register_alias("default:sign_wall_wood_onpole_horiz", "default:sign_wood_onpole_horiz") minetest.register_alias("default:sign_wall_steel_onpole_horiz", "default:sign_steel_onpole_horiz")
minetest.register_alias("default:sign_wall_wood_hanging", "default:sign_wood_hanging") minetest.register_alias("default:sign_wall_steel_hanging", "default:sign_steel_hanging")
minetest.register_alias("default:sign_wall_wood_yard", "default:sign_wood_yard") minetest.register_alias("default:sign_wall_steel_yard", "default:sign_steel_yard")
minetest.register_alias("default:sign_wall_steel_onpole", "default:sign_steel_onpole")
minetest.register_alias("default:sign_wall_steel_onpole_horiz", "default:sign_steel_onpole_horiz")
minetest.register_alias("default:sign_wall_steel_hanging", "default:sign_steel_hanging")
minetest.register_alias("default:sign_wall_steel_yard", "default:sign_steel_yard")
end
table.insert(signs_lib.lbm_restore_nodes, "signs:sign_hanging") table.insert(signs_lib.lbm_restore_nodes, "signs:sign_hanging")
table.insert(signs_lib.lbm_restore_nodes, "basic_signs:hanging_sign") table.insert(signs_lib.lbm_restore_nodes, "basic_signs:hanging_sign")

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

Some files were not shown because too many files have changed in this diff Show More