diff options
author | David Walter Seikel | 2014-04-03 07:04:53 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-04-03 07:04:53 +1000 |
commit | 22cf268c7419eb0477d07af0c78a558ffde845fc (patch) | |
tree | 6cab7b3ee9602a6f17da769842cc00df22321a26 /ClientHamr/GuiLua/skang.lua | |
parent | More Widget and Squeal ramblings. (diff) | |
download | SledjHamr-22cf268c7419eb0477d07af0c78a558ffde845fc.zip SledjHamr-22cf268c7419eb0477d07af0c78a558ffde845fc.tar.gz SledjHamr-22cf268c7419eb0477d07af0c78a558ffde845fc.tar.bz2 SledjHamr-22cf268c7419eb0477d07af0c78a558ffde845fc.tar.xz |
Load any matching .properties files into a module.
Diffstat (limited to 'ClientHamr/GuiLua/skang.lua')
-rw-r--r-- | ClientHamr/GuiLua/skang.lua | 7 |
1 files changed, 6 insertions, 1 deletions
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 | |||
141 | 141 | ||
142 | -- Restore the environment. | 142 | -- Restore the environment. |
143 | moduleEnd = function (module) | 143 | moduleEnd = function (module) |
144 | -- TODO - Look for _NAME.properties, and load it into the modules Things. | 144 | -- See if there is a properties file, and run it in the modules environment. |
145 | local properties = loadfile(module._NAME .. '.properties') | ||
146 | if properties then | ||
147 | setfenv(properties, getfenv(2)) | ||
148 | properties() | ||
149 | end | ||
145 | -- TODO - Parse command line parameters at some point. | 150 | -- TODO - Parse command line parameters at some point. |
146 | -- http://stackoverflow.com/questions/3745047/help-locate-c-sample-code-to-read-lua-command-line-arguments | 151 | -- http://stackoverflow.com/questions/3745047/help-locate-c-sample-code-to-read-lua-command-line-arguments |
147 | if module.isLua then setfenv(2, module.savedEnvironment) end | 152 | if module.isLua then setfenv(2, module.savedEnvironment) end |