summaryrefslogtreecommitdiff
path: root/gamemode/cl_various/material.lua
blob: bd48612c7115f4787d6e5c0dd8448791d413c594 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
local SourceSkyname = GetConVar("sv_skyname"):GetString() --We need the source of the maps original skybox texture so we can manipulate it.
local SourceSkyPre  = {"lf","ft","rt","bk","dn","up",}
local SourceSkyMat  = {
	Material("skybox/"..SourceSkyname.."lf"),
	Material("skybox/"..SourceSkyname.."ft"),
	Material("skybox/"..SourceSkyname.."rt"),
	Material("skybox/"..SourceSkyname.."bk"),
	Material("skybox/"..SourceSkyname.."dn"),
	Material("skybox/"..SourceSkyname.."up"),
}

function ChangeSkybox(skyboxname)
	for i = 1,6 do
		local D = Material("skybox/"..skyboxname..SourceSkyPre[i]):GetTexture("$basetexture")
		SourceSkyMat[i]:SetTexture("$basetexture",D)
	end
end