Merge pull request #6921 from aws-lumberyard-dev/Atom/guthadam/atom_tools_document_count_function
Atom Tools: added function to get the number of active documents
This commit is contained in:
+3
@@ -71,6 +71,9 @@ namespace AtomToolsFramework
|
||||
|
||||
//! Save all documents
|
||||
virtual bool SaveAllDocuments() = 0;
|
||||
|
||||
//! Get number of allocated documents
|
||||
virtual AZ::u32 GetDocumentCount() const = 0;
|
||||
};
|
||||
|
||||
using AtomToolsDocumentSystemRequestBus = AZ::EBus<AtomToolsDocumentSystemRequests>;
|
||||
|
||||
+6
@@ -69,6 +69,7 @@ namespace AtomToolsFramework
|
||||
->Event("SaveDocumentAsCopy", &AtomToolsDocumentSystemRequestBus::Events::SaveDocumentAsCopy)
|
||||
->Event("SaveDocumentAsChild", &AtomToolsDocumentSystemRequestBus::Events::SaveDocumentAsChild)
|
||||
->Event("SaveAllDocuments", &AtomToolsDocumentSystemRequestBus::Events::SaveAllDocuments)
|
||||
->Event("GetDocumentCount", &AtomToolsDocumentSystemRequestBus::Events::GetDocumentCount)
|
||||
;
|
||||
|
||||
behaviorContext->EBus<AtomToolsDocumentRequestBus>("AtomToolsDocumentRequestBus")
|
||||
@@ -457,6 +458,11 @@ namespace AtomToolsFramework
|
||||
return result;
|
||||
}
|
||||
|
||||
AZ::u32 AtomToolsDocumentSystemComponent::GetDocumentCount() const
|
||||
{
|
||||
return aznumeric_cast<AZ::u32>(m_documentMap.size());
|
||||
}
|
||||
|
||||
AZ::Uuid AtomToolsDocumentSystemComponent::OpenDocumentImpl(AZStd::string_view sourcePath, bool checkIfAlreadyOpen)
|
||||
{
|
||||
AZStd::string requestedPath = sourcePath;
|
||||
|
||||
+1
@@ -74,6 +74,7 @@ namespace AtomToolsFramework
|
||||
bool SaveDocumentAsCopy(const AZ::Uuid& documentId, AZStd::string_view targetPath) override;
|
||||
bool SaveDocumentAsChild(const AZ::Uuid& documentId, AZStd::string_view targetPath) override;
|
||||
bool SaveAllDocuments() override;
|
||||
AZ::u32 GetDocumentCount() const override;
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AZ::Uuid OpenDocumentImpl(AZStd::string_view sourcePath, bool checkIfAlreadyOpen);
|
||||
|
||||
Reference in New Issue
Block a user