2007-02-05 10:06:20 +00:00
|
|
|
|
|
|
|
AddCSLuaFile( "autorun/client/cl_modelplug.lua" )
|
|
|
|
|
|
|
|
|
|
|
|
ModelPlugInfo = {}
|
|
|
|
|
2007-08-07 19:08:00 +00:00
|
|
|
--uncomment line 15 and line 26-34 to enable sending model packs to clients
|
2007-02-05 10:06:20 +00:00
|
|
|
|
2007-02-05 10:52:02 +00:00
|
|
|
function ModelPlug_Register(category)
|
2007-02-05 10:06:20 +00:00
|
|
|
if (not ModelPlugInfo[category]) then
|
|
|
|
local catinfo = {}
|
2007-08-07 19:08:00 +00:00
|
|
|
|
2007-02-05 10:06:20 +00:00
|
|
|
local packs = file.Find("WireModelPacks/*.txt")
|
|
|
|
for _,filename in pairs(packs) do
|
2007-02-05 19:33:47 +00:00
|
|
|
//resource.AddFile("data/WireModelPacks/" .. filename)
|
2007-02-05 10:06:20 +00:00
|
|
|
|
|
|
|
local packtbl = util.KeyValuesToTable(file.Read("WireModelPacks/" .. filename) or {})
|
2007-08-07 19:08:00 +00:00
|
|
|
|
2007-02-05 10:06:20 +00:00
|
|
|
for name,entry in pairs(packtbl) do
|
|
|
|
local categorytable = string.Explode(",", entry.categories or "none") or { "none" }
|
|
|
|
|
|
|
|
for _,cat in pairs(categorytable) do
|
|
|
|
if (cat == category) then
|
|
|
|
catinfo[name] = entry.model or ""
|
2007-08-07 19:08:00 +00:00
|
|
|
|
|
|
|
/*if (entry.model) then
|
|
|
|
resource.AddFile(entry.model)
|
|
|
|
end
|
|
|
|
|
|
|
|
if (entry.files) then
|
|
|
|
for _,extrafilename in pairs(entry.files) do
|
|
|
|
resource.AddFile(extrafilename)
|
|
|
|
end
|
|
|
|
end*/
|
|
|
|
|
2007-02-05 10:06:20 +00:00
|
|
|
break
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2007-08-07 19:08:00 +00:00
|
|
|
|
2007-02-05 10:06:20 +00:00
|
|
|
ModelPlugInfo[category] = catinfo
|
|
|
|
end
|
|
|
|
end
|