public void Wipe(List <Address> list) { if (Program.ROM.RomInfo.version != 8) { return; } //Chapter Name to Text パッチをインストールする bool r = HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.ChapterNameText); if (!r) { return; } //最後の一つを残して全消去 List <U.AddrResult> alist = ImageChapterTitleForm.MakeList(); if (alist.Count <= 1) { return; } uint addr; addr = alist[alist.Count - 1].addr; if (!U.isSafetyOffset(addr)) { return; } uint lastChapterNameImageAddr = Program.ROM.u32(addr + 0); for (int i = 0; i < alist.Count; i++) { addr = alist[i].addr; uint a = Program.ROM.u32(addr + 0); if (a != lastChapterNameImageAddr) { FEBuilderGBA.Address.AddLZ77Pointer(list , addr + 0 , "Chapter_Save" , false , FEBuilderGBA.Address.DataTypeEnum.LZ77IMG); Program.ROM.write_u32(addr + 0, lastChapterNameImageAddr, this.UndoData); } FEBuilderGBA.Address.AddLZ77Pointer(list , addr + 4 , "Chapter_Number" , false , FEBuilderGBA.Address.DataTypeEnum.LZ77IMG); FEBuilderGBA.Address.AddLZ77Pointer(list , addr + 8 , "Chapter_Title" , false , FEBuilderGBA.Address.DataTypeEnum.LZ77IMG); Program.ROM.write_u32(addr + 4, 0, this.UndoData); Program.ROM.write_u32(addr + 8, 0, this.UndoData); } }
private void AddressList_SelectedIndexChanged(object sender, EventArgs e) { this.Tracks = SongUtil.ParseTrack((uint)Address.Value, (uint)B0.Value); for (int i = 0; i < this.TrackListBoxs.Length; i++) { if (Tracks.Count > i) { SongUtil.TrackToListBox(this.TrackListBoxs[i], Tracks[i]); InputFormRef.markupJumpLabel(this.TrackLabels[i]); } else { this.TrackListBoxs[i].Items.Clear(); InputFormRef.unmarkupJumpLabel(this.TrackLabels[i]); } } if (this.Tracks.Count >= 12) {//このトラックは再生できますか? if (Program.ROM.RomInfo.version() >= 7 && Program.ROM.RomInfo.version() <= 8) { HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.Track12_Over_By_SongTrack); } } }
private void SkillAssignmentClassButton_Click(object sender, EventArgs e) { if (PatchUtil.skill_system_enum.NO == PatchUtil.SearchSkillSystem()) { HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.Anti_Huffman_By_Translate); HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.Skill); } PatchUtil.skill_system_enum skill = PatchUtil.SearchSkillSystem(); if (skill == PatchUtil.skill_system_enum.SkillSystem) { InputFormRef.JumpForm <SkillAssignmentClassSkillSystemForm>(); } else if (skill == PatchUtil.skill_system_enum.FE8N_ver2) { InputFormRef.JumpForm <SkillConfigFE8NVer2SkillForm>(); } else if (skill == PatchUtil.skill_system_enum.FE8N || skill == PatchUtil.skill_system_enum.yugudora) { //NOP R.ShowStopError(R._("この機能は、FE8NVer2からのみ利用できます。")); } else { R.ShowStopError(R._("スキル拡張がありません。\r\nスキル拡張パッチをインストールしてから利用してください。")); } }
private void SkillConfigButton_Click(object sender, EventArgs e) { if (PatchUtil.skill_system_enum.NO == PatchUtil.SearchSkillSystem()) { HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.Skill); } PatchUtil.skill_system_enum skill = PatchUtil.SearchSkillSystem(); if (skill == PatchUtil.skill_system_enum.SkillSystem) { InputFormRef.JumpForm <SkillConfigSkillSystemForm>(); } else if (skill == PatchUtil.skill_system_enum.FE8N || skill == PatchUtil.skill_system_enum.yugudora || skill == PatchUtil.skill_system_enum.FE8N_ver2 ) { InputFormRef.JumpForm <SkillConfigFE8NSkillForm>(); } else if (skill == PatchUtil.skill_system_enum.FE8N_ver3) { } else { R.ShowStopError(R._("スキル拡張がありません。\r\nスキル拡張パッチをインストールしてから利用してください。")); } }
private void SongTrackImportMidiForm_Load(object sender, EventArgs e) { if (!HasNIMAP()) { HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.NIMAP_By_SongTrack); PickupInstrument(); } if (OptionForm.GetMidfix4agb() == "") { UseMidfix4agb_checkBox.Hide(); WARNING_midfix4agb_label.Show(); } else { WARNING_midfix4agb_label.Hide(); UseMidfix4agb_checkBox.Show(); } if (MainFormUtil.CanUseMID2AGB()) { //mid2agbを利用できる. if (OptionForm.midi_importer() == OptionForm.midi_importer_enum.MID2AGB) { //mid2agbがディフォルト this.tabControl1.SelectedIndex = 1; } } else {//mid2agbを利用できない. Explain_mid2agb.Text = R._("mid2agbが設定されていません。\r\n設定画面より、mid2agbの設定をしてください。"); Mid2AGBOKButton.Enabled = false; this.tabControl1.SelectedIndex = 0; } Mid2agbV.Value = 80; //Mid2agbR.SelectedIndex = 0; }
private void ImageMagicButton_Click(object sender, EventArgs e) { HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.MagicPatch_By_Menu); ImageUtilMagic.magic_system_enum magic = ImageUtilMagic.SearchMagicSystem(); if (magic == ImageUtilMagic.magic_system_enum.FEDITOR_ADV) { InputFormRef.JumpForm <ImageMagicFEditorForm>(); } else if (magic == ImageUtilMagic.magic_system_enum.CSA_CREATOR) { InputFormRef.JumpForm <ImageMagicCSACreatorForm>(); } }
public static void OnPreClassExtendsWarningHandler(object sender, EventArgs e) { InputFormRef.ExpandsEventArgs eventarg = (InputFormRef.ExpandsEventArgs)e; bool r = HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.ExtendedMovingMapAnimationList); if (!r) { DialogResult dr = R.ShowNoYes("拡張した領域にある移動アニメーションを利用するには、移動アニメーション拡張のパッチが別途必要です。\r\n移動アニメーションを拡張してもよろしいですか?\r\n"); if (dr != DialogResult.Yes) {//キャンセル. eventarg.IsCancel = true; return; } } }
//リストが拡張されたとき void AddressListExpandsUpdateBaristaAnimationAddress(object sender, EventArgs arg) { InputFormRef.ExpandsEventArgs eearg = (InputFormRef.ExpandsEventArgs)arg; uint addr = eearg.NewBaseAddress; int count = (int)eearg.NewDataCount; Program.ROM.write_p32( Program.ROM.RomInfo.unit_wait_barista_anime_address , addr + 0x2 + (0x8 * Program.ROM.RomInfo.unit_wait_barista_id) ); if (count > 128) { HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.ExtendedMovingMapAnimationList); } }
public void MeleeAndMagicFix() { if (this.InputFormRef != null && this.InputFormRef.IsUpdateLock) { return; } if (PatchUtil.SearchMeleeAndMagicFixPatch()) { return; } bool useMelee = (B20.Value > 0 || B21.Value > 0 || B22.Value > 0 || B23.Value > 0); bool useMagic = (B24.Value > 0 || B25.Value > 0 || B26.Value > 0 || B27.Value > 0); if (useMelee && useMagic) { HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.MeleeAndMagicFix_By_Unit); } }
private void ItemIconListExpandsButton_Click(object sender, EventArgs e) { DialogResult dr = R.ShowNoYes("拡張した領域にあるアイテムアイコンを利用するには、アイテムアイコン拡張のパッチが別途必要です。\r\nアイテムアイコンを拡張してもよろしいですか?\r\n"); if (dr != System.Windows.Forms.DialogResult.Yes) { return; } HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.ItemIconExpands); Undo.UndoData undodata = Program.Undo.NewUndoData(this, "expands"); uint newaddr = ExpandsArea(this, 0xFF, undodata); if (newaddr == U.NOT_FOUND) { Program.Undo.Rollback(undodata); R.ShowStopError("アイテムアイコンテーブルの拡張に失敗しました。"); return; } Program.Undo.Push(undodata); InputFormRef.ReOpenForm <ImageItemIconForm>(); }
public static bool CheckAndShowPopupDialog(TYPE type) { Func <bool> checkFunc = null; string reason = ""; string patchName1 = ""; string patchName2 = ""; string patchShowName = null; string patchCombo = ""; if (type == TYPE.Anti_Huffman_By_Translate) { checkFunc = PatchUtil.SearchAntiHuffmanPatch; reason = R._("翻訳された文章がハフマン符号化テーブルを超えている可能性があります。\r\nAntiHuffmanPatchを適応しておくことをお勧めします。"); patchName1 = "Anti-Huffman";///No Translate } if (type == TYPE.Anti_Huffman_By_English) { checkFunc = PatchUtil.SearchAntiHuffmanPatch; reason = R._("英語版で、テキストを変更するためには、Anti-Huffman Patchが必要です。"); patchName1 = "Anti-Huffman";///No Translate } else if (type == TYPE.C01Hack_By_ImageBattleAnimation) { checkFunc = PatchUtil.SearchC01HackPatch; reason = R._("このアニメーションには、C01 命令が使われています。\r\n現在、C01ハックパッチは、まだインストールされていません。\r\nアニメーションを再生するためには、\r\nC01ハックを有効にした方がいいと思われますが、どうしますか?\r\n"); patchName1 = "01command_hack"; ///No Translate patchName2 = "01コマンドハック"; ///No Translate } else if (type == TYPE.C48Hack_By_ImageBattleAnimation) { checkFunc = PatchUtil.SearchC48HackPatch; reason = R._("このアニメーションには、C48 命令(or Sxx命令)が使われています。\r\n現在、C48ハックパッチは、まだインストールされていません。\r\nアニメーションを再生するためには、\r\nC48ハックを有効にした方がいいと思われますが、どうしますか?\r\n"); patchName1 = "48command_hack"; ///No Translate patchName2 = "48コマンドハック"; ///No Translate } else if (type == TYPE.NIMAP_By_SongTrack) { checkFunc = PatchUtil.SearchNIMAP; reason = R._("Midi楽器はFE楽器と並び順が違うので、\r\nNIMAPを利用することをお勧めします。"); if (Program.ROM.RomInfo.version() == 8) { //FE8用には更新されたバージョンを利用する. patchName1 = "SOUND_NIMAP2(Native Instrument Map)"; ///No Translate patchName2 = "SOUND_NIMAP2"; ///No Translate } else { patchName1 = "SOUND_NIMAP(Native Instrument Map)"; ///No Translate patchName2 = "SOUND_NIMAP"; ///No Translate } } else if (type == TYPE.Track12_Over_By_SongTrack) { checkFunc = PatchUtil.Search16tracks12soundsPatch; reason = R._("この楽曲の楽譜は、12以上のトラックが存在しています。\r\nこの曲をゲームで再生するには、16_tracks_12_soundsが必要です。\r\nこのパッチを適応しますか?"); patchName1 = "16_tracks_12_sounds";///No Translate } else if (type == TYPE.MeleeAndMagicFix_By_Unit) { checkFunc = PatchUtil.SearchMeleeAndMagicFixPatch; reason = R._("武器と魔法を同時に利用するにはMeleeAndMagicPatchが必要です。\r\n有効にしますか?"); patchName1 = "MeleeAndMagicFix";///No Translate } else if (type == TYPE.ItemIconExpands) { checkFunc = PatchUtil.SearchIconExpandsPatch; reason = R._("アイコンを拡張するには、テーブルを拡張する前にパッチを適応する必要があります。\r\n有効にしますか?"); patchName1 = "Extended to item icon 0xFE"; ///No Translate patchName2 = "Extend Item Icon List Length"; ///No Translate patchCombo = "fix"; } else if (type == TYPE.MagicPatch_By_Menu) { return(HowDoYouLikePatch2Form.CheckAndShowPopupDialog(HowDoYouLikePatch2Form.TYPE.MagicPatch_By_Menu)); } else if (type == TYPE.Skill) { if (Program.ROM.RomInfo.version() != 8) { return(false); } if (Program.ROM.RomInfo.is_multibyte()) { checkFunc = () => { PatchUtil.skill_system_enum a = PatchUtil.SearchSkillSystem(); return(a == PatchUtil.skill_system_enum.FE8N || a == PatchUtil.skill_system_enum.FE8N_ver2 || a == PatchUtil.skill_system_enum.yugudora ); }; reason = R._("スキル拡張 FE8N が必要です。\r\n有効にしますか?"); patchName1 = "Skill Extension FE8N 2019_02_19"; ///No Translate patchName2 = "skill_2019_02_19"; ///No Translate } else { checkFunc = () => { return(PatchUtil.SearchSkillSystem() == PatchUtil.skill_system_enum.SkillSystem); }; reason = R._("スキル拡張 SkillSystems が必要です。\r\n有効にしますか?"); patchName1 = "Skill20200223"; ///No Translate patchName2 = "Skill20200223"; ///No Translate } } else if (type == TYPE.SkipWorldmapFix) { if (Program.ROM.RomInfo.version() != 8) { return(false); } checkFunc = () => { return(PatchUtil.SearchSkipWorldMapPatch() != PatchUtil.mnc2_fix_enum.NO); }; reason = R._("FE8のマップをワールドマップを経由しないで移動させるには、パッチが必要です。\r\n有効にしますか?"); patchName1 = "MNC2Fix"; ///No Translate patchName2 = "MNC2Fix"; ///No Translate patchShowName = "Skip Worldmap"; patchCombo = "fix"; } else if (type == TYPE.CAMERA_Event_OutOfBand_Fix) { if (Program.ROM.RomInfo.version() != 8) { return(false); } checkFunc = () => { return(PatchUtil.SearchCAMERA_Event_OutOfBand_FixPatch()); }; reason = R._("カメラを移動する命令で、画面外に飛び出してしまうバグを修正するパッチをインストールしますか?"); patchName1 = "Fix CAM1_CAMERA2 going out of bounds"; ///No Translate patchName2 = "Fix CAM1_CAMERA2 going out of bounds"; ///No Translate patchShowName = "Fix CAM1_CAMERA2 going out of bounds"; patchCombo = "Fix"; } else if (type == TYPE.CAMERA_Event_NotExistsUnit_Fix) { if (Program.ROM.RomInfo.version() != 8) { return(false); } checkFunc = () => { return(PatchUtil.SearchCAMERA_Event_NotExistsUnit_FixPatch()); }; reason = R._("存在しないユニットを指定した時にフリーズするバグを修正するパッチをインストールしますか?"); patchName1 = "Event26_CameraControlMaybe_Fix not to freeze even nonexistent units"; ///No Translate patchName2 = "Event26_CameraControlMaybe_Fix not to freeze even nonexistent units"; ///No Translate patchShowName = "Event26_CameraControlMaybe_Fix not to freeze even nonexistent units"; patchCombo = "Fix"; } else if (type == TYPE.UnitStateEvent_0x34_Fix) { if (Program.ROM.RomInfo.version() != 8) { return(false); } checkFunc = () => { return(PatchUtil.SearchUnitStateEvent_0x34_FixPatch()); }; reason = R._("存在しないユニットを指定した時にフリーズするバグを修正するパッチをインストールしますか?"); patchName1 = "Event34_MessWithUnitState_Fix not to freeze even nonexistent units"; ///No Translate patchName2 = "Event34_MessWithUnitState_Fix not to freeze even nonexistent units"; ///No Translate patchShowName = "Event34_MessWithUnitState_Fix not to freeze even nonexistent units"; patchCombo = "Fix"; } else if (type == TYPE.WakuEvent_0x3B_Fix) { if (Program.ROM.RomInfo.version() != 8) { return(false); } checkFunc = () => { return(PatchUtil.SearchWakuEvent_0x3B_FixPatch()); }; reason = R._("存在しないユニットを指定した時にフリーズするバグを修正するパッチをインストールしますか?"); patchName1 = "Event3B_frame_Fix not to freeze even nonexistent units"; ///No Translate patchName2 = "Event3B_frame_Fix not to freeze even nonexistent units"; ///No Translate patchShowName = "Event3B_frame_Fix not to freeze even nonexistent units"; patchCombo = "Fix"; } Debug.Assert(checkFunc != null); Debug.Assert(patchName1 != ""); Debug.Assert(reason != ""); if (checkFunc()) {//すでに適応されている. return(true); } if (patchShowName == null) { patchShowName = patchName1; } HowDoYouLikePatchForm f = (HowDoYouLikePatchForm)InputFormRef.JumpFormLow <HowDoYouLikePatchForm>(); string tile = R._("{0}パッチを有効にしますか?", patchShowName); f.Text = tile; f.ReasonLabel.Text = R._("{0}\r\n\r\n{1}", tile, reason); f.EnableButton.Text = R._("{0}パッチを有効にする", patchShowName); f.EnableButton.Click += (sender, e) => { f.Close(); PatchForm patchF = (PatchForm)InputFormRef.JumpForm <PatchForm>(); bool r = patchF.ApplyPatch(patchName1, patchName2, patchCombo); ///No Translate if (!r) { R.ShowStopError("パッチの自動適応に失敗しました。\r\nパッチ画面にエラーが表示されていないか確認してください。\r\n必須パッチの適応に失敗したということは、FEBuilderGBAの解凍に失敗している可能性があります。\r\nFEBuilderGBAを再インストールしてください。\r\nそれでも問題が解決しない場合は、バグとして報告してください。\r\n"); } f.Close(); }; if (Program.IsCommandLine) {//コマンドラインモードだったら自動適応するしかないね。 U.FireOnClick(f.EnableButton); return(checkFunc()); } f.ShowDialog(); return(checkFunc()); }
private void ImportButton_Click(object sender, EventArgs e) { if (InputFormRef.IsPleaseWaitDialog(this)) {//2重割り込み禁止 return; } if (!this.InputFormRef.CheckWriteProtectionID00()) { return; } if (AddressList.SelectedIndex < 0) { return; } string filename; if (ImageFormRef.GetDragFilePath(out filename)) { } else { string title = R._("インポートする音楽ファイルを選択してください"); string filter = R._("sound|*.s;*.wav;*.mid;*.midi;*.instrument|s|*.s|midi|*.mid;*.midi|wav|*.wav|MusicalInstrument|*.instrument|All files|*"); OpenFileDialog open = new OpenFileDialog(); open.Title = title; open.Filter = filter; Program.LastSelectedFilename.Load(this, "", open); DialogResult dr = open.ShowDialog(); if (dr != DialogResult.OK) { return; } if (!U.CanReadFileRetry(open)) { return; } Program.LastSelectedFilename.Save(this, "", open); filename = open.FileNames[0]; } uint song_id = (uint)AddressList.SelectedIndex; uint songtable_address = InputFormRef.BaseAddress + (InputFormRef.BlockSize * song_id); string error = ""; string ext = U.GetFilenameExt(filename); if (ext == ".WAV" || ext == ".WAVE") { SongTrackImportWaveForm f = (SongTrackImportWaveForm)InputFormRef.JumpFormLow <SongTrackImportWaveForm>(); f.Init(filename); DialogResult dr = f.ShowDialog(); if (dr != System.Windows.Forms.DialogResult.OK) { f.Dettach(); return; } error = SongUtil.ImportWave(f.GetFilename(), songtable_address, f.UseLoop(), f.GetFromFilename()); f.Dettach(); } else if (ext == ".MID" || ext == ".MIDI") { HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.NIMAP_By_SongTrack); HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.DrumFix_By_SongTrack); //楽器セットとオプションを選択してもらう. SongTrackImportMidiForm f = (SongTrackImportMidiForm)InputFormRef.JumpFormLow <SongTrackImportMidiForm>(); f.Init((uint)P4.Value); DialogResult dr = f.ShowDialog(); if (dr != System.Windows.Forms.DialogResult.OK) { return; } //少し時間がかかるので、しばらくお待ちください表示. using (InputFormRef.AutoPleaseWait pleaseWait = new InputFormRef.AutoPleaseWait(this)) { if (f.UseMidfix4agb()) { filename = SongUtil.ConvertMidfix4agb(filename); if (filename == "") { return; } } if (f.GetUseMID2AGB() == SongTrackImportMidiForm.ImportMethod.FEBuilderGBA) {//FEBuilderGBAでimport error = SongUtil.ImportMidiFile(filename, songtable_address , f.GetInstrumentAddr() , f.GetIgnoreMOD() , f.GetIgnoreBEND() , f.GetIgnoreLFOS() , f.GetIgnoreHEAD() , f.GetIgnoreBACK() ); } else {//mid2agbでimport error = SongUtil.ImportMidiFileMID2AGB(filename, songtable_address , f.GetInstrumentAddr() , f.GetMID2AGB_V() , f.GetMIDI2AGB_MODSC() , f.GetIgnoreMOD() , f.GetIgnoreBEND() , f.GetIgnoreLFOS() ); } } } else if (ext == ".INSTRUMENT") { //少し時間がかかるので、しばらくお待ちください表示. using (InputFormRef.AutoPleaseWait pleaseWait = new InputFormRef.AutoPleaseWait(this)) { error = SongUtil.ImportInstrument(filename, songtable_address); } } else { HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.NIMAP_By_SongTrack); HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.DrumFix_By_SongTrack); //楽器セットを選択してもらう. SongTrackImportSelectInstrumentForm f = (SongTrackImportSelectInstrumentForm)InputFormRef.JumpFormLow <SongTrackImportSelectInstrumentForm>(); f.Init((uint)P4.Value); DialogResult dr = f.ShowDialog(); if (dr != System.Windows.Forms.DialogResult.OK) { return; } //少し時間がかかるので、しばらくお待ちください表示. using (InputFormRef.AutoPleaseWait pleaseWait = new InputFormRef.AutoPleaseWait(this)) { error = SongUtil.ImportS(filename, songtable_address, f.GetInstrumentAddr()); } } if (error != "") { R.ShowStopError(error); return; } R.Notify("{0}, SongID: {1} ,Ext: {2} ,Filename: {3}", this.Text, song_id, ext, filename); int selectedIndex = AddressList.SelectedIndex; ReloadListButton.PerformClick(); AddressList.SelectedIndex = selectedIndex; SongTableForm.ReloadList(); InputFormRef.ShowWriteNotifyAnimation(this, 0); }
void ApplyStatusToLocalizationPatch() { HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.StatusToLocalization); }
void ApplyAntiHuffmanPatch() { HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.Anti_Huffman_By_Translate); }