private void SimpleFireButton_Click(object sender, EventArgs e) { if (InputFormRef.IsPleaseWaitDialog(this)) {//2重割り込み禁止 return; } //翻訳言語 string from = U.InnerSplit(Translate_from.Text, "=", 0); string to = U.InnerSplit(Translate_to.Text, "=", 0); string fromrom = SimpleTranslateFromROMFilename.Text; string torom = SimpleTranslateToROMFilename.Text; if (from == to) { return; } ToolTranslateROM trans = new ToolTranslateROM(); trans.ApplyTranslatePatch(to); Undo.UndoData undodata = Program.Undo.NewUndoData("Import TransFile Simple"); //翻訳データがある場合は適用する. string translateDataFilename = SimpleTranslateToTranslateDataFilename.Text; if (SIMPLE_OVERRAIDE_JPFONT.Checked) { trans.WipeJPClassReelFont(undodata); trans.WipeJPTitle(undodata); trans.WipeJPFont(this, undodata); } if (File.Exists(translateDataFilename)) { trans.ImportAllText(this, translateDataFilename, undodata); } //それ以外のデータの翻訳 { string writeTextFileName = Path.GetTempFileName(); trans.ExportallText(this, writeTextFileName, from, to, fromrom, torom, false, false); trans.ImportAllText(this, writeTextFileName, undodata); trans.ImportFont(this, torom, true, FontAutoGenelateCheckBox.Font, undodata); File.Delete(writeTextFileName); } trans.BlackOut(undodata); Program.Undo.Push(undodata); R.ShowOK("完了"); this.Close(); }
private void SimpleFireButton_Click(object sender, EventArgs e) { if (InputFormRef.IsPleaseWaitDialog(this)) {//2重割り込み禁止 return; } //翻訳言語 string from = U.InnerSplit(Translate_from.Text, "=", 0); string to = U.InnerSplit(Translate_to.Text, "=", 0); string fromrom = SimpleTranslateFromROMFilename.Text; string torom = SimpleTranslateToROMFilename.Text; ToolTranslateROM trans = new ToolTranslateROM(); trans.ApplyTranslatePatch(to); //翻訳データがある場合は適用する. string translateDataFilename = SimpleTranslateToTranslateDataFilename.Text; if (File.Exists(translateDataFilename)) { trans.ImportAllText(this, translateDataFilename); } if (from == to) { return; } //それ以外のデータの翻訳 { string writeTextFileName = Path.GetTempFileName(); trans.ExportallText(this, writeTextFileName, from, to, fromrom, torom, false, false); trans.ImportAllText(this, writeTextFileName); ToolTranslateROMFont transFont = new ToolTranslateROMFont(); transFont.ImportFont(this, torom, true, FontAutoGenelateCheckBox.Font); File.Delete(writeTextFileName); } R.ShowOK("完了"); this.Close(); }
private void ExportallTextButton_Click(object sender, EventArgs e) { if (InputFormRef.IsPleaseWaitDialog(this)) {//2重割り込み禁止 return; } string from = ""; string to = ""; string fromrom = ""; string torom = ""; bool useGoolgeTranslate = false; if (useAutoTranslateCheckBox.Checked) { //翻訳言語 from = U.InnerSplit(Translate_from.Text, "=", 0); to = U.InnerSplit(Translate_to.Text, "=", 0); if (from == to) { return; } fromrom = TranslateFormROMFilename.Text; torom = TranslateToROMFilename.Text; if (!File.Exists(fromrom)) { return; } if (!File.Exists(torom)) { return; } useGoolgeTranslate = false; } ToolTranslateROM trans = new ToolTranslateROM(); trans.ExportallText(this, useAutoTranslateCheckBox.Checked, from, to, fromrom, torom, useGoolgeTranslate, X_MODIFIED_TEXT_ONLY.Checked, X_ONELINER_CHECK.Checked); }