Material.Create("Bubble");
function createMenuItems()
{
UI.AddSliderFloat("Cut Scale", 0, 3);
UI.AddSliderFloat("Environment Bloom", 0, 1);
UI.AddSliderInt("Pearlescence", 0, 100);
}
function updateMaterials()
{
var pearl = UI.GetValue("Script items", "Pearlescence") / 10;
var scale = UI.GetValue("Script items", "Cut Scale");
var bright = UI.GetValue("Script items", "Environment Bloom");
mat_index = Material.Get("Bubble");
if (mat_index > 0)
{
Material.SetKeyValue(mat_index, "$basetexture", "vgui/white");
Material.SetKeyValue(mat_index, "$envmap", "models/effects/bubble");
Material.SetKeyValue(mat_index, "$envmaptint", "[" + " " + bright + " " + bright + " " + bright + "]");
Material.SetKeyValue(mat_index, "$envmapfresnel", "1");
Material.SetKeyValue(mat_index, "$envmapfresnelminmaxexp", "[0 1 2]");
Material.SetKeyValue(mat_index, "$phong", "1");
Material.SetKeyValue(mat_index, "$pearlescent", pearl.toString());
Material.SetKeyValue(mat_index, "$reflectivity", "[2 2 2]");
Material.SetKeyValue(mat_index, "$bumpmap", "models/weapons/customization/materials/origamil_camo");
Material.SetKeyValue(mat_index, "$bumptransform", "center .5 .5 scale" + " " + scale + " " + scale + "rotate 0 translate 0 0");
Material.Refresh(mat_index);
}
}
function onUnload()
{
Material.Destroy("Bubble");
}
createMenuItems();
Cheat.RegisterCallback("Material", "updateMaterials");
Cheat.RegisterCallback("Unload", "onUnload");