diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-01-05 15:22:20 +1100 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-01-05 15:22:20 +1100 |
commit | 06ce4f042d1c18cf6806c97653789c414bc5c7b2 (patch) | |
tree | 5bdcfe751d84f0237effa37e0db76eb89aaf4392 /source/game/StarRoot.cpp | |
parent | 57a5afa13a027429c2758582ba1f581d0272fcc4 (diff) |
add version logging for named asset sources
Diffstat (limited to 'source/game/StarRoot.cpp')
-rw-r--r-- | source/game/StarRoot.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/game/StarRoot.cpp b/source/game/StarRoot.cpp index a260dbb..bda228c 100644 --- a/source/game/StarRoot.cpp +++ b/source/game/StarRoot.cpp @@ -585,6 +585,7 @@ StringList Root::scanForAssetSources(StringList const& directories, StringList c struct AssetSource { String path; Maybe<String> name; + Maybe<String> version; float priority; StringList requires_; StringList includes; @@ -612,6 +613,7 @@ StringList Root::scanForAssetSources(StringList const& directories, StringList c auto assetSource = make_shared<AssetSource>(); assetSource->path = sourcePath; assetSource->name = metadata.maybe("name").apply(mem_fn(&Json::toString)); + assetSource->version = metadata.maybe("version").apply(mem_fn(&Json::toString)); assetSource->priority = metadata.value("priority", 0.0f).toFloat(); assetSource->requires_ = jsonToStringList(metadata.value("requires", JsonArray{})); assetSource->includes = jsonToStringList(metadata.value("includes", JsonArray{})); @@ -705,7 +707,7 @@ StringList Root::scanForAssetSources(StringList const& directories, StringList c for (auto const& source : dependencySortedSources) { auto path = File::convertDirSeparators(source->path); if (source->name) - Logger::info("Root: Detected asset source named '{}' at '{}'", *source->name, path); + Logger::info("Root: Detected asset source named '{}'{} at '{}'", *source->name, source->version ? strf(" version '{}'", *source->version) : "", path); else Logger::info("Root: Detected unnamed asset source at '{}'", path); sourcePaths.append(path); |