MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / ASGetLevelName

Function ASGetLevelName

Source/Scripting/angelscript/asfuncs.cpp:5683–5696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5681}
5682
5683static 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
5698static std::string ASGetCurrLevelName() {
5699 return ASGetLevelName(ASGetCurrLevelAbsPath());

Callers 1

ASGetCurrLevelNameFunction · 0.70

Calls 4

FileExistsFunction · 0.85
GetAssetManagerMethod · 0.80
GetLevelNameMethod · 0.80
validMethod · 0.45

Tested by

no test coverage detected