EMotion FX: Saving Anim Graph with CTRL+S displays unsaved changes prompt when no changes were made (#5936)

Saving an anim graph did not adjust the dirty flag and thus the saved changes dialog kept showing anim graphs that already saved the latest changes.

Signed-off-by: Benjamin Jillich <jillich@amazon.com>
This commit is contained in:
Benjamin Jillich
2021-11-30 11:25:05 +01:00
committed by GitHub
parent 271004635c
commit abf3e69b97
2 changed files with 9 additions and 0 deletions
@@ -581,6 +581,11 @@ namespace EMStudio
animGraph->SetFileName(filename.c_str());
}
if (parameters.GetValueAsBool("updateDirtyFlag", this))
{
animGraph->SetDirtyFlag(false);
}
GetMainWindow()->GetFileManager()->SourceAssetChanged(filename);
// Add file in case it did not exist before (when saving it the first time).
@@ -330,6 +330,10 @@ namespace EMotionFX
const QString animGraphFilename = GenerateTempAnimGraphFilename();
SaveCurrentAnimGraph(animGraphFilename);
// Pretend editing the anim graph
EMotionFX::AnimGraph* animGraph = m_animGraphPlugin->GetActiveAnimGraph();
animGraph->SetDirtyFlag(true);
// Prepare a watcher to press the ok button when the SaveDirtySettingsWindow appears.
ModalPopupHandler saveDirtyPopupHandler;