undo/redo for replacing a sound

This commit is contained in:
2025-06-18 11:58:59 -05:00
parent 5d4ff5134d
commit 89a3e04187
3 changed files with 34 additions and 8 deletions

View File

@@ -849,3 +849,13 @@ bool aCreateDeleteSound::redo_me() {
ResMgr::sounds.free(sound_to_fname(index));
return sound.saveToFile(get_snd_path(index).string());
}
bool aReplaceSound::undo_me() {
ResMgr::sounds.free(sound_to_fname(index));
return old_sound.saveToFile(get_snd_path(index).string());
}
bool aReplaceSound::redo_me() {
ResMgr::sounds.free(sound_to_fname(index));
return new_sound.saveToFile(get_snd_path(index).string());
}