Version MFF.
This commit is contained in:
parent
ebb9647f08
commit
17540e9aeb
0
README.txt
Normal file → Executable file
0
README.txt
Normal file → Executable file
0
depends.txt
Normal file → Executable file
0
depends.txt
Normal file → Executable file
17
init.lua
Normal file → Executable file
17
init.lua
Normal file → Executable file
@ -21,34 +21,33 @@ minetest.register_node("locked_sign:sign_wall_locked", {
|
||||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_defaults(),
|
||||
after_place_node = function(pos, placer)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
meta:set_string("infotext", "\"\" (owned by " .. placer:get_player_name() .. ")")
|
||||
end,
|
||||
on_construct = function(pos)
|
||||
--local n = minetest.env:get_node(pos)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
--local n = minetest.get_node(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", "field[text;;${text}]")
|
||||
meta:set_string("infotext", "\"\"")
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.env:get_meta(pos);
|
||||
local meta = minetest.get_meta(pos);
|
||||
local owner = meta:get_string("owner")
|
||||
local pname = player:get_player_name()
|
||||
return pname == owner or pname == minetest.setting_get("name")
|
||||
or minetest.check_player_privs(pname, {sign_editor=true})
|
||||
end,
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local owner = meta:get_string("owner")
|
||||
local pname = sender:get_player_name()
|
||||
if pname ~= owner and pname ~= minetest.setting_get("name")
|
||||
and not minetest.check_player_privs(pname, {sign_editor=true}) then
|
||||
if pname ~= owner and pname ~= minetest.setting_get("name") then
|
||||
return
|
||||
end
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
fields.text = fields.text or ""
|
||||
print((sender:get_player_name() or "").." wrote \""..fields.text..
|
||||
minetest.log("action", (sender:get_player_name() or "").." wrote \""..fields.text..
|
||||
"\" to sign at "..minetest.pos_to_string(pos))
|
||||
meta:set_string("text", fields.text)
|
||||
meta:set_string("infotext", "\"" .. fields.text .. "\" (owned by " .. sender:get_player_name() .. ")")
|
||||
|
BIN
textures/MineToon/locked_sign_sign_wall_lock.png
Normal file → Executable file
BIN
textures/MineToon/locked_sign_sign_wall_lock.png
Normal file → Executable file
Binary file not shown.
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 545 B |
BIN
textures/locked_sign_sign_wall_lock.png
Normal file → Executable file
BIN
textures/locked_sign_sign_wall_lock.png
Normal file → Executable file
Binary file not shown.
Before Width: | Height: | Size: 645 B After Width: | Height: | Size: 12 KiB |
Loading…
Reference in New Issue
Block a user