Add new Lua function to remove all loaded assets (closes #2812). Fix crash that would occur when trying to unload an asset that requires a root asset

This commit is contained in:
Alexander Bock
2023-08-03 16:57:01 +02:00
parent 8d42537d6d
commit ecb8b06df6
4 changed files with 68 additions and 4 deletions
+17
View File
@@ -92,8 +92,25 @@ public:
*/
std::vector<const Asset*> allAssets() const;
/**
* Returns all root assets, which are assets that have been loaded directly from the
* profile or by calling the #add method.
*
* \return A list of all root assets
*/
std::vector<const Asset*> rootAssets() const;
std::vector<const ResourceSynchronization*> allSynchronizations() const;
/**
* Returns whether the provided \p asset has been loaded directly by the user or
* loaded through a profile file.
*
* \param asset The asset that should be tested
* \return Whether the \p asset has been loaded directly or included in a profile
*/
bool isRootAsset(const Asset* asset) const;
/**
* Loads the provided \p asset as a child of the provided \p parent. Loading an asset
* means that asset file gets executed and the meta information is extracted from it.