Ejemplo n.º 1
0
        private void b_reset1_Click(object sender, EventArgs e)
        {
            Profile.var_cg_fov      = 65.0f;
            Profile.var_cg_fovScale = 1.0f;

            CMD.ReadWrite(Profile.cg_fov, Profile.var_cg_fov);
            CMD.ReadWrite(Profile.cg_fovScale, Profile.var_cg_fovScale);

            b3.Value = SliderIn3(Profile.var_cg_fov);
            b4.Value = SliderIn2(Profile.var_cg_fovScale);

            t3.Text = Profile.var_cg_fov.ToString();
            t4.Text = Profile.var_cg_fovScale.ToString();
        }
Ejemplo n.º 2
0
 private void b4_Click(object sender, EventArgs e)
 {
     if (Profile.var_player_sprintCameraBob == 0f)
     {
         Profile.var_player_sprintCameraBob = 0.5f;
         CMD.ReadWrite(Profile.player_sprintCameraBob, Profile.var_player_sprintCameraBob);
         b4.ToggleButton(true);
     }
     else
     {
         Profile.var_player_sprintCameraBob = 0f;
         CMD.ReadWrite(Profile.player_sprintCameraBob, Profile.var_player_sprintCameraBob);
         b4.ToggleButton(false);
     }
 }
Ejemplo n.º 3
0
 private void b2_Click(object sender, EventArgs e)
 {
     if (!Profile.var_cg_laserForceOn)
     {
         Profile.var_cg_laserForceOn = true;
         CMD.ReadWrite(Profile.cg_laserForceOn, Profile.var_cg_laserForceOn);
         b2.ToggleButton(true);
     }
     else
     {
         Profile.var_cg_laserForceOn = false;
         CMD.ReadWrite(Profile.cg_laserForceOn, Profile.var_cg_laserForceOn);
         b2.ToggleButton(false);
     }
 }
Ejemplo n.º 4
0
 private void b1_Click(object sender, EventArgs e)
 {
     if (!Profile.var_cg_draw2D)
     {
         Profile.var_cg_draw2D = true;
         CMD.ReadWrite(Profile.cg_draw2D, Profile.var_cg_draw2D);
         b1.ToggleButton(true);
     }
     else
     {
         Profile.var_cg_draw2D = false;
         CMD.ReadWrite(Profile.cg_draw2D, Profile.var_cg_draw2D);
         b1.ToggleButton(false);
     }
 }
Ejemplo n.º 5
0
 private void b0_Click(object sender, EventArgs e)
 {
     if (!Profile.var_cg_drawFps)
     {
         Profile.var_cg_drawFps = true;
         CMD.ReadWrite(Profile.cg_drawFps, Profile.var_cg_drawFps);
         b0.ToggleButton(true);
     }
     else
     {
         Profile.var_cg_drawFps = false;
         CMD.ReadWrite(Profile.cg_drawFps, Profile.var_cg_drawFps);
         b0.ToggleButton(false);
     }
 }
Ejemplo n.º 6
0
 private void b7_Click(object sender, EventArgs e)
 {
     if (!Profile.var_r_normal)
     {
         Profile.var_r_normal = true;
         CMD.ReadWrite(Profile.r_normal, Profile.var_r_normal);
         b7.ToggleButton(true);
     }
     else
     {
         Profile.var_r_normal = false;
         CMD.ReadWrite(Profile.r_normal, Profile.var_r_normal);
         b7.ToggleButton(false);
     }
 }
Ejemplo n.º 7
0
 private void b1_Click(object sender, EventArgs e)
 {
     if (!Profile.var_r_specular)
     {
         Profile.var_r_specular = true;
         CMD.ReadWrite(Profile.r_specular, Profile.var_r_specular);
         b1.ToggleButton(true);
     }
     else
     {
         Profile.var_r_specular = false;
         CMD.ReadWrite(Profile.r_specular, Profile.var_r_specular);
         b1.ToggleButton(false);
     }
 }
Ejemplo n.º 8
0
 private void b4_Click(object sender, EventArgs e)
 {
     if (!Profile.var_r_drawDecals)
     {
         Profile.var_r_drawDecals = true;
         CMD.ReadWrite(Profile.r_drawDecals, Profile.var_r_drawDecals);
         b4.ToggleButton(true);
     }
     else
     {
         Profile.var_r_drawDecals = false;
         CMD.ReadWrite(Profile.r_drawDecals, Profile.var_r_drawDecals);
         b4.ToggleButton(false);
     }
 }
Ejemplo n.º 9
0
 private void b6_Click(object sender, EventArgs e)
 {
     if (!Profile.var_r_detail)
     {
         Profile.var_r_detail = true;
         CMD.ReadWrite(Profile.r_detail, Profile.var_r_detail);
         b6.ToggleButton(true);
     }
     else
     {
         Profile.var_r_detail = false;
         CMD.ReadWrite(Profile.r_detail, Profile.var_r_detail);
         b6.ToggleButton(false);
     }
 }
Ejemplo n.º 10
0
 private void b0_Click(object sender, EventArgs e)
 {
     if (!Profile.var_fx_enable)
     {
         Profile.var_fx_enable = true;
         CMD.ReadWrite(Profile.fx_enable, Profile.var_fx_enable);
         b0.ToggleButton(true);
     }
     else
     {
         Profile.var_fx_enable = false;
         CMD.ReadWrite(Profile.fx_enable, Profile.var_fx_enable);
         b0.ToggleButton(false);
     }
 }
Ejemplo n.º 11
0
        private void b_reset_Click(object sender, EventArgs e)
        {
            Profile.var_cg_gun_x = 0.0f;
            Profile.var_cg_gun_y = 0.0f;
            Profile.var_cg_gun_z = 0.0f;

            CMD.ReadWrite(Profile.cg_gun_x, Profile.var_cg_gun_x);
            CMD.ReadWrite(Profile.cg_gun_y, Profile.var_cg_gun_y);
            CMD.ReadWrite(Profile.cg_gun_z, Profile.var_cg_gun_z);

            b0.Value = SliderIn1(Profile.var_cg_gun_x);
            b1.Value = SliderIn1(Profile.var_cg_gun_y);
            b2.Value = SliderIn1(Profile.var_cg_gun_z);

            t0.Text = Profile.var_cg_gun_x.ToString();
            t1.Text = Profile.var_cg_gun_y.ToString();
            t2.Text = Profile.var_cg_gun_z.ToString();
        }
Ejemplo n.º 12
0
 private void b_toggle_Click(object sender, EventArgs e)
 {
     if (!Profile.var_r_filmUseTweaks)
     {
         Profile.var_r_filmTweakEnable = true;
         Profile.var_r_filmUseTweaks   = true;
         CMD.ReadWrite(Profile.r_filmTweakEnable, Profile.var_r_filmTweakEnable);
         CMD.ReadWrite(Profile.r_filmUseTweaks, Profile.var_r_filmUseTweaks);
         b_toggle.ToggleButton(true);
     }
     else
     {
         Profile.var_r_filmTweakEnable = false;
         Profile.var_r_filmUseTweaks   = false;
         CMD.ReadWrite(Profile.r_filmTweakEnable, Profile.var_r_filmTweakEnable);
         CMD.ReadWrite(Profile.r_filmUseTweaks, Profile.var_r_filmUseTweaks);
         b_toggle.ToggleButton(false);
     }
 }
Ejemplo n.º 13
0
 private void b2_Click(object sender, EventArgs e)
 {
     if (!Profile.var_r_fullbright)
     {
         Profile.var_r_fullbright = true;
         CMD.ReadWrite(Profile.r_fullbright, Profile.var_r_fullbright);
         CMD.Write(Profile.post_process, 1);
         CMD.Write(Profile.lighting, 4);
         CMD.Write(Profile.fx, 4);
         b2.ToggleButton(true);
     }
     else
     {
         Profile.var_r_fullbright = false;
         CMD.ReadWrite(Profile.r_fullbright, Profile.var_r_fullbright);
         CMD.Write(Profile.post_process, 3);
         CMD.Write(Profile.lighting, 7);
         CMD.Write(Profile.fx, 5);
         b2.ToggleButton(false);
     }
 }
Ejemplo n.º 14
0
        private void b_reset_Click(object sender, EventArgs e)
        {
            Profile.var_r_filmTweakLightTint[0] = 1.0f;
            Profile.var_r_filmTweakLightTint[1] = 1.0f;
            Profile.var_r_filmTweakLightTint[2] = 1.0f;
            Profile.var_r_filmTweakDarkTint[0]  = 1.0f;
            Profile.var_r_filmTweakDarkTint[1]  = 1.0f;
            Profile.var_r_filmTweakDarkTint[2]  = 1.0f;
            Profile.var_r_filmTweakBrightness   = 0.0f;
            Profile.var_r_filmTweakContrast     = 1.0f;
            Profile.var_r_filmTweakDesaturation = 0.0f;

            CMD.VectorReadWrite(Profile.r_filmTweakLightTint, Profile.var_r_filmTweakLightTint);
            CMD.VectorReadWrite(Profile.r_filmTweakDarkTint, Profile.var_r_filmTweakDarkTint);
            CMD.ReadWrite(Profile.r_filmTweakBrightness, Profile.var_r_filmTweakBrightness);
            CMD.ReadWrite(Profile.r_filmTweakContrast, Profile.var_r_filmTweakContrast);
            CMD.ReadWrite(Profile.r_filmTweakDesaturation, Profile.var_r_filmTweakDesaturation);

            b0_r.Value = SliderIn1(Profile.var_r_filmTweakLightTint[0]);
            b0_g.Value = SliderIn1(Profile.var_r_filmTweakLightTint[1]);
            b0_b.Value = SliderIn1(Profile.var_r_filmTweakLightTint[2]);
            b1_r.Value = SliderIn1(Profile.var_r_filmTweakDarkTint[0]);
            b1_g.Value = SliderIn1(Profile.var_r_filmTweakDarkTint[1]);
            b1_b.Value = SliderIn1(Profile.var_r_filmTweakDarkTint[2]);
            b6.Value   = SliderIn1(Profile.var_r_filmTweakBrightness);
            b7.Value   = SliderIn1(Profile.var_r_filmTweakContrast);
            b8.Value   = SliderIn1(Profile.var_r_filmTweakDesaturation);

            t0_r.Text = Profile.var_r_filmTweakLightTint[0].ToString();
            t0_g.Text = Profile.var_r_filmTweakLightTint[1].ToString();
            t0_b.Text = Profile.var_r_filmTweakLightTint[2].ToString();
            t1_r.Text = Profile.var_r_filmTweakDarkTint[0].ToString();
            t1_g.Text = Profile.var_r_filmTweakDarkTint[1].ToString();
            t1_b.Text = Profile.var_r_filmTweakDarkTint[2].ToString();
            t6.Text   = Profile.var_r_filmTweakBrightness.ToString();
            t7.Text   = Profile.var_r_filmTweakContrast.ToString();
            t8.Text   = Profile.var_r_filmTweakDesaturation.ToString();
        }
Ejemplo n.º 15
0
 private void b4_ValueChanged(object sender, EventArgs e)
 {
     t4.Text = Profile.var_cg_fovScale.ToString();
     Profile.var_cg_fovScale = SliderOut2(b4.Value);
     CMD.ReadWrite(Profile.cg_fovScale, Profile.var_cg_fovScale);
 }
Ejemplo n.º 16
0
 private void b3_ValueChanged(object sender, EventArgs e)
 {
     t3.Text            = Profile.var_cg_fov.ToString();
     Profile.var_cg_fov = SliderOut3(b3.Value);
     CMD.ReadWrite(Profile.cg_fov, Profile.var_cg_fov);
 }
Ejemplo n.º 17
0
 private void b2_ValueChanged(object sender, EventArgs e)
 {
     t2.Text = Profile.var_cg_gun_z.ToString();
     Profile.var_cg_gun_z = SliderOut1(b2.Value);
     CMD.ReadWrite(Profile.cg_gun_z, Profile.var_cg_gun_z);
 }
Ejemplo n.º 18
0
 private void b1_ValueChanged(object sender, EventArgs e)
 {
     t1.Text = Profile.var_cg_gun_y.ToString();
     Profile.var_cg_gun_y = SliderOut1(b1.Value);
     CMD.ReadWrite(Profile.cg_gun_y, Profile.var_cg_gun_y);
 }
Ejemplo n.º 19
0
 private void b0_ValueChanged(object sender, EventArgs e)
 {
     t0.Text = Profile.var_cg_gun_x.ToString();
     Profile.var_cg_gun_x = SliderOut1(b0.Value);
     CMD.ReadWrite(Profile.cg_gun_x, Profile.var_cg_gun_x);
 }
Ejemplo n.º 20
0
 private void b7_ValueChanged(object sender, EventArgs e)
 {
     Profile.var_r_filmTweakContrast = SliderOut1(b7.Value);
     t7.Text = Profile.var_r_filmTweakContrast.ToString();
     CMD.ReadWrite(Profile.r_filmTweakContrast, Profile.var_r_filmTweakContrast);
 }
Ejemplo n.º 21
0
 private void b8_ValueChanged(object sender, EventArgs e)
 {
     Profile.var_r_filmTweakDesaturation = SliderOut1(b8.Value);
     t8.Text = Profile.var_r_filmTweakDesaturation.ToString();
     CMD.ReadWrite(Profile.r_filmTweakDesaturation, Profile.var_r_filmTweakDesaturation);
 }
Ejemplo n.º 22
0
 private void b3_ValueChanged(object sender, EventArgs e)
 {
     Profile.var_r_specularMap = b3.Value;
     CMD.ReadWrite(Profile.r_specularMap, Profile.var_r_specularMap);
 }
Ejemplo n.º 23
0
 private void b6_ValueChanged(object sender, EventArgs e)
 {
     Profile.var_r_filmTweakBrightness = SliderOut1(b6.Value);
     t6.Text = Profile.var_r_filmTweakBrightness.ToString();
     CMD.ReadWrite(Profile.r_filmTweakBrightness, Profile.var_r_filmTweakBrightness);
 }
Ejemplo n.º 24
0
        /// <summary>
        /// Task to loop the injection, also saves changes to XML Profile.
        /// </summary>
        /// <param name="Token">Token Cancellation</param>
        public static async void Init(CancellationToken Token)
        {
            while (!Token.IsCancellationRequested)
            {
                // Fullbright State
                if (Profile.var_r_fullbright)
                {
                    CMD.Write(Profile.post_process, 1);
                    CMD.Write(Profile.lighting, 4);
                    CMD.Write(Profile.fx, 4);
                }
                else
                {
                    CMD.Write(Profile.post_process, 3);
                    CMD.Write(Profile.lighting, 7);
                    CMD.Write(Profile.fx, 5);
                }

                // Allow Vision
                if (Profile.var_r_filmUseTweaks)
                {
                    Profile.var_r_filmTweakEnable = true;
                }
                else
                {
                    Profile.var_r_filmTweakEnable = false;
                }

                // Exec all command using Reflection
                foreach (string cmd in Profile.Commands)
                {
                    FieldInfo cmd_a = typeof(Profile).GetField(cmd);
                    FieldInfo cmd_v = typeof(Profile).GetField("var_" + cmd);
                    object    obj_a = cmd_a.GetValue(null);
                    object    obj_v = cmd_v.GetValue(null);

                    switch (true)
                    {
                    case true when obj_v.GetType() == typeof(bool):
                        CMD.ReadWrite((uint[])obj_a, (bool)obj_v);

                        break;

                    case true when obj_v.GetType() == typeof(float):
                        CMD.ReadWrite((uint[])obj_a, (float)obj_v);

                        break;

                    case true when obj_v.GetType() == typeof(int):
                        CMD.ReadWrite((uint[])obj_a, (int)obj_v);

                        break;

                    case true when obj_v.GetType() == typeof(bool[]):
                        CMD.VectorReadWrite((uint[])obj_a, (bool[])obj_v);

                        break;

                    case true when obj_v.GetType() == typeof(float[]):
                        CMD.VectorReadWrite((uint[])obj_a, (float[])obj_v);

                        break;

                    case true when obj_v.GetType() == typeof(int[]):
                        CMD.VectorReadWrite((uint[])obj_a, (int[])obj_v);

                        break;
                    }
                }
                Xml.Save();
                await Task.Delay(1000);
            }
        }