Exemple #1
0
        private void buttonPatch_Click(object sender, EventArgs e)
        {
            try {
                bool removeTurboSkip    = checkBoxBattleAutoSkip.Checked;
                bool patchAudioThread   = checkBoxPatchAudioThread.Checked;
                int  audioThreadDivisor = 1000;
                bool fixVoiceTables     = checkBoxFixVoiceFileLang.Checked;
                bool patchBgmQueueing   = checkBoxBgmEnqueueingLogic.Checked;
                bool patchAssets        = checkBoxAssetPatches.Checked;

                var mods = new List <FileMod>();
                mods.AddRange(Sen2Mods.GetExecutableMods(
                                  removeTurboSkip: removeTurboSkip,
                                  patchAudioThread: patchAudioThread,
                                  audioThreadDivisor: audioThreadDivisor,
                                  patchBgmQueueing: patchBgmQueueing,
                                  correctLanguageVoiceTables: fixVoiceTables
                                  ));
                if (patchAssets)
                {
                    mods.AddRange(Sen2Mods.GetAssetMods());
                }

                GamePatchClass.RunPatch(new GamePatchClass(Path, Storage, mods));
            } catch (Exception ex) {
                MessageBox.Show("Unknown error occurred: " + ex.Message);
            }
        }
Exemple #2
0
        private void buttonPatch_Click(object sender, EventArgs e)
        {
            try {
                bool removeTurboSkip         = checkBoxBattleAutoSkip.Checked;
                bool allowR2NotebookShortcut = checkBoxAllowR2InTurboMode.Checked;
                int  turboKey                = comboBoxTurboModeKey.SelectedIndex;
                bool fixTextureIds           = checkBoxFixHdTextureId.Checked;
                bool fixVoiceTables          = checkBoxFixVoiceFileLang.Checked;
                bool patchAssets             = checkBoxAssetPatches.Checked;
                bool disableMouseCapture     = checkBoxDisableMouseCam.Checked;
                bool disablePauseOnFocusLoss = false;

                var mods = new List <FileMod>();
                mods.AddRange(Sen1Mods.GetExecutableMods(
                                  removeTurboSkip: removeTurboSkip,
                                  allowR2NotebookShortcut: allowR2NotebookShortcut,
                                  turboKey: turboKey,
                                  fixTextureIds: fixTextureIds,
                                  correctLanguageVoiceTables: fixVoiceTables,
                                  disableMouseCapture: disableMouseCapture,
                                  disablePauseOnFocusLoss: disablePauseOnFocusLoss
                                  ));
                if (patchAssets)
                {
                    mods.AddRange(Sen1Mods.GetAssetMods());
                }

                GamePatchClass.RunPatch(new GamePatchClass(Path, Storage, mods));
            } catch (Exception ex) {
                MessageBox.Show("Unknown error occurred: " + ex.Message);
            }
        }
Exemple #3
0
        public static void RunPatch(GamePatchClass patch)
        {
            var progressForm = new ProgressForm();

            patch.SetReporter(progressForm.GetProgressReporter());
            var thread = new System.Threading.Thread(patch.Run);

            thread.Start();
            progressForm.ShowDialog();

            thread.Join();
            var result = patch.Result;

            if (result.AllSuccessful)
            {
                MessageBox.Show(
                    "Successfully applied all selected patches.\n\n"
                    + "To remove the patches or a apply a different set of them, just run SenPatcher again.\n"
                    + "Note that 'senpatcher_rerun_revert_data.bin' in the game folder is required for this, so avoid deleting it.\n"
                    + "You can close SenPatcher now and just run the game as you normally would."
                    );
                return;
            }
            else
            {
                MessageBox.Show(
                    "Failed applying " + result.FailedFiles + " of the selected " + result.TotalFiles + " patches.\n"
                    + "Please ensure SenPatcher is allowed to write to the game directory, then try again.\n"
                    + "It's also possible that the game data is corrupted or has been modified by other mods. "
                    + "If so, try verifying game files on Steam or GoG, or reinstall the game. "
                    + "Be sure to close and reopen SenPatcher before trying again in this case."
                    );
            }
        }