From 06ce4f042d1c18cf6806c97653789c414bc5c7b2 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Sun, 5 Jan 2025 15:22:20 +1100 Subject: [PATCH] add version logging for named asset sources --- source/game/StarRoot.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 name; + Maybe version; float priority; StringList requires_; StringList includes; @@ -612,6 +613,7 @@ StringList Root::scanForAssetSources(StringList const& directories, StringList c auto assetSource = make_shared(); 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);