/// <summary> /// 開始ボタン押下時の処理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnStartButtonClick(object sender, EventArgs e) { if (!File.Exists(PatchController.TargetFileName)) { return; } saveButton.Enabled = PatchController.AutoMode ? PatchController.AutoProcess() : PatchController.Patch(); }
/// <summary> /// 保存ボタン押下時の処理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnSaveButtonClick(object sender, EventArgs e) { if (!File.Exists(PatchController.TargetFileName)) { return; } PatchController.Save(); PatchController.CopyDll(); }
public static void Main() { if (!PatchController.CheckDll()) { return; } if (PatchController.ParseCommandLine()) { PatchController.AutoProcess(); } else { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } }
/// <summary> /// 参照ボタン押下時の処理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnBrowseButtonClick(object sender, EventArgs e) { OpenFileDialog dialog = new OpenFileDialog(); if (dialog.ShowDialog() == DialogResult.Cancel) { return; } pathTextBox.Text = dialog.FileName; // 自動判別処理 if (typeComboBox.SelectedIndex == 0) { PatchController.DetectGameType(pathTextBox.Text); typeComboBox.SelectedIndex = PatchController.GetGameIndex(); } // 自動処理モード if (PatchController.AutoMode) { saveButton.Enabled = PatchController.AutoProcess(); } }
/// <summary> /// ファイルをドロップした時の処理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnFormDragDrop(object sender, DragEventArgs e) { string fileName = ((string[])e.Data.GetData(DataFormats.FileDrop, false))[0]; // フォルダをドロップした場合はその下の実行ファイルを対象とする if (Directory.Exists(fileName)) { fileName = PatchController.DetectExeFileName(fileName); } pathTextBox.Text = fileName; // 自動判別処理 if (typeComboBox.SelectedIndex == 0) { PatchController.DetectGameType(pathTextBox.Text); typeComboBox.SelectedIndex = PatchController.GetGameIndex(); } // 自動処理モード if (PatchController.AutoMode) { saveButton.Enabled = PatchController.AutoProcess(); } }
/// <summary> /// パッチの種類が変更された時の処理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnTypeComboBoxSelectedIndexChanged(object sender, EventArgs e) { PatchController.SetGameType(typeComboBox.SelectedIndex); autoLineBreakCheckBox.Enabled = PatchController.GetAutoLineBreakEffective(); wordOrderCheckBox.Enabled = PatchController.GetWordOrderEffective(); windowedCheckBox.Enabled = PatchController.GetWindowedEffective(); introSkipCheckBox.Enabled = PatchController.GetIntroSkipEffective(); ntlCheckBox.Enabled = PatchController.GetNtlEffective(); if (PatchController.GetWordOrderDefault()) { if (!wordOrderCheckBox.Checked) { wordOrderCheckBox.Checked = true; } } else { if (!PatchController.GetWordOrderEffective() && wordOrderCheckBox.Checked) { wordOrderCheckBox.Checked = false; } } if (!PatchController.GetWindowedEffective() && windowedCheckBox.Checked) { windowedCheckBox.Checked = false; } if (!PatchController.GetIntroSkipEffective() && introSkipCheckBox.Checked) { introSkipCheckBox.Checked = false; } if (!PatchController.GetNtlEffective() && ntlCheckBox.Checked) { ntlCheckBox.Checked = false; } }