Created
April 23, 2014 17:05
-
-
Save CapsAdmin/11223726 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function MakeEnum(filename) | |
_G["FAST_ADDON_" .. filename:Left(-5):upper()] = true | |
end | |
local function load_files(dir) | |
for _, luafile in pairs((file.Find(dir .. "/*.lua", "LUA"))) do | |
local path = string.format(dir .. "/%s", luafile) | |
MakeEnum(luafile) | |
include(path) | |
if SERVER then | |
AddCSLuaFile(path) | |
end | |
end | |
for _, luafile in pairs((file.Find(dir .. "/client/*.lua", "LUA"))) do | |
local path = string.format(dir .. "/client/%s", luafile) | |
if CLIENT then | |
MakeEnum(luafile) | |
include(path) | |
end | |
if SERVER then | |
AddCSLuaFile(path) | |
end | |
end | |
if SERVER then | |
for _, luafile in pairs((file.Find(dir .. "/server/*.lua", "LUA"))) do | |
MakeEnum(luafile) | |
include(string.format(dir .. "/server/%s", luafile)) | |
end | |
end | |
end | |
load_files("glib_mini_addons") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment