Added asset id into compile function to facilitate event sending

This commit is contained in:
Xiao Qi 2023-02-22 16:43:49 +08:00
parent f7bb8606be
commit 5623115e29
3 changed files with 3 additions and 3 deletions

View File

@ -383,7 +383,7 @@ namespace SHADE
return result; return result;
} }
void SHAssetManager::CompileAsset(AssetPath const& path, bool genMeta) noexcept void SHAssetManager::CompileAsset(AssetPath const& path, bool genMeta, AssetID id) noexcept
{ {
if (!std::filesystem::exists(path)) if (!std::filesystem::exists(path))
{ {

View File

@ -90,7 +90,7 @@ namespace SHADE
static std::vector<SHAssetData const*> GetAllDataOfType(AssetType type) noexcept; static std::vector<SHAssetData const*> GetAllDataOfType(AssetType type) noexcept;
static std::vector<SHAsset> GetAllRecordOfType(AssetType type) noexcept; static std::vector<SHAsset> GetAllRecordOfType(AssetType type) noexcept;
static void CompileAsset(AssetPath const& path, bool genMeta) noexcept; static void CompileAsset(AssetPath const& path, bool genMeta, AssetID id = 0) noexcept;
static FolderPointer GetRootFolder() noexcept; static FolderPointer GetRootFolder() noexcept;
static void RefreshDirectory() noexcept; static void RefreshDirectory() noexcept;

View File

@ -233,7 +233,7 @@ namespace SHADE
{ {
if(ImGui::Selectable("Compile")) if(ImGui::Selectable("Compile"))
{ {
SHAssetManager::CompileAsset(file.path, !file.compiled); SHAssetManager::CompileAsset(file.path, !file.compiled, file.assetMeta->id);
QueueRefresh(); QueueRefresh();
} }
ImGui::EndPopup(); ImGui::EndPopup();