diff --git a/DS_Map/Main Window.cs b/DS_Map/Main Window.cs index 3e40120..481c684 100644 --- a/DS_Map/Main Window.cs +++ b/DS_Map/Main Window.cs @@ -9038,15 +9038,25 @@ namespace DSPRE { private void trainerSaveCurrentButton_Click(object sender, EventArgs e) { if (!ROMToolboxDialog.flag_TrainerNamesExpanded && trainerNameTextBox.Text.Length > TrainerFile.maxNameLen) { - DialogResult d; + DialogResult d, d2; MessageBox.Show($"The length of this Trainer name exceeds {TrainerFile.maxNameLen} characters.", "Trainer data could not be saved!", MessageBoxButtons.OK, MessageBoxIcon.Error); - d = MessageBox.Show("Within the RomToolBox (found near the wild editor) you can expand this limit if you are working on an ENglish or Spanish rom (for now).", - "Do you wish to go there now?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + d = MessageBox.Show("This tool currently checks if you have performed an ARM9 edit to change the max trainer name length to " + ROMToolboxDialog.expandedTrainerNameLength + ".\n" + + "However you may have already manually edited max trainer length to be something other than that.", + "Have you done so?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (d == DialogResult.Yes) { - romToolBoxToolStripMenuItem_Click(null, null); + ROMToolboxDialog.flag_TrainerNamesExpanded = true; } + else + { + d2 = MessageBox.Show("Within the RomToolBox (found near the wild editor) you can expand this limit if you are working on an English or Spanish rom (for now).", + "Do you wish to go there now?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (d2 == DialogResult.Yes) + { + romToolBoxToolStripMenuItem_Click(null, null); + } + } return; } if(trainerNameTextBox.Text.Length > ROMToolboxDialog.expandedTrainerNameLength) diff --git a/DS_Map/ROMToolboxDialog.cs b/DS_Map/ROMToolboxDialog.cs index 8dcf626..88cb8df 100644 --- a/DS_Map/ROMToolboxDialog.cs +++ b/DS_Map/ROMToolboxDialog.cs @@ -319,28 +319,34 @@ namespace DSPRE { public void CheckExpandedTrainerNamespatchApplied() { - uint position = 0x6AC32; - switch (RomInfo.gameFamily) + if(!flag_TrainerNamesExpanded) { - case gFamEnum.DP: - if (RomInfo.gameLanguage.Equals(gLangEnum.English)) position = 0x6AC32; - else if (RomInfo.gameLanguage.Equals(gLangEnum.Spanish)) position = 0x6AC8E; - break; - case gFamEnum.Plat: - if (RomInfo.gameLanguage.Equals(gLangEnum.English)) position = 0x791DE; - else if (RomInfo.gameLanguage.Equals(gLangEnum.Spanish)) position = 0x7927E; - break; - case gFamEnum.HGSS: - if (RomInfo.gameLanguage.Equals(gLangEnum.English) || RomInfo.gameVersion.Equals(gVerEnum.SoulSilver)) position = 0x7342E; - else if (RomInfo.gameLanguage.Equals(gLangEnum.Spanish)) position = 0x73426; - break; - } - byte initValue = DSUtils.ARM9.ReadByte(position); - if (initValue == (byte)ROMToolboxDialog.expandedTrainerNameLength) + uint position = 0x6AC32; + switch (RomInfo.gameFamily) + { + case gFamEnum.DP: + if (RomInfo.gameLanguage.Equals(gLangEnum.English)) position = 0x6AC32; + else if (RomInfo.gameLanguage.Equals(gLangEnum.Spanish)) position = 0x6AC8E; + break; + case gFamEnum.Plat: + if (RomInfo.gameLanguage.Equals(gLangEnum.English)) position = 0x791DE; + else if (RomInfo.gameLanguage.Equals(gLangEnum.Spanish)) position = 0x7927E; + break; + case gFamEnum.HGSS: + if (RomInfo.gameLanguage.Equals(gLangEnum.English) || RomInfo.gameVersion.Equals(gVerEnum.SoulSilver)) position = 0x7342E; + else if (RomInfo.gameLanguage.Equals(gLangEnum.Spanish)) position = 0x73426; + break; + } + byte initValue = DSUtils.ARM9.ReadByte(position); + if (initValue == (byte)ROMToolboxDialog.expandedTrainerNameLength) + { + DisableTrainerNameExpansionPatch("Already\nApplied"); + ROMToolboxDialog.flag_TrainerNamesExpanded = true; + } + } else { DisableTrainerNameExpansionPatch("Already\nApplied"); - ROMToolboxDialog.flag_TrainerNamesExpanded = true; - } + } } #endregion