From 22cf268c7419eb0477d07af0c78a558ffde845fc Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Thu, 3 Apr 2014 07:04:53 +1000 Subject: Load any matching .properties files into a module. --- ClientHamr/GuiLua/skang.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ClientHamr/GuiLua/skang.lua') diff --git a/ClientHamr/GuiLua/skang.lua b/ClientHamr/GuiLua/skang.lua index 67df94b..d5622fd 100644 --- a/ClientHamr/GuiLua/skang.lua +++ b/ClientHamr/GuiLua/skang.lua @@ -141,7 +141,12 @@ end -- Restore the environment. moduleEnd = function (module) - -- TODO - Look for _NAME.properties, and load it into the modules Things. + -- See if there is a properties file, and run it in the modules environment. + local properties = loadfile(module._NAME .. '.properties') + if properties then + setfenv(properties, getfenv(2)) + properties() + end -- TODO - Parse command line parameters at some point. -- http://stackoverflow.com/questions/3745047/help-locate-c-sample-code-to-read-lua-command-line-arguments if module.isLua then setfenv(2, module.savedEnvironment) end -- cgit v1.1