mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2024-12-22 16:10:18 +01:00
keyword --> current_keyword
This commit is contained in:
parent
f0a846b200
commit
a79c752c40
@ -11,7 +11,7 @@
|
||||
-- }
|
||||
|
||||
-- CWz's keyword interact mod uses this setting.
|
||||
local keyword = minetest.setting_get("interact_keyword") or "iaccept"
|
||||
local current_keyword = minetest.setting_get("interact_keyword") or "iaccept"
|
||||
|
||||
signs_lib = {}
|
||||
screwdriver = screwdriver or {}
|
||||
@ -367,7 +367,7 @@ end
|
||||
|
||||
local function split_lines_and_words(text)
|
||||
if not text then return end
|
||||
text = string.gsub(text, "@KEYWORD", keyword)
|
||||
text = string.gsub(text, "@KEYWORD", current_keyword)
|
||||
local lines = { }
|
||||
for _, line in ipairs(text:split("\n")) do
|
||||
table.insert(lines, line:split(" "))
|
||||
@ -539,19 +539,19 @@ signs_lib.update_sign = function(pos, fields, owner)
|
||||
|
||||
if fields then -- ...we're editing the sign.
|
||||
if fields.text and string.find(dump(fields.text), "@KEYWORD") then
|
||||
meta:set_string("keyword", keyword)
|
||||
meta:set_string("keyword", current_keyword)
|
||||
else
|
||||
meta:set_string("keyword", nil)
|
||||
end
|
||||
elseif string.find(dump(stored_text), "@KEYWORD") then -- we need to check if the password is being set/changed
|
||||
|
||||
local stored_keyword = meta:get_string("keyword")
|
||||
if stored_keyword and stored_keyword ~= "" and stored_keyword ~= keyword then
|
||||
if stored_keyword and stored_keyword ~= "" and stored_keyword ~= current_keyword then
|
||||
signs_lib.destruct_sign(pos)
|
||||
meta:set_string("keyword", keyword)
|
||||
meta:set_string("keyword", current_keyword)
|
||||
local ownstr = ""
|
||||
if owner then ownstr = "Locked sign, owned by "..owner.."\n" end
|
||||
meta:set_string("infotext", ownstr..string.gsub(make_infotext(stored_text), "@KEYWORD", keyword).." ")
|
||||
meta:set_string("infotext", ownstr..string.gsub(make_infotext(stored_text), "@KEYWORD", current_keyword).." ")
|
||||
end
|
||||
end
|
||||
|
||||
@ -564,7 +564,7 @@ signs_lib.update_sign = function(pos, fields, owner)
|
||||
local ownstr = ""
|
||||
if owner then ownstr = "Locked sign, owned by "..owner.."\n" end
|
||||
|
||||
meta:set_string("infotext", ownstr..string.gsub(make_infotext(fields.text), "@KEYWORD", keyword).." ")
|
||||
meta:set_string("infotext", ownstr..string.gsub(make_infotext(fields.text), "@KEYWORD", current_keyword).." ")
|
||||
meta:set_string("text", fields.text)
|
||||
|
||||
meta:set_int("__signslib_new_format", 1)
|
||||
|
Loading…
Reference in New Issue
Block a user