Esempio n. 1
0
        private void launchCine_Click(object sender, EventArgs e)
        {
            CinematicMod cineMod = new CinematicMod(this, r2Process);

            float speedValue = speedBar.Value / 100000f;

            enableCineCommands(false);
            stopButton.Enabled = true;
            checkBox1.Enabled  = false;

            Action onCompleted = () =>
            {
                Invoke(new Action(() =>
                {
                    stopButton.Enabled = false;
                    checkBox1.Enabled  = true;
                    enableCineCommands(true);
                    cineMod.ChangeFOV(fovBar.Value / 10f);
                }));
            };

            cinematicThread = new Thread(() =>
            {
                try
                {
                    cineMod.LaunchCinematic(speedValue);
                }
                finally
                {
                    onCompleted();
                }
            });

            cinematicThread.Start();
        }
Esempio n. 2
0
        private void addKey_Click(object sender, EventArgs e)
        {
            float fovFloatValue = fovBar.Value / 10f;

            CinematicMod cineMod = new CinematicMod(this, r2Process);

            cineMod.AddKeyPoint(fovFloatValue);
        }
Esempio n. 3
0
        private void trackBar1_Scroll(object sender, EventArgs e)
        {
            float fovFloatValue = fovBar.Value / 10f;

            fovValue.Text = "FOV: " + fovFloatValue.ToString();

            CinematicMod cineMod = new CinematicMod(this, r2Process);

            cineMod.ChangeFOV(fovFloatValue);
        }
Esempio n. 4
0
        private void setDefaultFOV_Click(object sender, EventArgs e)
        {
            fovBar.Value = 12;
            float fovFloatValue = fovBar.Value / 10f;

            fovValue.Text = "FOV: " + fovFloatValue.ToString();

            CinematicMod cineMod = new CinematicMod(this, r2Process);

            cineMod.ChangeFOV(fovFloatValue);
        }
Esempio n. 5
0
        private void stopButton_Click(object sender, EventArgs e)
        {
            if (cinematicThread.IsAlive)
            {
                cinematicThread.Abort();

                CinematicMod cineMod = new CinematicMod(this, r2Process);
                stopButton.Enabled = false;
                checkBox1.Enabled  = true;
                enableCineCommands(true);
                cineMod.ChangeFOV(fovBar.Value / 10f);
            }
        }
Esempio n. 6
0
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            CinematicMod cineMod = new CinematicMod(this, r2Process);

            if (checkBox1.Checked)
            {
                CineModEnabled = true;
                enableCineCommands(true);

                cineMod.ChangeFOV(fovBar.Value / 10f);
                cineMod.EnableCinematicMod();
            }
            else
            {
                CineModEnabled = false;
                enableCineCommands(false);

                cineMod.DisableCinematicMod();
            }
        }
Esempio n. 7
0
        private void clearKeys_Click(object sender, EventArgs e)
        {
            CinematicMod cineMod = new CinematicMod(this, r2Process);

            cineMod.ClearKeyPoints();
        }
Esempio n. 8
0
        void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            CinematicMod cineMod = new CinematicMod(this, r2Process);

            cineMod.DisableCinematicMod();
        }
Esempio n. 9
0
        private void OnKeyPressed(object sender, GlobalKeyboardHookEventArgs e)
        {
            if (CineModEnabled)
            {
                CinematicMod cineMod = new CinematicMod(this, r2Process);

                // Only handle key down
                if (e.KeyboardState != GlobalKeyboardHook.KeyboardState.KeyDown)
                {
                    return;
                }

                // P
                if (e.KeyboardData.VirtualCode == 0x50)
                {
                    cineMod.AddKeyPoint(fovBar.Value / 10f);
                }
                // O
                if (e.KeyboardData.VirtualCode == 0x4F)
                {
                    cineMod.MoveCamera("forward");
                }
                // L
                if (e.KeyboardData.VirtualCode == 0x4C)
                {
                    cineMod.MoveCamera("backward");
                }
                // K
                if (e.KeyboardData.VirtualCode == 0x4B)
                {
                    cineMod.MoveCamera("left");
                }
                // M
                if (e.KeyboardData.VirtualCode == 0x4D)
                {
                    cineMod.MoveCamera("right");
                }
                // PAGE UP
                if (e.KeyboardData.VirtualCode == 0x21)
                {
                    cineMod.MoveCamera("upward");
                }
                // PAGE DOWN
                if (e.KeyboardData.VirtualCode == 0x22)
                {
                    cineMod.MoveCamera("downward");
                }
                // I
                if (e.KeyboardData.VirtualCode == 0x49)
                {
                    cineMod.MoveCamera("yawRight");
                }
                // U
                if (e.KeyboardData.VirtualCode == 0x55)
                {
                    cineMod.MoveCamera("yawLeft");
                }
                // Y
                if (e.KeyboardData.VirtualCode == 0x59)
                {
                    cineMod.MoveCamera("pitchUp");
                }
                // H
                if (e.KeyboardData.VirtualCode == 0x48)
                {
                    cineMod.MoveCamera("pitchDown");
                }
                // N
                if (e.KeyboardData.VirtualCode == 0x42)
                {
                    cineMod.MoveCamera("rollClockW");
                }
                // B
                if (e.KeyboardData.VirtualCode == 0x4E)
                {
                    cineMod.MoveCamera("rollAntiClockW");
                }
            }
        }