mirror of
https://github.com/Sokomine/locks.git
synced 2025-06-30 14:00:21 +02:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
09385b7da5 |
9
init.lua
9
init.lua
@ -46,7 +46,7 @@ minetest.register_privilege("diglocks", { description = "allows to open/use and
|
|||||||
|
|
||||||
|
|
||||||
locks.config_button = [[
|
locks.config_button = [[
|
||||||
image_button[%s,%s;1,1;locks_lock16.png;locks_config;Config
|
image_button[%d,%d;1,1;locks_lock16.png;locks_config;Config
|
||||||
Locks]
|
Locks]
|
||||||
tooltip[locks_config;Configure the players or set the password to grant access to other players.]
|
tooltip[locks_config;Configure the players or set the password to grant access to other players.]
|
||||||
]]
|
]]
|
||||||
@ -56,7 +56,7 @@ function locks.get_config_button(x,y)
|
|||||||
end
|
end
|
||||||
|
|
||||||
locks.authorize_button = [[
|
locks.authorize_button = [[
|
||||||
image_button[%s,%s;1,1;locks_key16.png;locks_authorize;Autho-
|
image_button[%d,%d;1,1;locks_key16.png;locks_authorize;Autho-
|
||||||
rize]
|
rize]
|
||||||
tooltip[locks_authorize;Opens a password prompt to grant you access to this object.]
|
tooltip[locks_authorize;Opens a password prompt to grant you access to this object.]
|
||||||
]]
|
]]
|
||||||
@ -181,7 +181,6 @@ function locks:lock_init( pos, default_formspec )
|
|||||||
meta:set_string("allowed_users","");
|
meta:set_string("allowed_users","");
|
||||||
-- objects can be unlocked by passwords as well (if it is set)
|
-- objects can be unlocked by passwords as well (if it is set)
|
||||||
meta:set_string("password","");
|
meta:set_string("password","");
|
||||||
meta:mark_as_private("password")
|
|
||||||
-- the last player who entered the right password (to save space this is not a list)
|
-- the last player who entered the right password (to save space this is not a list)
|
||||||
meta:set_string("pw_user","");
|
meta:set_string("pw_user","");
|
||||||
-- this formspec is presented on right-click for every user
|
-- this formspec is presented on right-click for every user
|
||||||
@ -229,7 +228,6 @@ function locks:set_lockdata( pos, data )
|
|||||||
meta:set_string("owner", (data.owner or ""));
|
meta:set_string("owner", (data.owner or ""));
|
||||||
meta:set_string("allowed_users",(data.allowed_users or ""));
|
meta:set_string("allowed_users",(data.allowed_users or ""));
|
||||||
meta:set_string("password", (data.password or ""));
|
meta:set_string("password", (data.password or ""));
|
||||||
meta:mark_as_private("password")
|
|
||||||
meta:set_string("pw_user", (data.pw_user or ""));
|
meta:set_string("pw_user", (data.pw_user or ""));
|
||||||
meta:set_string("formspec", (data.formspec or ""));
|
meta:set_string("formspec", (data.formspec or ""));
|
||||||
end
|
end
|
||||||
@ -600,7 +598,6 @@ function locks:lock_handle_input( pos, formname, fields, player )
|
|||||||
|
|
||||||
|
|
||||||
meta:set_string( "password", help[2]);
|
meta:set_string( "password", help[2]);
|
||||||
meta:mark_as_private("password")
|
|
||||||
-- reset the list of users who typed the right password
|
-- reset the list of users who typed the right password
|
||||||
meta:set_string("pw_users","");
|
meta:set_string("pw_users","");
|
||||||
|
|
||||||
@ -801,3 +798,5 @@ dofile(minetest.get_modpath("locks").."/shared_locked_chest.lua");
|
|||||||
dofile(minetest.get_modpath("locks").."/shared_locked_sign_wall.lua");
|
dofile(minetest.get_modpath("locks").."/shared_locked_sign_wall.lua");
|
||||||
dofile(minetest.get_modpath("locks").."/shared_locked_xdoors2.lua");
|
dofile(minetest.get_modpath("locks").."/shared_locked_xdoors2.lua");
|
||||||
dofile(minetest.get_modpath("locks").."/shared_locked_furnace.lua");
|
dofile(minetest.get_modpath("locks").."/shared_locked_furnace.lua");
|
||||||
|
|
||||||
|
minetest.log("action", "[locks] loaded.")
|
||||||
|
4
mod.conf
4
mod.conf
@ -1,4 +0,0 @@
|
|||||||
name = locks
|
|
||||||
description = This Mod for Minetest adds objects that can be locked and shared.
|
|
||||||
depends = default
|
|
||||||
optional_depends = pipeworks
|
|
@ -155,7 +155,7 @@ minetest.register_node("locks:door", {
|
|||||||
end
|
end
|
||||||
|
|
||||||
local fdir = 0
|
local fdir = 0
|
||||||
local placer_pos = placer:get_pos()
|
local placer_pos = placer:getpos()
|
||||||
if placer_pos then
|
if placer_pos then
|
||||||
dir = {
|
dir = {
|
||||||
x = above.x - placer_pos.x,
|
x = above.x - placer_pos.x,
|
||||||
|
Reference in New Issue
Block a user