aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ClientHamr/GuiLua/skang.lua
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-04-03 07:34:06 +1000
committerDavid Walter Seikel2014-04-03 07:34:06 +1000
commited8925b28dbb66383a5931165b82f0eaa97385f9 (patch)
tree506bf02d77799cd8efabd27b9f46c3eb4c012224 /ClientHamr/GuiLua/skang.lua
parentLoad any matching .properties files into a module. (diff)
downloadSledjHamr-ed8925b28dbb66383a5931165b82f0eaa97385f9.zip
SledjHamr-ed8925b28dbb66383a5931165b82f0eaa97385f9.tar.gz
SledjHamr-ed8925b28dbb66383a5931165b82f0eaa97385f9.tar.bz2
SledjHamr-ed8925b28dbb66383a5931165b82f0eaa97385f9.tar.xz
Read in any matching .skang files in moduleBegin().
Diffstat (limited to '')
-rw-r--r--ClientHamr/GuiLua/skang.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/ClientHamr/GuiLua/skang.lua b/ClientHamr/GuiLua/skang.lua
index d5622fd..bd05031 100644
--- a/ClientHamr/GuiLua/skang.lua
+++ b/ClientHamr/GuiLua/skang.lua
@@ -116,7 +116,15 @@ moduleBegin = function (name, author, copyright, version, timestamp, skin, isLua
116 end 116 end
117 _M.VERSION = version .. versionName .. timestamp 117 _M.VERSION = version .. versionName .. timestamp
118 _M.VERSION_DESC = versionDesc 118 _M.VERSION_DESC = versionDesc
119 -- TODO - If there's no skin passed in, try to find the file skin .. '.skang' and load that instead. 119 -- If there is a .skang file, read that in and override the passed in skin.
120 local f = io.open(name .. '.skang')
121 if f then
122 skin = f:read('*l')
123 if '#' == string.sub(skin, 1, 1) then skin = '' end
124 skin = skin .. f:read('*a')
125 f:close()
126 end
127 if skin then skin = "local skang = require 'skang'\nlocal this = require 'test'\n" .. skin end
120 _M.DEFAULT_SKANG = skin 128 _M.DEFAULT_SKANG = skin
121 129
122 --_G[_M._NAME] = _M -- Stuff it into a global of the same name. 130 --_G[_M._NAME] = _M -- Stuff it into a global of the same name.