Updating comments

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
This commit is contained in:
Guthrie Adams
2022-01-30 01:01:10 -06:00
parent dc598a8b3c
commit e273f3ef6a
8 changed files with 49 additions and 39 deletions
@@ -122,7 +122,7 @@ namespace AtomToolsFramework
if (!IsSavable())
{
AZ_Error("AtomToolsDocument", false, "Material types can only be saved as a child: '%s'.", m_absolutePath.c_str());
AZ_Error("AtomToolsDocument", false, "Document type can not be saved: '%s'.", m_absolutePath.c_str());
return SaveFailed();
}
@@ -146,7 +146,7 @@ namespace AtomToolsFramework
if (!IsSavable())
{
AZ_Error("AtomToolsDocument", false, "Material types can only be saved as a child: '%s'.", m_absolutePath.c_str());
AZ_Error("AtomToolsDocument", false, "Document type can not be saved: '%s'.", m_absolutePath.c_str());
return SaveFailed();
}
@@ -170,7 +170,7 @@ namespace AtomToolsFramework
if (m_absolutePath == m_savePathNormalized || m_sourceDependencies.find(m_savePathNormalized) != m_sourceDependencies.end())
{
AZ_Error("AtomToolsDocument", false, "Document can't be saved over a dependancy: '%s'.", m_savePathNormalized.c_str());
AZ_Error("AtomToolsDocument", false, "Document can not be saved over a dependancy: '%s'.", m_savePathNormalized.c_str());
return SaveFailed();
}
@@ -268,7 +268,7 @@ namespace AtomToolsFramework
m_absolutePath.clear();
m_sourceDependencies.clear();
m_saveTriggeredInternally = {};
m_ignoreSourceFileChangeToSelf = {};
m_undoHistory.clear();
m_undoHistoryIndex = {};
}
@@ -289,26 +289,9 @@ namespace AtomToolsFramework
return false;
}
bool AtomToolsDocument::ReopenRecordState()
{
// Store history and property changes that should be reapplied after reload
m_undoHistoryBeforeReopen = m_undoHistory;
m_undoHistoryIndexBeforeReopen = m_undoHistoryIndex;
return true;
}
bool AtomToolsDocument::ReopenRestoreState()
{
m_undoHistory = m_undoHistoryBeforeReopen;
m_undoHistoryIndex = m_undoHistoryIndexBeforeReopen;
m_undoHistoryBeforeReopen = {};
m_undoHistoryIndexBeforeReopen = {};
return true;
}
bool AtomToolsDocument::SaveSucceeded()
{
m_saveTriggeredInternally = true;
m_ignoreSourceFileChangeToSelf = true;
AZ_TracePrintf("AtomToolsDocument", "Document saved: '%s'.\n", m_savePathNormalized.c_str());
@@ -328,6 +311,22 @@ namespace AtomToolsFramework
return false;
}
bool AtomToolsDocument::ReopenRecordState()
{
m_undoHistoryBeforeReopen = m_undoHistory;
m_undoHistoryIndexBeforeReopen = m_undoHistoryIndex;
return true;
}
bool AtomToolsDocument::ReopenRestoreState()
{
m_undoHistory = m_undoHistoryBeforeReopen;
m_undoHistoryIndex = m_undoHistoryIndexBeforeReopen;
m_undoHistoryBeforeReopen = {};
m_undoHistoryIndexBeforeReopen = {};
return true;
}
void AtomToolsDocument::AddUndoRedoHistory(const UndoRedoFunction& undoCommand, const UndoRedoFunction& redoCommand)
{
// Wipe any state beyond the current history index
@@ -349,13 +348,13 @@ namespace AtomToolsFramework
if (m_absolutePath == sourcePath)
{
// ignore notifications caused by saving the open document
if (!m_saveTriggeredInternally)
if (!m_ignoreSourceFileChangeToSelf)
{
AZ_TracePrintf("AtomToolsDocument", "Document changed externally: '%s'.\n", m_absolutePath.c_str());
AtomToolsFramework::AtomToolsDocumentNotificationBus::Broadcast(
&AtomToolsFramework::AtomToolsDocumentNotificationBus::Events::OnDocumentExternallyModified, m_id);
}
m_saveTriggeredInternally = false;
m_ignoreSourceFileChangeToSelf = false;
}
else if (m_sourceDependencies.find(sourcePath) != m_sourceDependencies.end())
{
@@ -24,7 +24,7 @@ AZ_POP_DISABLE_WARNING
namespace AtomToolsFramework
{
//! AtomToolsDocumentSystemComponent is the central component of the Material Editor Core gem
//! AtomToolsDocumentSystemComponent is the central component for managing documents
class AtomToolsDocumentSystemComponent
: public AZ::Component
, private AtomToolsDocumentNotificationBus::Handler
@@ -14,7 +14,7 @@
namespace AtomToolsFramework
{
//! PreviewRendererCaptureState renders a thumbnail to a pixmap and notifies MaterialOrModelThumbnail once finished
//! PreviewRendererCaptureState renders a preview to an image
class PreviewRendererCaptureState final
: public PreviewRendererState
, public AZ::TickBus::Handler
@@ -31,7 +31,7 @@ namespace AtomToolsFramework
//! AZ::Render::FrameCaptureNotificationBus::Handler overrides...
void OnCaptureFinished(AZ::Render::FrameCaptureResult result, const AZStd::string& info) override;
//! This is necessary to suspend capture to allow a frame for Material and Mesh components to assign materials
//! This is necessary to suspend capture until preview scene is ready
int m_ticksToCapture = 1;
};
} // namespace AtomToolsFramework