Skip to content

Instantly share code, notes, and snippets.

@AMD-NICK
Created September 22, 2016 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AMD-NICK/dc492adad7341cb4b3c83fbf08d42b04 to your computer and use it in GitHub Desktop.
Save AMD-NICK/dc492adad7341cb4b3c83fbf08d42b04 to your computer and use it in GitHub Desktop.
Переключалка скайбоксов для выбора более подходящего на карте
local ignore = {
["sky_day03_06b_hdr"] = true,
}
local skys = {}
for _,name in ipairs( file.Find("materials/skybox/*","GAME") ) do
local sb = string.StripExtension(name)
local skybox = string.sub(sb,0,-3)
if ignore[skybox] then continue end
skys[skybox] = true -- убираем дубликаты
end
print("Всего скайбоксов: " .. table.Count(skys))
local funcs = {}
for name in pairs(skys) do
funcs[#funcs + 1] = function()
print( ("--== СМЕНА SKYBOX НА %s ==--"):format(name) )
util.SetSkybox(name)
end
end
TL.startTask(3,funcs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment