summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-01-11 22:22:20 +0100
committerorwell96 <orwell@bleipb.de>2018-01-11 22:22:20 +0100
commit360cbf4b976b63b6fad82858c8bb4446adf0e661 (patch)
tree26593237257b228728968d8afae54a02df19b018
parenta06627f23b052207d3fc23d786c525f2cd26096c (diff)
Make replace_macros global to use it in display_lib
-rw-r--r--init.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 5c18308..e5db733 100644
--- a/init.lua
+++ b/init.lua
@@ -15,9 +15,8 @@ local enable_colored_metal_signs = true
-- CWz's keyword interact mod uses this setting.
local current_keyword = minetest.settings:get("interact_keyword") or "iaccept"
-local replace_macros = dofile(minetest.get_modpath(minetest.get_current_modname())..DIR_DELIM.."macro.lua")
-
signs_lib = {}
+signs_lib.replace_macros = dofile(minetest.get_modpath(minetest.get_current_modname())..DIR_DELIM.."macro.lua")
screwdriver = screwdriver or {}
signs_lib.wallmounted_rotate = function(pos, node, user, mode, new_param2)
@@ -292,7 +291,7 @@ end
local function split_lines_and_words(text)
if not text then return end
text = string.gsub(text, "@KEYWORD", current_keyword)
- text = replace_macros(text)
+ text = signs_lib.replace_macros(text)
local lines = { }
for _, line in ipairs(text:split("\n")) do
table.insert(lines, line:split(" "))