// Created by L3D34N ->
// May cause problems when switching on/off

UI.AddCheckbox("Fps Boost");

function fps_boost()
{
    if (UI.GetValue("Misc", "JAVASCRIPT", "Script items", "Fps Boost"))
        {
            // Disable shadows ->
            Convar.SetString("r_shadows", "0");
            Convar.SetString("cl_csm_static_prop_shadows", "0");
            Convar.SetString("cl_csm_shadows", "0");
            Convar.SetString("cl_csm_world_shadows", "0");
            Convar.SetString("cl_foot_contact_shadows", "0");
            Convar.SetString("cl_csm_viewmodel_shadows", "0");
            Convar.SetString("cl_csm_rope_shadows", "0");
            Convar.SetString("cl_csm_sprite_shadows", "0");
            // Disable blood ->
            Convar.SetString("violence_hblood", "0");
        
            // Disable 3dsky ->
            Convar.SetString("r_3dsky", "0");

            // Disable decals ->
            //Convar.SetString("r_drawdecals", "0");

            // Disable rain ->
            Convar.SetString("r_drawrain", "0");
        
            // Disable ropes ->
            Convar.SetString("r_drawropes", "0");

            // Disable sprites ->
            Convar.SetString("r_drawsprites", "0");

            // Disable water fog ->
            Convar.SetString("fog_enable_water_fog", "0");
        }
        else
        {
            // Enable shadows ->
            Convar.SetString("r_shadows", "1");
            Convar.SetString("cl_csm_static_prop_shadows", "1");
            Convar.SetString("cl_csm_shadows", "1");
            Convar.SetString("cl_csm_world_shadows", "1");
            Convar.SetString("cl_foot_contact_shadows", "1");
            Convar.SetString("cl_csm_viewmodel_shadows", "1");
            Convar.SetString("cl_csm_rope_shadows", "1");
            Convar.SetString("cl_csm_sprite_shadows", "1");
        
            // Enable blood ->
            Convar.SetString("violence_hblood", "1");
        
            // Enable 3dsky ->
            Convar.SetString("r_3dsky", "1");

            // Enable decals ->
            //Convar.SetString("r_drawdecals", "1");

            // Enable rain ->
            Convar.SetString("r_drawrain", "1");
        
            // Enable ropes ->
            Convar.SetString("r_drawropes", "1");

            // Enable sprites ->
            Convar.SetString("r_drawsprites", "1");

            // Enable water fog ->
            Convar.SetString("fog_enable_water_fog", "1");
        }
}

// Callbacks
Cheat.RegisterCallback( "Draw", "fps_boost" );
