mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Add Util script.
This commit is contained in:
parent
cfe813782b
commit
e1f73b8daf
1 changed files with 22 additions and 0 deletions
22
Scripts/Util.lua
Normal file
22
Scripts/Util.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
local Util = {}
|
||||
|
||||
Util.ShortenTENCalls = function()
|
||||
local ShortenInner
|
||||
ShortenInner = function(tab)
|
||||
for k, v in pairs(tab) do
|
||||
if _G[k] then
|
||||
print("WARNING! Key " .. k .. " already exists in global environment!")
|
||||
else
|
||||
_G[k] = v
|
||||
if "table" == type(v) then
|
||||
if nil == v.__type then
|
||||
ShortenInner(v)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
ShortenInner(TEN)
|
||||
end
|
||||
|
||||
return Util
|
Loading…
Add table
Add a link
Reference in a new issue