mirror of
https://github.com/AdAstra-LD/DS-Pokemon-Rom-Editor.git
synced 2026-05-21 03:49:21 -05:00
Refresh Trainer Editor on ability change
This commit is contained in:
parent
3f2f5c0731
commit
2e8a44343e
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
//-------------------------------
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user