Compare commits
5 Commits
5c0541e2a8
...
60fe0c74ea
Author | SHA1 | Date |
---|---|---|
PilzAdam | 60fe0c74ea | |
PilzAdam | ca13db71fd | |
PilzAdam | fa72ba55df | |
PilzAdam | ba79f900a5 | |
PilzAdam | 7d24a4eea0 |
|
@ -0,0 +1,43 @@
|
|||
=== SIGNS-MOD for MINETEST-C55===
|
||||
by xyz
|
||||
modified by PilzAdam
|
||||
|
||||
Introduction:
|
||||
This mod adds signs to Minetest, wich you can read without pointing at
|
||||
the sign. The text is integrated into the 3D world.
|
||||
|
||||
How to install:
|
||||
Unzip the archive an place it in minetest-base-directory/mods/minetest/
|
||||
if you have a windows client or a linux run-in-place client. If you have
|
||||
a linux system-wide instalation place it in ~/.minetest/mods/minetest/.
|
||||
If you want to install this mod only in one world create the folder
|
||||
worldmods/ in your worlddirectory.
|
||||
For further information or help see:
|
||||
http://wiki.minetest.com/wiki/Installing_Mods
|
||||
|
||||
How to use the mod:
|
||||
Craft a sign like the default signs and place them. Rightclick it and enter
|
||||
your text. You can use " | " to create a newline. Hitting enter or
|
||||
clicking proceed will save the text and add it to the sign.
|
||||
If the text of a sign disapears just rightclick it and hit enter again.
|
||||
|
||||
License:
|
||||
Sourcecode: WTFPL (see below)
|
||||
Font: 04b-03 (http://04.jp.org/)
|
||||
|
||||
See also:
|
||||
http://minetest.net/
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
82
characters
|
@ -1,111 +1,111 @@
|
|||
A
|
||||
_a_
|
||||
4
|
||||
7
|
||||
B
|
||||
_b_
|
||||
4
|
||||
5
|
||||
C
|
||||
_c_
|
||||
3
|
||||
6
|
||||
D
|
||||
_d_
|
||||
4
|
||||
6
|
||||
E
|
||||
_e_
|
||||
3
|
||||
5
|
||||
F
|
||||
_f_
|
||||
3
|
||||
5
|
||||
G
|
||||
_g_
|
||||
4
|
||||
6
|
||||
H
|
||||
_h_
|
||||
4
|
||||
6
|
||||
I
|
||||
_i_
|
||||
3
|
||||
1
|
||||
J
|
||||
_j_
|
||||
4
|
||||
K
|
||||
_k_
|
||||
4
|
||||
5
|
||||
L
|
||||
_l_
|
||||
3
|
||||
4
|
||||
M
|
||||
_m_
|
||||
5
|
||||
7
|
||||
N
|
||||
_n_
|
||||
4
|
||||
6
|
||||
O
|
||||
_o_
|
||||
4
|
||||
6
|
||||
P
|
||||
_p_
|
||||
4
|
||||
5
|
||||
Q
|
||||
_q_
|
||||
4
|
||||
7
|
||||
R
|
||||
_r_
|
||||
4
|
||||
5
|
||||
S
|
||||
_s_
|
||||
4
|
||||
5
|
||||
T
|
||||
_t_
|
||||
3
|
||||
5
|
||||
U
|
||||
_u_
|
||||
4
|
||||
6
|
||||
V
|
||||
_v_
|
||||
4
|
||||
7
|
||||
W
|
||||
_w_
|
||||
5
|
||||
9
|
||||
X
|
||||
_x_
|
||||
4
|
||||
5
|
||||
Y
|
||||
_y_
|
||||
4
|
||||
7
|
||||
Z
|
||||
_z_
|
||||
3
|
||||
5
|
||||
a
|
||||
_a
|
||||
4
|
||||
5
|
||||
b
|
||||
_b
|
||||
4
|
||||
5
|
||||
c
|
||||
_c
|
||||
3
|
||||
4
|
||||
d
|
||||
_d
|
||||
4
|
||||
5
|
||||
e
|
||||
_e
|
||||
4
|
||||
f
|
||||
_f
|
||||
3
|
||||
4
|
||||
g
|
||||
_g
|
||||
4
|
||||
5
|
||||
h
|
||||
_h
|
||||
4
|
||||
5
|
||||
i
|
||||
_i
|
||||
1
|
||||
j
|
||||
_j
|
||||
2
|
||||
1
|
||||
k
|
||||
_k
|
||||
4
|
||||
|
@ -114,19 +114,19 @@ _l
|
|||
1
|
||||
m
|
||||
_m
|
||||
5
|
||||
7
|
||||
n
|
||||
_n
|
||||
4
|
||||
5
|
||||
o
|
||||
_o
|
||||
4
|
||||
5
|
||||
p
|
||||
_p
|
||||
4
|
||||
5
|
||||
q
|
||||
_q
|
||||
4
|
||||
5
|
||||
r
|
||||
_r
|
||||
3
|
||||
|
@ -141,13 +141,13 @@ _u
|
|||
4
|
||||
v
|
||||
_v
|
||||
4
|
||||
5
|
||||
w
|
||||
_w
|
||||
5
|
||||
7
|
||||
x
|
||||
_x
|
||||
3
|
||||
5
|
||||
y
|
||||
_y
|
||||
4
|
||||
|
|
45
init.lua
|
@ -3,7 +3,6 @@
|
|||
-- load characters map
|
||||
local chars_file = io.open(minetest.get_modpath("signs").."/characters", "r")
|
||||
local charmap = {}
|
||||
local charwidth = {}
|
||||
local max_chars = 16
|
||||
if not chars_file then
|
||||
print("[signs] E: character map file not found")
|
||||
|
@ -14,14 +13,11 @@ else
|
|||
break
|
||||
end
|
||||
local img = chars_file:read("*l")
|
||||
local width = chars_file:read("*n")
|
||||
chars_file:read("*l")
|
||||
charmap[char] = img
|
||||
charwidth[img] = width
|
||||
end
|
||||
end
|
||||
|
||||
--local metas = {"line1", "line2", "line3", "line4", "line5", "line6", "line7"}
|
||||
local signs = {
|
||||
{delta = {x = 0, y = 0, z = 0.399}, yaw = 0},
|
||||
{delta = {x = 0.399, y = 0, z = 0}, yaw = math.pi / -2},
|
||||
|
@ -56,7 +52,9 @@ end
|
|||
local update_sign = function(pos, fields)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
meta:set_string("infotext", "")
|
||||
if fields then
|
||||
meta:set_string("text", fields.text)
|
||||
end
|
||||
local text = meta:get_string("text")
|
||||
local objects = minetest.env:get_objects_inside_radius(pos, 0.5)
|
||||
for _, v in ipairs(objects) do
|
||||
|
@ -94,7 +92,6 @@ minetest.register_node(":default:sign_wall", {
|
|||
node_box = {type = "fixed", fixed = {-0.45, -0.15, 0.4, 0.45, 0.45, 0.498}},
|
||||
selection_box = {type = "fixed", fixed = {-0.45, -0.15, 0.4, 0.45, 0.45, 0.498}},
|
||||
tiles = {"signs_top.png", "signs_bottom.png", "signs_side.png", "signs_side.png", "signs_back.png", "signs_front.png"},
|
||||
walkable = false,
|
||||
groups = sign_groups,
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
|
@ -121,7 +118,8 @@ minetest.register_node(":default:sign_wall", {
|
|||
if wdir == 0 then
|
||||
--how would you add sign to ceiling?
|
||||
minetest.env:add_item(above, "default:sign_wall")
|
||||
return ItemStack("")
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
elseif wdir == 1 then
|
||||
minetest.env:add_node(above, {name = "signs:sign_yard", param2 = fdir})
|
||||
sign_info = signs_yard[fdir + 1]
|
||||
|
@ -147,6 +145,9 @@ minetest.register_node(":default:sign_wall", {
|
|||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
update_sign(pos, fields)
|
||||
end,
|
||||
on_punch = function(pos, node, puncher)
|
||||
update_sign(pos)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("signs:sign_yard", {
|
||||
|
@ -160,7 +161,6 @@ minetest.register_node("signs:sign_yard", {
|
|||
}},
|
||||
selection_box = {type = "fixed", fixed = {-0.45, -0.15, -0.049, 0.45, 0.45, 0.049}},
|
||||
tiles = {"signs_top.png", "signs_bottom.png", "signs_side.png", "signs_side.png", "signs_back.png", "signs_front.png"},
|
||||
walkable = false,
|
||||
groups = {choppy=2, dig_immediate=2},
|
||||
drop = "default:sign_wall",
|
||||
|
||||
|
@ -173,6 +173,9 @@ minetest.register_node("signs:sign_yard", {
|
|||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
update_sign(pos, fields)
|
||||
end,
|
||||
on_punch = function(pos, node, puncher)
|
||||
update_sign(pos)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_entity("signs:text", {
|
||||
|
@ -187,8 +190,15 @@ minetest.register_entity("signs:text", {
|
|||
end
|
||||
})
|
||||
|
||||
local sign_width = 110
|
||||
local sign_padding = 8
|
||||
-- CONSTANTS
|
||||
local SIGN_WITH = 110
|
||||
local SIGN_PADDING = 8
|
||||
|
||||
local LINE_LENGTH = 16
|
||||
local NUMBER_OF_LINES = 4
|
||||
|
||||
local LINE_HEIGHT = 14
|
||||
local CHAR_WIDTH = 5
|
||||
|
||||
string_to_array = function(str)
|
||||
local tab = {}
|
||||
|
@ -213,9 +223,6 @@ string_to_word_array = function(str)
|
|||
return tab
|
||||
end
|
||||
|
||||
LINE_LENGTH = 16
|
||||
NUMBER_OF_LINES = 7
|
||||
|
||||
create_lines = function(text)
|
||||
local line = ""
|
||||
local line_num = 1
|
||||
|
@ -245,11 +252,11 @@ create_lines = function(text)
|
|||
end
|
||||
|
||||
generate_texture = function(lines)
|
||||
local texture = "[combine:"..sign_width.."x"..sign_width
|
||||
local texture = "[combine:"..SIGN_WITH.."x"..SIGN_WITH
|
||||
local ypos = 12
|
||||
for i = 1, #lines do
|
||||
texture = texture..generate_line(lines[i], ypos)
|
||||
ypos = ypos + 8
|
||||
ypos = ypos + LINE_HEIGHT
|
||||
end
|
||||
return texture
|
||||
end
|
||||
|
@ -272,7 +279,7 @@ generate_line = function(s, ypos)
|
|||
i = i + 1
|
||||
end
|
||||
if file ~= nil then
|
||||
width = width + charwidth[file] + 1
|
||||
width = width + CHAR_WIDTH
|
||||
table.insert(parsed, file)
|
||||
chars = chars + 1
|
||||
end
|
||||
|
@ -280,10 +287,14 @@ generate_line = function(s, ypos)
|
|||
width = width - 1
|
||||
|
||||
local texture = ""
|
||||
local xpos = math.floor((sign_width - 2 * sign_padding - width) / 2 + sign_padding)
|
||||
local xpos = math.floor((SIGN_WITH - 2 * SIGN_PADDING - width) / 2 + SIGN_PADDING)
|
||||
for i = 1, #parsed do
|
||||
texture = texture..":"..xpos..","..ypos.."="..parsed[i]..".png"
|
||||
xpos = xpos + charwidth[parsed[i]] + 1
|
||||
xpos = xpos + CHAR_WIDTH + 1
|
||||
end
|
||||
return texture
|
||||
end
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "signs loaded")
|
||||
end
|
||||
|
|
BIN
textures/_0.png
Before Width: | Height: | Size: 151 B After Width: | Height: | Size: 239 B |
BIN
textures/_1.png
Before Width: | Height: | Size: 144 B After Width: | Height: | Size: 238 B |
BIN
textures/_2.png
Before Width: | Height: | Size: 156 B After Width: | Height: | Size: 235 B |
BIN
textures/_3.png
Before Width: | Height: | Size: 154 B After Width: | Height: | Size: 241 B |
BIN
textures/_4.png
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 240 B |
BIN
textures/_5.png
Before Width: | Height: | Size: 153 B After Width: | Height: | Size: 237 B |
BIN
textures/_6.png
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 246 B |
BIN
textures/_7.png
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 243 B |
BIN
textures/_8.png
Before Width: | Height: | Size: 144 B After Width: | Height: | Size: 235 B |
BIN
textures/_9.png
Before Width: | Height: | Size: 155 B After Width: | Height: | Size: 245 B |
BIN
textures/_a.png
Before Width: | Height: | Size: 154 B After Width: | Height: | Size: 238 B |
BIN
textures/_a_.png
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 251 B |
BIN
textures/_ap.png
Before Width: | Height: | Size: 128 B After Width: | Height: | Size: 228 B |
BIN
textures/_as.png
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 238 B |
BIN
textures/_at.png
Before Width: | Height: | Size: 159 B After Width: | Height: | Size: 254 B |
BIN
textures/_b.png
Before Width: | Height: | Size: 153 B After Width: | Height: | Size: 249 B |
BIN
textures/_b_.png
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 240 B |
BIN
textures/_bl.png
Before Width: | Height: | Size: 145 B After Width: | Height: | Size: 237 B |
BIN
textures/_br.png
Before Width: | Height: | Size: 146 B After Width: | Height: | Size: 237 B |
BIN
textures/_c.png
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 236 B |
BIN
textures/_c_.png
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 239 B |
BIN
textures/_ca.png
Before Width: | Height: | Size: 149 B After Width: | Height: | Size: 231 B |
BIN
textures/_cl.png
Before Width: | Height: | Size: 151 B After Width: | Height: | Size: 233 B |
BIN
textures/_cm.png
Before Width: | Height: | Size: 145 B After Width: | Height: | Size: 226 B |
BIN
textures/_cr.png
Before Width: | Height: | Size: 151 B After Width: | Height: | Size: 234 B |
BIN
textures/_d.png
Before Width: | Height: | Size: 154 B After Width: | Height: | Size: 243 B |
BIN
textures/_d_.png
Before Width: | Height: | Size: 151 B After Width: | Height: | Size: 239 B |
BIN
textures/_dl.png
Before Width: | Height: | Size: 160 B After Width: | Height: | Size: 239 B |
BIN
textures/_dt.png
Before Width: | Height: | Size: 128 B After Width: | Height: | Size: 224 B |
BIN
textures/_dv.png
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 235 B |
BIN
textures/_e.png
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 240 B |
BIN
textures/_e_.png
Before Width: | Height: | Size: 146 B After Width: | Height: | Size: 242 B |
BIN
textures/_eq.png
Before Width: | Height: | Size: 139 B After Width: | Height: | Size: 228 B |
BIN
textures/_ex.png
Before Width: | Height: | Size: 142 B After Width: | Height: | Size: 230 B |
BIN
textures/_f.png
Before Width: | Height: | Size: 149 B After Width: | Height: | Size: 244 B |
BIN
textures/_f_.png
Before Width: | Height: | Size: 149 B After Width: | Height: | Size: 246 B |
BIN
textures/_g.png
Before Width: | Height: | Size: 160 B After Width: | Height: | Size: 251 B |
BIN
textures/_g_.png
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 243 B |
BIN
textures/_gt.png
Before Width: | Height: | Size: 147 B After Width: | Height: | Size: 228 B |
BIN
textures/_h.png
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 248 B |
BIN
textures/_h_.png
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 252 B |
After Width: | Height: | Size: 233 B |
BIN
textures/_i.png
Before Width: | Height: | Size: 139 B After Width: | Height: | Size: 237 B |
BIN
textures/_i_.png
Before Width: | Height: | Size: 146 B After Width: | Height: | Size: 239 B |
BIN
textures/_j.png
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 240 B |
BIN
textures/_j_.png
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 243 B |
BIN
textures/_k.png
Before Width: | Height: | Size: 154 B After Width: | Height: | Size: 247 B |
BIN
textures/_k_.png
Before Width: | Height: | Size: 155 B After Width: | Height: | Size: 243 B |
BIN
textures/_l.png
Before Width: | Height: | Size: 135 B After Width: | Height: | Size: 238 B |
BIN
textures/_l_.png
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 242 B |
BIN
textures/_lt.png
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 227 B |
BIN
textures/_m.png
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 240 B |
BIN
textures/_m_.png
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 244 B |
BIN
textures/_mn.png
Before Width: | Height: | Size: 142 B After Width: | Height: | Size: 228 B |
BIN
textures/_n.png
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 248 B |
BIN
textures/_n_.png
Before Width: | Height: | Size: 155 B After Width: | Height: | Size: 252 B |
BIN
textures/_o.png
Before Width: | Height: | Size: 146 B After Width: | Height: | Size: 238 B |
BIN
textures/_o_.png
Before Width: | Height: | Size: 151 B After Width: | Height: | Size: 239 B |
BIN
textures/_p.png
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 250 B |
BIN
textures/_p_.png
Before Width: | Height: | Size: 153 B After Width: | Height: | Size: 246 B |
BIN
textures/_pr.png
Before Width: | Height: | Size: 156 B After Width: | Height: | Size: 255 B |
BIN
textures/_ps.png
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 235 B |
BIN
textures/_q.png
Before Width: | Height: | Size: 160 B After Width: | Height: | Size: 251 B |
BIN
textures/_q_.png
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 242 B |
BIN
textures/_qo.png
Before Width: | Height: | Size: 140 B After Width: | Height: | Size: 232 B |
BIN
textures/_qu.png
Before Width: | Height: | Size: 156 B After Width: | Height: | Size: 233 B |
BIN
textures/_r.png
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 241 B |
BIN
textures/_r_.png
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 248 B |
BIN
textures/_re.png
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 243 B |
BIN
textures/_s.png
Before Width: | Height: | Size: 156 B After Width: | Height: | Size: 239 B |
BIN
textures/_s_.png
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 243 B |
BIN
textures/_sl.png
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 240 B |
BIN
textures/_sm.png
Before Width: | Height: | Size: 141 B After Width: | Height: | Size: 227 B |
BIN
textures/_sp.png
Before Width: | Height: | Size: 128 B After Width: | Height: | Size: 215 B |
BIN
textures/_sr.png
Before Width: | Height: | Size: 147 B After Width: | Height: | Size: 236 B |
BIN
textures/_t.png
Before Width: | Height: | Size: 147 B After Width: | Height: | Size: 241 B |
BIN
textures/_t_.png
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 249 B |
BIN
textures/_tl.png
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 227 B |
BIN
textures/_u.png
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 240 B |
BIN
textures/_u_.png
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 252 B |
BIN
textures/_un.png
Before Width: | Height: | Size: 142 B After Width: | Height: | Size: 226 B |
BIN
textures/_v.png
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 249 B |
BIN
textures/_v_.png
Before Width: | Height: | Size: 151 B After Width: | Height: | Size: 246 B |
BIN
textures/_vb.png
Before Width: | Height: | Size: 135 B After Width: | Height: | Size: 229 B |
BIN
textures/_w.png
Before Width: | Height: | Size: 142 B After Width: | Height: | Size: 238 B |
BIN
textures/_w_.png
Before Width: | Height: | Size: 154 B After Width: | Height: | Size: 247 B |
BIN
textures/_x.png
Before Width: | Height: | Size: 147 B After Width: | Height: | Size: 241 B |
BIN
textures/_x_.png
Before Width: | Height: | Size: 149 B After Width: | Height: | Size: 246 B |
BIN
textures/_y.png
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 246 B |
BIN
textures/_y_.png
Before Width: | Height: | Size: 155 B After Width: | Height: | Size: 243 B |
BIN
textures/_z.png
Before Width: | Height: | Size: 154 B After Width: | Height: | Size: 233 B |
BIN
textures/_z_.png
Before Width: | Height: | Size: 151 B After Width: | Height: | Size: 235 B |
After Width: | Height: | Size: 1.5 KiB |