diff options
author | orwell96 <orwell@bleipb.de> | 2017-10-19 13:37:46 +0200 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2017-10-19 13:40:19 +0200 |
commit | a06627f23b052207d3fc23d786c525f2cd26096c (patch) | |
tree | f8365faa71abbd2e531a54124d459deac06de4ab /init.lua | |
parent | a755607f7d9a84daff679f706f10a5b90743aa5a (diff) |
Add sign macro functionality
Allow to replace certain keywords on signs by defining a single string globally
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -15,6 +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 = {} screwdriver = screwdriver or {} @@ -290,6 +292,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) local lines = { } for _, line in ipairs(text:split("\n")) do table.insert(lines, line:split(" ")) |