| 5681 | } |
| 5682 | |
| 5683 | static std::string ASGetLevelName(const std::string& path) { |
| 5684 | if (FileExists(path, kAnyPath)) { |
| 5685 | LevelInfoAssetRef levelinfo = Engine::Instance()->GetAssetManager()->LoadSync<LevelInfoAsset>(path); |
| 5686 | |
| 5687 | if (levelinfo.valid()) { |
| 5688 | return levelinfo->GetLevelName(); |
| 5689 | } else { |
| 5690 | LOGW << "Failed to load levelinfo for " << path << std::endl; |
| 5691 | } |
| 5692 | } else { |
| 5693 | LOGW << "Failed to load levelinfo for " << path << std::endl; |
| 5694 | } |
| 5695 | return ""; |
| 5696 | } |
| 5697 | |
| 5698 | static std::string ASGetCurrLevelName() { |
| 5699 | return ASGetLevelName(ASGetCurrLevelAbsPath()); |
no test coverage detected