diff --git a/DS_Map/Main Window.cs b/DS_Map/Main Window.cs index cae167c..7e7b400 100644 --- a/DS_Map/Main Window.cs +++ b/DS_Map/Main Window.cs @@ -7767,6 +7767,16 @@ namespace DSPRE { } } } + + public void RefreshAbilities(int forPokemon) { + DialogResult res = MessageBox.Show("You have modified a Pokemon's ability.\nDo you wish to refresh the Trainer Editor so your changes are available?", "Refresh Trainer Editor", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + if (res.Equals(DialogResult.Yes)) { + int currentIndex = trainerComboBox.SelectedIndex; + SetupTrainerEditor(); + trainerComboBox.SelectedIndex = currentIndex; + } + } + private void SetupTrainerEditor() { Helpers.DisableHandlers(); diff --git a/DS_Map/PersonalDataEditor.cs b/DS_Map/PersonalDataEditor.cs index e3ce08c..d0bdec8 100644 --- a/DS_Map/PersonalDataEditor.cs +++ b/DS_Map/PersonalDataEditor.cs @@ -18,6 +18,7 @@ namespace DSPRE { private PokemonPersonalData currentLoadedFile = null; private static bool dirty = false; + private bool modifiedAbilities = false; private static readonly string formName = "Personal Data Editor"; PokemonEditor _parent; @@ -275,6 +276,7 @@ namespace DSPRE { } currentLoadedFile.firstAbility = (byte)ability1InputComboBox.SelectedIndex; setDirty(true); + modifiedAbilities = true; } private void ability2InputComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (Helpers.HandlersDisabled) { @@ -282,6 +284,7 @@ namespace DSPRE { } currentLoadedFile.secondAbility = (byte)ability2InputComboBox.SelectedIndex; setDirty(true); + modifiedAbilities = true; } private void eggGroup1InputCombobox_SelectedIndexChanged(object sender, EventArgs e) { if (Helpers.HandlersDisabled) { @@ -391,6 +394,10 @@ namespace DSPRE { } private void saveDataButton_Click(object sender, EventArgs e) { currentLoadedFile.SaveToFileDefaultDir(currentLoadedId, true); + if (modifiedAbilities) { + EditorPanels.MainProgram.RefreshAbilities(currentLoadedId); + modifiedAbilities = false; + } setDirty(false); } //-------------------------------